All posts · SQL & PL/SQL

Oracle Database Links: Connecting to Remote Databases

Database links let Oracle SQL access data on remote Oracle databases as if it were local — essential for EBS-to-Cloud migrations and cross-system reporting.

Anurag Jangra · March 1, 2026 · 5 min read · ... views

A database link is a schema object that defines a connection from a local Oracle database to a remote Oracle database. Once created, you access the remote database’s objects by appending @link_name to the table or view name.

CREATE DATABASE LINK hcm_prod
CONNECT TO hcm_reader IDENTIFIED BY "password"
USING 'hcm_prod_tns';

Where hcm_prod_tns is a TNS alias defined in tnsnames.ora or an Easy Connect string.

For public links (accessible to all users):

CREATE PUBLIC DATABASE LINK hcm_prod ...;

Querying remote tables

-- Simple query:
SELECT * FROM employees@hcm_prod WHERE department_id = 20;

-- Join local and remote:
SELECT l.order_id, r.customer_name
FROM local_orders l
JOIN customers@crm_system r ON l.customer_id = r.id;
INSERT INTO staging_orders SELECT * FROM orders@ebs_legacy WHERE status = 'PENDING';
COMMIT; -- Oracle's two-phase commit ensures consistency

Stored procedures on remote databases

BEGIN
  pkg_remote.process_order@finance_db(p_order_id => 1234);
END;

Performance considerations

Network latency makes every remote row access slower than local. For large data transfers, always:

  • Filter aggressively on the remote side (push predicates through the link)
  • Avoid bringing large result sets across the link then filtering locally
  • Consider replication (materialized views) for frequently accessed remote data

Verify predicate pushdown is happening in the execution plan — look for REMOTE operations with sensible filtered row counts.

EBS-to-Cloud migration use case

During phased migrations where some modules are still in EBS and others have moved to Fusion Cloud, database links provide the bridge. An OIC DB adapter connection to the Oracle DB can use existing links transparently, or OIC can manage separate connections to each system.

SELECT * FROM v$dblink; -- active links in current session

Always test link availability before batch jobs that depend on it — don’t let a broken link cause a 3am silent failure.

Think Beyond the Implementation

Questions worth sitting with after reading this

01

Why is this architecture appropriate for this specific context — and where would it be the wrong choice?

02

What assumptions did we make that aren't stated explicitly? What happens if those assumptions are wrong?

03

What would break first if the requirements changed — volume doubled, a third system was added, or the deadline halved?

04

What alternatives did we reject, and why? Was the decision made on evidence — or habit?

AJ
Anurag Jangra
Oracle Cloud PaaS Consultant · OIC & VBCS Specialist

4.5+ years delivering enterprise Oracle Cloud integrations and VBCS applications across manufacturing, IT services, and financial sectors. OCI Certified — writes about real-world OIC, VBCS, SQL, and BI Publisher patterns from production experience.

Chat on WhatsApp