• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

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.
0
tonydba
Asked:
tonydba
2 Solutions
 
DavidSenior 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 ShaikCommented:
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 VirdiCommented:
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

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now