I am using Linux, Oracle10g. I have created one user called test. and granted create session and select any dictionary permission to the same user.
i also granted sysdba and sysoper roles to the same users.
Now i want to display all the privileges and roles granted to the user. I found following query but it shows only create session and select dictionary privileges.
select privilege from dba_sys_privs where grantee='SAMPLE' order by 1;
please help to resolve the issue.
Thanks
Querying DBA/USER Privilege Views A database administrator (DBA) for Oracle can simply execute a query to view the rows in DBA_SYS_PRIVS , DBA_TAB_PRIVS , and DBA_ROLE_PRIVS to retrieve information about user privileges related to the system , tables , and roles , respectively.
DBA is the standard role that can be granted by an administrator to another administrator. It includes all system privileges and should only be granted to the most trusted and qualified of users. Assigning this role to a user enables the user to administer the database.
GRANTABLE. VARCHAR2(3) Indicates whether the privilege was granted with the GRANT OPTION ( YES ) or not ( NO ) HIERARCHY.
In addition to VAV's answer, The first one was most useful in my environment
select * from USER_ROLE_PRIVS where USERNAME='SAMPLE'; select * from USER_TAB_PRIVS where Grantee = 'SAMPLE'; select * from USER_SYS_PRIVS where USERNAME = 'SAMPLE';
Look at http://docs.oracle.com/cd/B10501_01/server.920/a96521/privs.htm#15665
Check USER_SYS_PRIVS, USER_TAB_PRIVS, USER_ROLE_PRIVS tables with these select statements
SELECT * FROM USER_SYS_PRIVS; SELECT * FROM USER_TAB_PRIVS; SELECT * FROM USER_ROLE_PRIVS;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With