How to find out to which roles have grants on certain tables?

I have 2 tables and I want to know what object (table) grants are assigned to a role. Is there a way to find it out?

31.5k 13 13 gold badges 101 101 silver badges 148 148 bronze badges asked Jul 26, 2016 at 22:11 catinredboots catinredboots 71 2 2 gold badges 3 3 silver badges 6 6 bronze badges I want to know what object(table) grant are assigned to a role. Commented Jul 27, 2016 at 3:39

2 Answers 2

I was able to find an answer somewhere else. So I need to query role_tab_privs .

Here is the query in case somebody else will need it:

select role, table_name, privilege from role_tab_privs where table_name in ('TABLE_NAME') order by role; 
31.5k 13 13 gold badges 101 101 silver badges 148 148 bronze badges answered Jul 27, 2016 at 14:39 catinredboots catinredboots 71 2 2 gold badges 3 3 silver badges 6 6 bronze badges
SELECT * FROM DBA_TAB_PRIVS WHERE GRANTEE='' and table_name = ''; 
88.2k 30 30 gold badges 417 417 silver badges 653 653 bronze badges answered Feb 22, 2023 at 11:40 user269482 user269482 Welcome, you could improve your answer by explaining why it works. Commented Feb 22, 2023 at 12:49

Related

Hot Network Questions

Subscribe to RSS

Question feed

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2024 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2024.9.11.15092