-
Sql- grant privilige
how to give grant for users for the tables in one database to the user of another database
I have 2 databases A and B. The schema for A is SA and B is SB. I want to access the tables in B from A.
First i tried this query:
grant select on tablename to SA;
But i got the error: user or role doesnot exist.
After that I created a link in SB - SBLink to SA
grant select on tablename to SA@SBLink
and got the error
Error: SQL command not properly terminated.
thanks in advance!
-
Is this Oracle.
In Oracle:
When you create a database link, the link connects as a user that is
1. defined with the clause 'CONNECT TO <user>'
or
2. there is an implied user on a public database link where the 'CONNECT TO <user> is not defined.
Either way the user that is used to determine privileges is a user on the target side of the dblink.
Thus if you have created a dblink on A and it connects as SB to B then the privilege needs to be given to SB on B.
If you created a dblink on A and it connects as SA to B, you need to verify there is a user SA on B and then grant privileges to SA on B.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|