在使用oracle 11g时,使用自己创建的角色并授予了dba权限在执行select * from V$log时还是提示表或视图不存在,
切换到scott用户也不行,于是在往上切换到sys发现就可以,查阅资料后尝试了如下两种方式均都可以实现查询
grant select_catalog_role to userName 和 grant select any dictionary to userName
那么select any dictionary与select_catalog_role这两个之间存在着什么样的区别?
相同之处:
1、如果你的用户拥有了这两个中的一个,基本就可以查询数据字典
不同之处:
1、select any dictionary是一种系统权限(system privilege),而select_catalog_role 是一种角色(a role)。
2、角色的话需要重新登录或者切换到目标用户下显式的set role select_catalog_role来生效,而赋予系统权限是立即生效的,revoke回收权限也是立即生效的。
3、select_catalog_role可以查看一些数据字典的视图·(可以看role的定义),如dba_之类的,而select any dictionary可以查看sys的表,select_catalog_role看不到。