How to show all privileges from a user in 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中显示用户的所有权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在oracle中显示用户的所有权限?


基础教程推荐
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01