Solved

How can I fastly verify if an Oracle User has the GRANT CREATE ANY SYNONYM privilege?

Posted on 2009-04-06
3
1,090 Views
Last Modified: 2012-06-27
Hello,
I need to know if a particular Oracle User has the GRANT CREATE ANY SYNONYM privilege.

With what query can I do this investigation?
0
Comment
Question by:hc2342uhxx3vw36x96hq
3 Comments
 
LVL 9

Accepted Solution

by:
MarkusId earned 250 total points
ID: 24075562
1. Query: direct grant
2. Query: grant via a role
select * from dba_sys_privs

where privilege = 'CREATE ANY SYNONYM' 

and admin_option = 'YES'

and grantee = 'Oracle User';
 

select a.* from dba_sys_privs a,

dba_role_privs b

where b.grantee = 'Oracle User'

and a.grantee = b.granted_role;

Open in new window

0
 
LVL 20

Assisted Solution

by:flow01
flow01 earned 250 total points
ID: 24075563
select GRANTEE
FROM DBA_SYS_PRIVS
WHERE PRIVILEGE = 'CREATE ANY SYNONYM'
AND GRANTEE = &&USER
UNION
SELECT GRANTEE
FROM DBA_ROLE_PRIVS
WHERE GRANTEE = &&USER
AND GRANTED_ROLE IN
(
select GRANTEE
FROM DBA_SYS_PRIVS
WHERE PRIVILEGE = 'CREATE ANY SYNONYM'
)

0
 
LVL 1

Author Closing Comment

by:hc2342uhxx3vw36x96hq
ID: 31566934
Many thanks for having helped me ;-)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now