Translate into your own language

Saturday, June 4, 2016

What is Network Link Parameter in expdp/impdp and how it works

The Data Pump Export utility provides a way to initiate a network export. Using the NETWORK_LINK parameter, you can initiate an export job from your server and have Data Pump export data from a remote database to dump files located on the instance from which you initiate the Data Pump Export job.

Here’s an example that shows you how to perform a network export:

$ expdp hr/hr DIRECTORY=dpump_dir1 NETWORK_LINK=finance
DUMPFILE=network_export.dmp LOGFILE=network_export.log

In the example, the NETWORK_LINK parameter must have a valid database link as its value. This
means that you must have created the database link ahead of time. This example is exporting data from the finance database on the prod1 server.

Let’s say you have two databases, called local and remote. In order to use the NETWORK_LINK parameter and pass data directly over the network, follow these steps:
1. Create a database link to the remote database, which is named remote in this example:
SQL> CREATE DATABASE LINK remote
 CONNECT TO scott IDENTIFIED BY tiger
 USING 'remote.world';

2. If there isn’t one already, create a Data Pump directory object:

SQL> CREATE DIRECTORY remote_dir1 AS '/u01/app/oracle/dp_dir';

3. Set the new directory as your default directory, by exporting the directory value:

$ export DATA_PUMP_DIR=remote_dir1

4. Perform the network export from the database named remote:

$ expdp system/sammyy1 SCHEMAS=SCOTT FILE_NAME=network.dmp NETWORK_LINK=finance

You’ll see that the Data Pump Export job will create the dump file network.dmp (in the directory location specified by remote_dir1) on the server hosting the database named local. However, the data within the dump file is extracted from the user scott’s schema in the remote database (named remote in our example). You can see that the NETWORK_LINK parameter carries the dump files over the network from a remote location to the local server. All you need is a database link from a database on the local server to the source database on the remote server.

No comments:

Post a Comment