Tuesday, March 3, 2015

Oracle Datapump import (impdp) via network_link


Oracle Data Pump (IMPDP) via Network link
We commonly use Oracle’s datapump with approach of take expdp dump and do impdp of that dump file.
If there is requirement to run expdp and impdp at same time, we can use impdp feature with option of network_link. The Data pump via network link method is much simpler.
This option uses network link methodology and uses DBLINK and TNS service to fetch the data rows.
Limitations: tables with LONG columns not support this feature.

Step 1: Create user on SOURCE db to use for network link in TARGET database.
CREATE USER TMPDBA IDENTIFIED BY “Password123$”;
GRANT DBA TO TMPDBA;

Step 2: Create Database link on target database:
CREATE DATABASE LINK SERVICE_NAME CONNECT TO TMPDBA  IDENTIFIED BY “Password123$” USING ‘SERVICE_NAME';

Step 3: Copy TNSNAMES entry for source  database to target’s tnsnames.ora file.

Step 4: Create directory in TARGET to use for your logfiles.
CREATE DIRECTORY dumpdir AS ‘/u01/app/oracle/admin/datapump/';
GRANT READ,WRITE ON DIRECTORY dumpdir to PUBLIC;

Step 5: Run import job on TARGET.  You parallelize the job to create multiple datapump slaves..
impdp parfile=impdp.par
 PARFILE contents:
 DIRECTORY=dumpdir
NETWORK_LINK=SERVICE_NAME
SCHEMAS=’TEST’
REMAP_SCHEMA=TEST:TEST1
PARALLEL=4
LOGFILE=impdp_from_service_name.log


No comments:

Post a Comment