Thursday, June 11, 2009

What priveleges have been granted to a user?

select grantee, granted_role
from dba_role_privs
where grantee in ('MYUSER','MYROLE')
order by grantee, granted_role;

select grantee, privilege
from dba_sys_privs
where grantee in ('MYUSER','MYROLE')
order by grantee, privilege;

select grantee, substr(privilege,1,20), owner||'.'||table_name
from dba_tab_privs
where grantee in ('MYUSER','MYROLE')
order by grantee, owner, table_name, privilege;