This content has been marked as final. Show 5 replies
use the following objects to query for the privileges...
Welcome to Oracle world and Forum. This is your first post; so i wish to suggest you to next time start your question like:
everytime to get the fast and right answers.
select table_name from dict where table_name like '%PRIVS%';
We can get any view by replacing "PRIVS" as per our need and then query those views by joining etc.
In Oracle 10.2.0.1, DBMS_METADATA EXECUTE privilege is granted to PUBLIC.
So you can use following script to get privileges of current user:
SQL statement fail if there is no privilege for the requested category.
set heading off set pages 0 set long 9999999 select dbms_metadata.get_granted_ddl('ROLE_GRANT', user) from dual; select dbms_metadata.get_granted_ddl('SYSTEM_GRANT', user) from dual; select dbms_metadata.get_granted_ddl('OBJECT_GRANT', user) from dual;
This script does not detail privileges granted through a role and it does not report privileges granted to PUBLIC.
Edited by: P. Forstmann on May 26, 2009 11:39 AM