1. 查询连接用户是否具有系统权限SELECT ANY TABLE
select count(*) from user_sys_privs where PRIVILEGE='SELECT ANY TABLE';
2. 查询连接用户是否具有具备系统权限SELECT ANY TABLE的预定义角色
select count(*) from user_role_privs where GRANTED_ROLE in ('DBA','IMP_FULL_DATABASE','OLAP_DBA','DATAPUMP_IMP_FULL_DATABASE','EXP_FULL_DATABASE');
3.查询是否具有具备系统权限SELECT ANY TABLE的 自定义角色。
SELECT count(*) FROM ROLE_SYS_PRIVS WHERE PRIVILEGE='SELECT ANY TABLE';
4. user_tab_privs 用户对象权限表
role_tab_privs 角色对象权限表
下面是查询可以访问某个schema的哪些对象。
select owner||'.'||table_name AS TABLES from user_tab_privs where owner in ('A','B') and PRIVILEGE='SELECT'
union
SELECT owner||'.'||table_name from user_tab_privs where owner ='C' and table_name in ('T1','T2') and PRIVILEGE='SELECT'
union
select owner||'.'||table_name from role_tab_privs where owner in ('A','B') and PRIVILEGE='SELECT'
union
select owner||'.'||table_name from role_tab_privs where owner ='C' and table_name in ('T1','T2') and PRIVILEGE='SELECT';
下面为参考其他人给出的相关查询。标签:privs,查询,owner,select,tab,oracle,权限,SELECT,user From: https://www.cnblogs.com/JennyYu/p/16956048.html
1.查看所有用户: select * from dba_user; select * from all_users; select * from user_users; 2.查看用户系统权限: select * from dba_sys_privs; select * from all_sys_privs; select * from user_sys_privs; 3.查看用户对象权限: select * from dba_tab_privs; select * from all_tab_privs; select * from user_tab_privs; 4.查看所有角色: select * from dba_roles; 5.查看用户所拥有的角色: select * from dba_role_privs; select * from user_role_privs; 6.查看当前用户的缺省表空间 select username,default_tablespace from user_users; 7.查看某个角色的具体权限, 如grant connect,resource,create session,create view to TEST; 查看RESOURCE具有那些权限, 用SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE='RESOURCE';