Home » SQL & PL/SQL » SQL & PL/SQL » How to find Grants given on Synonyms.
How to find Grants given on Synonyms. [message #213736] Fri, 12 January 2007 02:16 Go to next message
amkotz
Messages: 72
Registered: May 2005
Location: Bangalore
Member
Hello All,

I have table in Database named Table_1. It has two synonyms built on it namely SYN1 AND SYN2.
Both the Synonyms has different Grants on it,
Lets Say SYN1 has SELECT and SYN2 has DELETE on it.
Both these synonyms are granted to different users in the Database.

Now how do i know that, to which synonyms what all has been granted.
like SYN1 has SELECT and SYN2 has DELETE.


Thanks in Advance,
Amkotz
Re: How to find Grants given on Synonyms. [message #213750 is a reply to message #213736] Fri, 12 January 2007 03:34 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Dont think you mean that the synonyms have different grants.
A synonym is an alternative name for objects such as tables, views, sequences, stored procedures, and other database objects.

I think what you are after is the grants on that table for the diffrent users.

You can find this by
Select PRIVILEGE, GRANTEE, GRANTABLE, GRANTOR, TABLE_NAME
from sys.dba_tab_privs
where table_name = 'YOUR TABLE NAME'
and owner='OWNER OF TABLE'
order by grantee

Re: How to find Grants given on Synonyms. [message #213757 is a reply to message #213736] Fri, 12 January 2007 03:51 Go to previous messageGo to next message
amkotz
Messages: 72
Registered: May 2005
Location: Bangalore
Member
Hello tahpush

""Dont think you mean that the synonyms have different grants.""

The Synonyms have different grants. IS THIS POSSIBLE.( Two separate synonyms on the same table with different grants) ?

SYN1 has SELECT and SYN2 DELETE.

REGDS,
AMKOTZ

Re: How to find Grants given on Synonyms. [message #213761 is a reply to message #213757] Fri, 12 January 2007 04:06 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

amkotz wrote on Fri, 12 January 2007 10:51
IS THIS POSSIBLE.



No

Read
Re: How to find Grants given on Synonyms. [message #213777 is a reply to message #213757] Fri, 12 January 2007 04:49 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
amkotz
The Synonyms have different grants. IS THIS POSSIBLE.( Two separate synonyms on the same table with different grants)?

It is possible, but only if those synonyms belong to different schemas. For example:
GRANT SELECT ON emp TO mike;
GRANT DELETE ON emp TO john;

-- CONNECT AS mike. He will be able to SELECT data from this synonym
CREATE SYNONYM emp_mike FOR scott.emp;

-- CONNECT AS john. He will be able to DELETE records 
CREATE SYNONYM emp_john FOR scott.emp;

Re: How to find Grants given on Synonyms. [message #213778 is a reply to message #213777] Fri, 12 January 2007 04:53 Go to previous message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

A modified possible Wink
Previous Topic: About Procedure
Next Topic: How to create sub independent Transaction?
Goto Forum:
  


Current Time: Tue Feb 18 14:20:37 CST 2025