gpt4 book ai didi

database - SQL 错误 : ORA-01039: insufficient privileges on underlying objects of the view

转载 作者:太空狗 更新时间:2023-10-30 01:57:13 25 4
gpt4 key购买 nike

我正在尝试使用以下查询获取 View 的解释计划

explain plan for select * from SCHEMA1.VIEW1;

但是我得到了

错误报告-

SQL Error: ORA-01039: insufficient privileges on underlying objects of the view

01039. 00000 - "insufficient privileges on underlying objects of the view"


*Cause: Attempting to explain plan on other people's view without
the necessary privileges on the underlying objects of the view.


*Action: Get necessary privileges or do not perform the offending operation.

在获取 SQL 授权语句方面需要帮助

最佳答案

Oracle Docs中明确说明:

安全模型

此包以调用用户的权限运行,而不是包所有者 (SYS)。表函数 DISPLAY_CURSOR 需要对以下固定 View 具有选择权限:V$SQL_PLAN、V$SESSION 和 V$SQL_PLAN_STATISTICS_ALL。

使用 DISPLAY_AWR 函数需要用户对 DBA_HIST_SQL_PLAN、DBA_HIST_SQLTEXT 和 V$DATABASE 具有 SELECT 权限。

使用 DISPLAY_SQLSET 函数要求用户对 ALL_SQLSET_STATEMENTS 和 ALL_SQLSET_PLANS 具有 SELECT 权限。

使用 DISPLAY_SQL_PLAN_BASELINE 函数,用户要求用户对 DBA_SQL_PLAN_BASELINES 具有 SELECT 权限。

所有这些权限都作为 SELECT_CATALOG 角色的一部分自动授予。


关于database - SQL 错误 : ORA-01039: insufficient privileges on underlying objects of the view,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21884073/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com