查看当前用户权限:
SQL> select * from session_privs;
查询某个用户被赋予的系统权限.
Select * from user_sys_privs;
或者: select * from DBA_SYS_PRIVS where grantee='XXX'
(需要当前用户拥有DBA角色)
查询当前用户被授予的角色:
1. Select * from SESSION_ROLES order by ROLE
说明: 这个查询会返回当前用户所被授予的全部角色, 其中包括
嵌套授权的角色. 例如将DBA角色授予了一个用户,DBA角色
已经被授予的角色(例如 exp_full_database 和 imp_full_database)
也会被查询出来
2. Select * from USER_ROLE_PRIVS
查询某一角色被赋予的系统权限
Select Privilege from ROLE_SYS_PRIVS where ROLE=&Role
输入 role='CONNECT'
查询当前角色被授予的角色
Select GRANTED_ROLE from ROLE_ROLE_PRIVS where ROLE=&ROLE
输入 role= 'DBA'
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;
8、查看RESOURCE具有那些权限
用SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE='RESOURCE';