08. Database link - eshan3101/DataBase-Architech GitHub Wiki

1] A Database Link (DB Link) in Oracle is an object that allows one database to access objects (tables, views, procedures, etc.) in another Oracle database as if they were local.

2]Think of it as a bridge that connects two Oracle databases so that one database can access objects in another database.

3] Database A Database B

 User: SCOT                       User: HR
 EMP table                       EMPLOYEES table

A Database Link creates a connection between them. Database Link Database A -----------------------> Database B

TERMINAL 1

TERMINAL 2 SOURCE DATABASE

TERMINAL 3 TARGET DB

Create DB Link │ ▼ Oracle checks tnsnames.ora │ ▼ Finds service name (PROD) │ ▼ Listener receives request │ ▼ Listener connects to PROD database │ ▼ SCOTT logs in │ ▼ Runs: SELECT SYSDATE FROM DUAL │ ▼ Returns result to local database