Reputation: 19788
I have a user on DB1
with only SELECT
privileges.
I have a DBLink
to DB2
created on DB1
.
What are the priveleges that the user will have on DB2
tables? Do they depend on his priveleges on DB2
?
Thank you
Upvotes: 0
Views: 1891
Reputation: 4640
If you look at the syntax of a database link, the privileges one has with the database link are dependent on the database user which is being used to connect with the database being linked.
For example, with the database link below, the apps database account is being used on the db2 database.
Thus whatever privileges are granted to apps@db2, system or object, these are the privileges which user1@db1, the owner of the dblink, has through this database link.
CREATE DATABASE LINK user1.db1_to_db2.cm.big_company.com
CONNECT TO apps IDENTIFIED BY VALUES apps_password USING '(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=hostname.cm.big_company.com)(PORT=1577))
)
(CONNECT_DATA=
(SERVICE_NAME=db2)
)
)';
Upvotes: 2