Oracle: Find Object Grants

 

Table/View Grants

user_tab_privs

* Contains object grants for which the current user is the
– object owner,
– grantor,
– or grantee.

all_tab_privs

* Contains object grants
– all object grants from user_tab_privs
– Plus object grants for which an enabled role or PUBLIC is the grantee, i.e. object grants via role or PUBLIC.

dba_tab_privs

* Contains all object grants in the entire database

Examples

* Find All Tables Granted to A User

SELECT * FROM dba_tab_privs WHERE grantee='A_USER';

* Find Tables Granted to Another User
– Login grantor schema

SELECT grantee, TABLE_NAME
FROM user_tab_privs
WHERE grantee = 'ANOTHER_USER';
 
SELECT grantee, TABLE_NAME
FROM all_tab_privs
WHERE grantee = 'ANOTHER_USER';

System Object Grants

dba_sys_privs

* Contains system privileges granted to users and roles.
* This view does not display the USERNAME column

user_sys_privs

* Contains system privileges granted to the current user.
* This view does not display the GRANTEE column,
* This view instead displays the USERNAME column.

Role Grants

dba_role_privs

* Contains roles granted to all users and roles in the database.

user_sys_privs

* Contains roles granted to the current user.

This entry was posted in oracle and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.