Home » RDBMS Server » Server Administration » Synonym Usage
Synonym Usage [message #52665] Mon, 05 August 2002 13:12 Go to next message
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 #52666 is a reply to message #52665] Mon, 05 August 2002 13:36 Go to previous messageGo to next message
Silpa
Messages: 23
Registered: July 2002
Junior Member
Grant the privileges on the tables to the User. Then
you will be able to see them.
Re: Synonym Usage [message #52672 is a reply to message #52665] Tue, 06 August 2002 05:14 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous message
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.
Previous Topic: Installing Developer6i error -
Next Topic: install oracle 9.01 on solaris 5.8
Goto Forum:
  


Current Time: Thu Sep 19 23:33:05 CDT 2024