ORACLE数据字典视图的种类分别为:USER,ALL 和 DBA.(这里的*可以为TABLES,INDEXES,OBJECTS,USERS等。)
- USER_*:有关用户所拥有的对象信息,即用户自己创建的对象信息
- ALL_*:有关用户可以访问的对象的信息,即用户自己创建的对象的信息加上其他用户创建的对象但该用户有权访问的信息
- DBA_*:有关整个数据库中对象的信息
查看所有用户
1 select * from dba_users; 2 3 select * from all_users; 4 5 select * from user_users;
查看用户系统权限
1 select * from dba_sys_privs; 2 3 select * from all_sys_privs; 4 5 select * from user_sys_privs;
查看用户所具有的所有权限
1 select privilege from dba_sys_privs where grantee='HR' 2 union 3 select privilege from dba_sys_privs 4 where grantee in (select granted_role from dba_role_privs where grantee='HR');
查看用户对象权限
1 select * from dba_tab_privs; 2 3 select * from all_tab_privs; 4 5 select * from user_tab_privs;
查看所有角色
1 select * from dba_roles;
查看用户所拥有的角色
1 select * from dba_role_privs; 2 3 select * from user_role_privs;
查看当前用户的缺省表空间
1 select username,default_tablespace from user_users;
查看角色(RESOURCE)具有那些权限
1 SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE='RESOURCE';