解释计划对于 select 工作正常但不适用于 Merge 语句

Explain plan for is working fine for select but not for Merge statements

我正在尝试分析我编写的合并语句的执行计划,但是当我 运行 它在数据库中时它抛出 01031.00000 - “权限不足”错误。当用于 select 语句时,相同的解释计划工作正常并且计划成功生成。任何人都可以帮助解释为什么仅合并语句就很高兴吗?

要执行 EXPLAIN PLAN 语句,您需要 执行 语句相同的 权限。

因此,如果您仅对合并的 table 授予 SELECT,您将无法执行 MERGE 执行EXPLAIN PLAN 声明。

这里是相关的引用形式 Documentation

You must also have the privileges necessary to execute the SQL statement for which you are determining the execution plan. If the SQL statement accesses a view, then you must have privileges to access any tables and views on which the view is based. If the view is based on another view that is based on a table, then you must have privileges to access both the other view and its underlying table.