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中显示用户的所有权限?
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- SQL 临时表问题 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01