No of roles and privs assigned to each role

Hi,
I need a query to find a no of roles in the database and all privs assigned to each role.
Please help me.
nirvairghumanAsked:
Who is Participating?
 
sdstuberConnect With a Mentor Commented:
select count(*) from dba_roles;  -- count of all roles


select r.role,count(p.privilege) from dba_roles r, dba_sys_privs p    -- count of privileges for each role
where r.role = p.grantee
group by r.role
0
 
slightwv (䄆 Netminder)Connect With a Mentor Commented:
I might have missed a view or two but here are the core ones:

select role from dba_roles;

select role, granted_role from role_role_privs;
select role, privilege from role_sys_privs;
select role, table_name, column_name, privilege from role_tab_privs;
0
 
nirvairghumanAuthor Commented:
Thanks a lot Guys,
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.