Oracle查看用户权限

作为DBA帐号登录,查看他的权限。

set linesize 200;
col privs_type format a10;
col username format a20;
col table_name format a35;
col column_name format a25;
col PRIVILEGE format a60;
with t1 as
(
select upper(‘edmond‘) username from dual
)
select ‘角色‘ privs_type,‘NULL‘ username,‘NULL‘ table_name,‘NULL‘ column_name,wm_concat(GRANTED_ROLE) PRIVILEGE from dba_role_privs,t1 where GRANTEE=t1.username group by ‘角色‘,‘NULL‘,‘NULL‘,‘NULL‘
union all
select ‘表权限‘,owner,TABLE_NAME,‘NULL‘,wm_concat(PRIVILEGE) PRIVILEGE from dba_tab_privs,t1 where GRANTEE=t1.username group by ‘表权限‘,owner,TABLE_NAME,‘NULL‘
union all
select ‘列权限‘,owner,TABLE_NAME,column_name,wm_concat(PRIVILEGE) PRIVILEGE from dba_col_privs,t1 where GRANTEE=t1.username group by ‘列权限‘,owner,TABLE_NAME,column_name;