oracle常用的一些查询命令

 1 1.查看所有用户
 2 
 3 select * from dba_users;
 4 select * from all_users;
 5 select * from user_users;
 6 
 7 2.查看用户或角色系统权限(直接赋值给用户或角色的系统权限)
 8 
 9 select * from dba_sys_privs;
10 select * from user_sys_privs;
11 
12 3.查看角色(只能查看登录用户拥有的角色)所包含的权限
13 
14 select * fromrole_sys_privs;
15 
16 4.查看用户对象权限
17 
18 select * from dba_tab_privs;
19 select * from all_tab_privs;
20 select * from user_tab_privs;
21 
22 5.查看所有角色
23 
24 select * from dba_roles;
25 
26 6.查看用户或角色所拥有的角色;
27 
28 select * from dba_role_privs;
29 select * from user_role_privs;
30 
31 7.查看哪些用户有sysdba 或sysoper系统权限(查询时需要相应权限)
32 
33 select * from v$pwfile_users
34 
35 比如要查看用户wzsb 的拥有的权限
36 
37 select * from dba_sys_privs  where grantee ='wzsb';
38 
39 比如要查看用户wzsb拥有的角色
40 
41 select * from dba_role_privs where grantee = 'wzsb';
42 
43 
44 查看一个用户所拥有的权限及角色
45 
46 select privilege from dba_sys_privs where grantee ='wzsb'
47 
48 union 
49 
50 select privilege from dba_sys_privs where grantee in
51 
52 (select granted_role from dba_role_privs where grantee ='wzsb');

 

上一篇:Hive元数据信息对应MySQL数据库表


下一篇:oracle常用sql语句