A. 查看Oracle数据库DBA角色,以及如何去除用户的DBA权限
突然想查看数据库中哪些用户拥有DBA权限,于是网络了一下,找到了这一条语句专:
查看
select * from dba_role_privs where granted_role='DBA'
注意:执行这属一条语句需要执行者本来就要有DBA权限
另外如果要是想收回某用户的DBA权限则执行:
revoke dba from user_Name
B. 如何查看oracle用户具有的权限和角色
1.查看所有用户:select * from dba_users;select * from all_users;select * from user_users;
2.查看用户或角色系统权限(直接赋值给用户或角色的系统权限):select * from dba_sys_privs;select * from user_sys_privs;3.查看角色(只能查看登陆用户拥有的角色)所包含的权限sql>select * from role_sys_privs;
4.查看用户对象权限:select * from dba_tab_privs;select * from all_tab_privs;select * from user_tab_privs;
5.查看所有角色:select * from dba_roles;
6.查看用户或角色所拥有的角色:select * from dba_role_privs;select * from user_role_privs;7.查看哪些用户有sysdba或sysoper系统权限(查询时需要相应权限)select * from V$PWFILE_USERS查看某一用户 wkk的拥有的权限:SQL> select * from dba_sys_privs where grantee=‘Wkk"
比如我要查看用户 wzsb的拥有的角色:SQL> select * from dba_role_privs where grantee=‘WZSB‘
查看一个用户所有的权限及角色select privilege from dba_sys_privs where grantee=‘WZSB‘unionselect privilege from dba_sys_privs where grantee in(select granted_role from dba_role_privs where grantee=‘WZSB‘ );
8.当前用户被激活的全部角色 select * from session_roles;
9.查看某个用户所拥有的角色
select * from dba_role_privs where grantee=‘用户名‘;
10.查看某个角色所拥有的权限
select * from dba_sys_privs where grantee=‘CONNECT‘;
select * from session_privs; --当前用户所拥有的全部权限
11.查看哪些用户具有DBA的角色
select grantee from dba_role_privs where granted_role=‘DBA‘
12.查看Oracle提供的系统权限
select name from sys.system_privilege_map
13.查询当前用户可以访问的所有数据字典视图。select * from dict where comments like ‘%grant%‘;
14.显示当前数据库的全称select * from global_name;
如何查看oracle用户具有的权限和角色
标签:oraclsysteedba包含selegrantrole权限