Friday, February 5, 2010

Query to get previledges assigned to the user in oracle

select  lpad(‘ ‘, 2*level)
granted_role “User, his roles and privileges”
from
(
/* THE USERS */
select
null grantee,
username granted_role
from
dba_users
where
username like upper(‘%&enter_username%’)
/* THE ROLES TO ROLES RELATIONS */
union
select
grantee,
granted_role
from
dba_role_privs
/* THE ROLES TO PRIVILEGE RELATIONS */
union
select
grantee,
privilege
from
dba_sys_privs
)
start with grantee is null
connect by grantee = prior granted_role;

0 Responses to “Query to get previledges assigned to the user in oracle”

Post a Comment

Disclaimer

The ideas, thoughts and concepts expressed here are my own. They, in no way reflect those of my employer or any other organization/client that I am associated. The articles presented doesn't imply to any particular organization or client and are meant only for knowledge Sharing purpose. The articles can't be reproduced or copied without the Owner's knowledge or permission.