有人可以告诉我如何在sql-console中显示特定用户的所有特权/规则吗?
您可以尝试以下视图。
SELECT * FROM USER_SYS_PRIVS;
SELECT * FROM USER_TAB_PRIVS;
SELECT * FROM USER_ROLE_PRIVS;
DBA和其他超级用户可以使用DBA_
这些相同视图的版本找到授予其他用户的特权。它们包含在文档中。
这些视图仅显示直接授予用户的特权。查找所有特权,包括通过角色间接授予的特权,都需要更复杂的递归SQL语句:
select * from dba_role_privs connect by prior granted_role = grantee start with grantee = '&USER' order by 1,2,3;
select * from dba_sys_privs where grantee = '&USER' or grantee in (select granted_role from dba_role_privs connect by prior granted_role = grantee start with grantee = '&USER') order by 1,2,3;
select * from dba_tab_privs where grantee = '&USER' or grantee in (select granted_role from dba_role_privs connect by prior granted_role = grantee start with grantee = '&USER') order by 1,2,3,4;
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句