Skip to content

Instantly share code, notes, and snippets.

@tothda
Created November 19, 2008 08:28
Show Gist options
  • Save tothda/26458 to your computer and use it in GitHub Desktop.
Save tothda/26458 to your computer and use it in GitHub Desktop.
select
lpad(' ', 2*level) || c "Privilege, Roles and Users"
from
(
/* THE PRIVILEGES */
select
null p,
name c
from
system_privilege_map
where
name like upper('%&enter_privliege%')
/* THE ROLES TO ROLES RELATIONS */
union
select
granted_role p,
grantee c
from
dba_role_privs
/* THE ROLES TO PRIVILEGE RELATIONS */
union
select
privilege p,
grantee c
from
dba_sys_privs
)
start with p is null
connect by p = prior c;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment