Oracle Roles

-- List all the roles

select * from dba_roles
order by 1;


--List the granted roles

break on "ROLE" on "PRIVILEGE";

select     substr(role,1,20)        "ROLE",
    substr(privilege,1,30)    "PRIVILEGE",
    ADMin_option
from     role_sys_privs
order by 1 asc, 2 asc;


--Individual roles


break on "USER" on "ROLE";

select substr(GRANTEE,1,10)        "USER",
       substr(GRANTED_ROLE,1,20)    "ROLE",
       substr(ADMIN_OPTION,1,3)        "ADM"
from dba_role_privs
order by 1,2;



Post a Comment

And that's all there is to it!

If anyone has any other questions or requests for future How To posts, you can either ask them in the comments or email me. Please don't feel shy at all!

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

Previous Post Next Post