0

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

Majid Laissi
  • 19,188
  • 19
  • 68
  • 105

1 Answers1

2

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)            
)        
)';
Patrick Bacon
  • 4,490
  • 1
  • 26
  • 33
  • You mean that the user on `DB1` will have the same privileges than the user used to authenticate the `DBLink`? – Majid Laissi Dec 11 '14 at 16:53
  • Yes, as 11g documentations states here, https://docs.oracle.com/cd/E18283_01/server.112/e17120/ds_concepts002.htm. Specifically look at the "Fixed user link" description. – Patrick Bacon Dec 11 '14 at 17:13