find out privileges

How will I find out the all the privileges, roles related to a uses in one script which has to be spooled in a text.
tonydbaAsked:
Who is Participating?
 
DavidConnect With a Mentor Senior Oracle Database AdministratorCommented:
Perhaps:

set heading off
set pages 0
set long 9999999
spool on
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;
spool off

Note this excludes privileges granted to a ROLE, or to PUBLIC.
0
 
Wasim Akram ShaikConnect With a Mentor Commented:
Check out the script provided by timhall,

http://www.oracle-base.com/dba/script.php?category=script_creation&file=user_ddl.sql


it has everything you need
0
 
Devinder Singh VirdiLead Oracle DBA TeamCommented:
Another method: Use of USER tables

select * From user_sys_privs;
select * from user_tab_privs;
 select * from user_role_privs
0
 
Steve WalesSenior Database AdministratorCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.