如何在oracle中显示用户的所有权限?

How to show all privileges from a user in oracle?(如何在oracle中显示用户的所有权限?)
本文介绍了如何在oracle中显示用户的所有权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我如何在 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 previous given_role = grantee start with grantee = '&USER' order by 1,2,3;select * from dba_sys_privs where grantee = '&USER' or grantee in (select grantee from dba_role_privs connect by previous given_role = grantee start with grantee = '&USER') order by 1,2,3;select * from dba_tab_privs where grantee = '&USER' or grantee in (select grantee from dba_role_privs connect by previous given_role = grantee start with grantee = '&USER') 按 1,2,3,4 排序;

Can someone please tell me how to show all privileges/rules from a specific user in the sql-console?

解决方案

You can try these below views.

SELECT * FROM USER_SYS_PRIVS; 
SELECT * FROM USER_TAB_PRIVS;
SELECT * FROM USER_ROLE_PRIVS;

DBAs and other power users can find the privileges granted to other users with the DBA_ versions of these same views. They are covered in the documentation .

Those views only show the privileges granted directly to the user. Finding all the privileges, including those granted indirectly through roles, requires more complicated recursive SQL statements:

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;

这篇关于如何在oracle中显示用户的所有权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)