Data Pump

How to Use Data Pump Network Mode – Step by Step

Data pump has a very nice feature since 10g, which can make data imported directly from source to target via network connection without any intermediate dump files. The best thing is that it saves IO and space during export and import dump files.

If you are the first time to use impdp network mode, you should know all the following preconditions before using it.
  1. Grant EXP_FULL_DATABASE role to the export user in source database.
  2. SQL> conn / as sysdba
    Connected.
    SQL> grant EXP_FULL_DATABASE to export_user;
    ...

  3. Grant IMP_FULL_DATABASE role to the import user in target database.
  4. SQL> conn / as sysdba
    Connected.
    SQL> grant IMP_FULL_DATABASE to import_user;
    ...

  5. In the target database server, add a tns entry which points to source database before creating a database link.
  6. SOURCE_DATABASE =
      (DESCRIPTION=
        (ADDRESS_LIST=
          (ADDRESS=
            (PROTOCOL=TCP)
            (Host=10.1.1.1)
            (Port=1521)
          )
        )
        (CONNECT_DATA=
          (SID=SOURCE_DATABASE)
        )
      )

  7. Create a database link in target database, which can connect to the export user in source database.
  8. SQL> conn import_user/password@target_database
    Connected.
    SQL> CREATE DATABASE LINK "SOURCE_LINK" CONNECT TO export_user IDENTIFIED BY password USING 'SOURCE_DATABASE';
    ...

  9. Test the database link. Here is an example:
  10. SQL> select sysdate from dual@source_link;
    ...

  11. Grant read/write on a directory object DATA_PUMP_DIR to the import user in target database in order to log the process.
  12. SQL> GRANT READ, WRITE ON DIRECTORY DATA_PUMP_DIR TO IMPORT_USER;
    ...

  13. Now, you can begin to use impdp network mode. The following is an example of data migration in network mode.
  14. $ impdp import_user/password NETWORK_LINK=SOURCE_LINK FULL=YES TABLE_EXISTS_ACTION=REPLACE STATUS=300
    ...
The jobs of data pump could take a very long time to complete, you may refer to my post about speeding up the jobs:
5 Tips to Speed Up Data Pump Export or Import

Leave a Reply

Your email address will not be published. Required fields are marked *