Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Hierarchical query for role to role to privliege

2753965Mar 17 2015 — edited Mar 17 2015

Hello,

I would like to return parent role, child role, and all privileges.

create role test_role1;

create role test_role2;


grant test_role2 to test_role1;

grant select on user1.tab1 to test_role1;

grant select on user1.tab2 to test_role1;

grant select on user2.tab3 to test_role2;

grant select on user2.tab4 to test_role2;

I would like to get back

Parent role

>>Any parent role privs

>>Sub Role

>>>>Any sub role privs

So it would be

test_role1

>>Select on tab1

>>Select on tab2

>>Test_role2

>>>>Select on tab3

>>>>Select on tab4

This is on 11.2.0.3

I have been trying unions, connect by, group by with varied results but not what I need.  Any help would be appreciated.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 14 2015
Added on Mar 17 2015
3 comments
1,714 views