Thursday, June 11, 2009

Database User Access information

To look up what role/access you have in an Oracle database we can use this query -

select * from dba_role_privs where grantee = 'userid';

Table structure of dba_role_privs:
Column Name    ID    Data Type
GRANTEE 1 VARCHAR2 (30 Byte)
GRANTED_ROLE 2 VARCHAR2 (30 Byte) -- Roles defined specifically for the db
ADMIN_OPTION 3 VARCHAR2 (3 Byte)
DEFAULT_ROLE 4 VARCHAR2 (3 Byte)


If there's no entry for the user-id in this table that means user doesn't have access to the database.

No comments:

Post a Comment