Migrating Data to Autonomous Database Using Database Links
Introduction
Autonomous Database supports outgoing Database Links to other Oracle databases. These links provide a secure bridge between your source Oracle Database and Autonomous Database, enabling direct data transfer without intermediate dump files or object storage.
This guide walks through the wallet setup, SQLNet configuration, DNS resolution, VCN connectivity, and database link creation* required to migrate data into Autonomous Database using Data Pump over a network link.
Migration with Oracle Data Pump
Oracle Data Pump provides multiple ways to move data. One efficient method is using Network Links or Database Links.
Advantages:
- No need to generate dump files.
- No Object Storage or NFS transfer required.
- Ideal for small to medium databases — migration happens directly over the link.
Step 1: Configure Wallet and SQL*Net
Download the Autonomous Database wallet from the OCI Console and place it in your $ORACLE_HOME/network/admin directory (or another secure location).
sqlnet.ora
SSL_SERVER_DN_MATCH = no NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)
Enforce Case‑Sensitive Logon (On database from where data is pulled) -In My case Standalone database
This ensures that usernames and passwords are validated exactly as defined.
Step 2: Configure TNS Names
Update your tnsnames.ora to include both Autonomous Database service aliases and your on‑premises database entries.
tnsnames.ora
(DESCRIPTION = (ADDRESS = (PROTOCOL = TCPS)(PORT = 1522)(HOST = myadb.adb.region.oraclecloud.com)) (CONNECT_DATA = (SERVICE_NAME = myadb_tp.adb.oraclecloud.com)) (SECURITY = (ssl_server_dn_match = no)) )
Step 3: Private DNS Zone Setup
- Create a Private DNS Zone in OCI.
- Add an A record mapping the hostname of your on‑premises database (e.g., myonpremdb.localdomain) to its private IP address.
- Ensure the Autonomous Database VCN is associated with this DNS zone so it can resolve the hostname.
Step 4: VCN Connectivity Checks
For the database link to work, the VCN of Autonomous Database and the VCN of the source database must be connected.
Use VCN peering (local or remote) or a Dynamic Routing Gateway (DRG).
Update Route Tables:
ATP subnet → route to source DB subnet.
Source DB subnet → route back to ATP subnet.
Update Security Lists/NSGs:
Allow TCP 1521 ingress on the source DB subnet.
Allow TCP 1521 egress on the ATP subnet.
Verify connectivity with a test VM in the ATP subnet:
telnet myonpremdb.localdomain 1521
Step 5: Create User and Credential in Autonomous Database
DBMS_CLOUD.CREATE_CREDENTIAL(
credential_name => 'ONPREM_XE_CRED',
username => 'IMS',
password => 'Oracle123!'
);
END;
/
Step 6: Create Database Link in Autonomous Database
DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK(
db_link_name => 'ADB_TO_XE_LINK',
hostname => 'myonpremdb.localdomain',
port => '1521',
service_name => 'xepdb1',
ssl_server_cert_dn => NULL,
credential_name => 'ONPREM_XE_CRED',
directory_name => NULL,
private_target => TRUE
);
END;
/
Step 7: Test the Database Link
Step 8: Migrate Data Using Data Pump
Step 9: Verify Migration
Final Checklist
- Wallet downloaded and placed in $ORACLE_HOME/network/admin.
- sqlnet.ora and tnsnames.ora configured.
- SEC_CASE_SENSITIVE_LOGON enabled.
- Private DNS zone created with A record for source DB hostname.
- VCN peering and route/security rules configured.
- Database link created and tested.
- Data Pump import executed successfully.


Post a Comment
Post a Comment