SQL 开发人员:无法收集系统统计信息:权限不足 [英] SQL Developer : Unable to gather system statistics : insufficient privileges

查看:62
本文介绍了SQL 开发人员:无法收集系统统计信息:权限不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图收集系统统计信息以获取报告信息.我通过 SQL developer 尝试了同样的方法,发现了一些权限问题,我参考了这个 link 解决方案,

I was trying to gather system statistics to get the report information. I tried the same via SQL developer and found some privillage issues and I referred this link for the solution,

GRANT CREATE session TO TEST_DB;
GRANT GATHER_SYSTEM_STATISTICS TO TEST_DB; 
GRANT CONNECT TO TEST_DB;

所有授权都成功了.但是,

All grant succeeded.But,

execute dbms_stats.gather_system_stats ('START'); 

给了我错误

ORA-20000: Unable to gather system statistics : insufficient privileges
ORA-06512: at "SYS.DBMS_STATS", line 23190

最后,我尝试使用命令行并完成了没有任何问题的事情,

Finally, I tried with command line and finished the things without any issues,

PL/SQL procedure successfully completed.

为什么在SQL developer中显示权限不足的问题?

why it was showing insufficient privileges issue in SQL developer ?

推荐答案

GATHER_SYSTEM_STATISTICS 等角色权限(相对于 CREATE TABLE 等 sys 权限)不占用立即生效;它们仅在下次登录时生效(大概是因为 Oracle 在内部进行了某种缓存).

Role privileges like GATHER_SYSTEM_STATISTICS (as opposed to sys privileges, like CREATE TABLE) don't take effect immediately; they only take effect at the next logon (presumably because Oracle does some kind of caching internally).

因此,如果您在 SQL Developer 中注销并重新登录,它也会起作用.

So if you'd logged off and on in SQL Developer, it would have worked, as well.

这篇关于SQL 开发人员:无法收集系统统计信息:权限不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆