selectlpad(' ', 2*level) || granted_role "User, his roles and privileges"
from(
/* THE USERS */
select
null grantee,
username granted_rolefrom
dba_userswhere
username like upper('%&enter_username%')
/* THE ROLES TO ROLES RELATIONS */
union
select
grantee,
granted_rolefrom
dba_role_privs/* THE ROLES TO PRIVILEGE RELATIONS */
union
select
grantee,
privilegefrom
dba_sys_privs)
start with grantee is null
connect by grantee = prior granted_role;
No comments:
Post a Comment