About
A database link describes how one database instance can log in to another database instance.
A schema object in one database that enables users to access objects on a different database.
Articles Related
Usage
select * from mySchema.myTable@myDatabaseLink;
Management
Syntax
CREATE [SHARED] [PUBLIC] DATABASE LINK dblink ... [USING 'net_service_name'];
Oracle Database - Net Service Name (tnsname)
CREATE DATABASE LINK warehouse USING 'warehouse';
SELECT DB_LINK FROM USER_DB_LINKS;
Privilege
Privilege | Database | Required for |
---|---|---|
CREATE DATABASE LINK | Local | Creation of a private database link |
CREATE PUBLIC DATABASE LINK | Local | Creation of a public database link |
CREATE SESSION | Remote | Creation of any type of database link |
SELECT DISTINCT PRIVILEGE AS "Database Link Privileges"
FROM ROLE_SYS_PRIVS
WHERE PRIVILEGE IN ( 'CREATE SESSION','CREATE DATABASE LINK',
'CREATE PUBLIC DATABASE LINK')
Database Link Privileges
----------------------------------------
CREATE DATABASE LINK
CREATE PUBLIC DATABASE LINK
CREATE SESSION
Test
select * from all_tables@myDbLink;
select * from dual@myDbLink;