Synonym Usage [message #52665] |
Mon, 05 August 2002 13:12 |
Patrick krug
Messages: 3 Registered: August 2002
|
Junior Member |
|
|
I have three different usernames. I would like two of the user to be able to reference the tables with out including the username in the select,insert, update, etc.
example I have usernames tom, pete and joe.
The tables reside in tom's tablespace but I would like pete and joe to be able to reference any table, storedprocedure, etc without having to put the username reference infront of the tablename.
I have tried the statement "create synonym xyz for tom" while logged into the accounts pete and joe but the tables are still not viewable.
How do I do this?
Thanks
|
|
|
|
Re: Synonym Usage [message #52672 is a reply to message #52665] |
Tue, 06 August 2002 05:14 |
Patrick krug
Messages: 3 Registered: August 2002
|
Junior Member |
|
|
I have tried to grant priv's to the user but I get the following error. I have checked the syntax and have found examples with this same syntax. I am using version 8.1.7.0.0. What am I doing wrong?
SQL> grant select to pete;
grant select to pete
*
ERROR at line 1:
ORA-01919: role 'SELECT' does not exist
Thanks
|
|
|
Re: Synonym Usage [message #52683 is a reply to message #52665] |
Tue, 06 August 2002 07:52 |
Sanjay Bajracharya
Messages: 279 Registered: October 2001 Location: Florida
|
Senior Member |
|
|
Here are the complete steps:
Log in as Tom
1. grant access (select,insert, update, delete)
'grant select on tom.table_a to pete;'
'grant select on tom.table_a to joe;'
2. create public synonym (make sure tom can create public synonym, else create them as someone who can)
'create public synonym table_a for tom.table_a;'
When pete or joe is logged in, they can do
'select * from table_a;'
Isn't this what you wanted to do?
Good luck.
|
|
|
Re: Synonym Usage [message #52698 is a reply to message #52672] |
Wed, 07 August 2002 05:01 |
Vikas Gupta
Messages: 115 Registered: February 2002
|
Senior Member |
|
|
You have to mention the table name on which you want to give the rights.
grant select on tablename to username.
Regards,
Vikas.
|
|
|