Saturday 9 July 2016

How to Import data via a network link in Oracle





Today , I will tell you the process to Import your data via a network link between 2 Database, located remotely

In Oracle 10g, the Data Pump version of import can eliminate the dump file entirely by importing directly from another database instance.

The first step is to create a “database link object” to identify the source database and then provide the login credentials.

For example, a source database located in INDIA might be identified by the Oracle network service name ‘GOA’.
A user in that instance, ‘ADMIN1’ logs in using the password ‘ADMIN1’ and has the correct privileges to access the data to be imported.

Create a Database link using CREATE DATABASE LINK command, then, could be used to define the source database as follows :

SQL> CREATE DATABASE LINK INDIA
CONNECT TO admin1 IDENTIFIED BY admin1
USING ‘GOA’;


Now, The Data Pump import command, “impdp”, can now use this database link to directly access remote data.

The parameter NETWORK_LINK  points to the source database via its database link.

On the local database instance located in USA, user ‘ADMIN2’ executes the following command (all one line):

$ impdp admin2/admin2 TABLES= customers,sales,employees DIRECTORY=dpump1
NETWORK_LINK= INDIA


Tip :
You can get the information about database links in the view  :  DBA_DB_LINKS

Example :

No comments:

Post a Comment