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

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?
LVL 1
hc2342uhxx3vw36x96hqAsked:
Who is Participating?
 
MarkusIdConnect With a Mentor Commented:
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
 
flow01Connect With a Mentor Commented:
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
 
hc2342uhxx3vw36x96hqAuthor Commented:
Many thanks for having helped me ;-)
0
All Courses

From novice to tech pro — start learning today.