0

I'm trying to determine what table permissions a user has. The usual way to determine this is to do:

 SELECT * FROM DBA_TAB_PRIVS WHERE GRANTEE = '<username>';

However, the username I am looking for is not in the table DBA_TAB_PRIVS. But it does show up in DBA_USERS, and I know the user HAS privileges because they are able to log in and do SELECT queries.

In fact there are many such discrepancies:

 SELECT USERNAME, GRANTEE FROM DBA_USERS u
 LEFT JOIN DBA_TAB_PRIVS p
 ON u.USERNAME = p.GRANTEE
 ORDER BY USERNAME

gives:

 USERNAME  GRANTEE
 --------  -------
 BOB17     (null)
 DBA       DBA
 DBA       DBA
 DBA       DBA
 DBA       DBA
 JANET5    (null)
 STEVE34   (null)
 SYSTEM    SYSTEM
 SYSTEM    SYSTEM
 SYSTEM    SYSTEM

So how can I determine the privileges for users who are not in the DBA_TAB_PRIVS table?

bk_32
  • 483
  • 1
  • 4
  • 17
  • Are the privileges just granted via roles, rather than directly? [Related](https://stackoverflow.com/q/9811670/266304), if not a duplicate? – Alex Poole Aug 02 '19 at 13:02
  • Based on your suggestion, I looked for the users in DBA_ROLE_PRIVS, and indeed the users are granted roles there. Would you like to write the answer so I can upvote it? – bk_32 Aug 02 '19 at 13:36

0 Answers0