Oracle impdp

Summary: in this tutorial, you will learn how to use the Oracle Data Pump Import to load an export dump file set into a target Oracle Database system.

Introduction to Oracle Data Pump Import tool #

The Data Pump Import program is a tool that allows you to load an export dump file set into a target Oracle database system. The Data Pump Import utility comes with the Oracle Installation by default.

The dump file set consists of one or more disk files that store table data, database object metadata, and control information. The dump file set is created by running the Data Pump Export tool.

Note that the Data Pump Import is a replacement of the legacy Import tool called imp starting from Oracle 10g. Oracle recommends the Data Pump Import tool because it is more flexible and can be 15 times faster than the legacy tool in terms of performance.

How to run the Data Pump Import tool #

To invoke the Data Pump Import tool, you use the following command from your terminal:

impdpCode language: SQL (Structured Query Language) (sql)

The behavior of the tool depends on the import parameters that you specify, either on the command line or in a parameter file.

Oracle Data Pump Import tool example #

We will load the dump file set exported in the Data Pump Export tutorial for the demonstration.

Oracle expdp output

First, create a parameter file named customer_imp.par with the following contents and place it in the ~/export directory:

userid=ot@freepdb1/oracle
directory=ot_external
dumpfile=customer_exp%U.dmp
logfile=customer_imp.log
remap_table=ot.customers:customers_bkCode language: SQL (Structured Query Language) (sql)

Let’s break down the customer_imp.par file:

LineParameterDescription
userid=ot@freepdb1/oracleuseridConnects to the Oracle database as user ot, using the password oracle, and connecting to the service freepdb1.
directory=ot_externaldirectorySpecifies a pre-defined Oracle directory object ccalled ot_external, which tells Oracle where to read/write dump and log files on the filesystem.
dumpfile=customer_exp%U.dmpdumpfileProvides the dump file(s) to import. The %U is a substitution variable for parallel dump files (e.g., customer_exp01.dmp, customer_exp02.dmp, etc.).
logfile=customer_imp.loglogfileSpecifies the name of the log file to write the import process messages to.
remap_table=ot.customers:customers_bkremap_tableInstructs Oracle to import the customers table from the ot schema and rename it to customers_bk in the target schema during import.

Then, use the impdp command to invoke the Data Pump Import tool with the parameter file customer_imp.par:

impdp parfile=~/export/customer_imp.parCode language: SQL (Structured Query Language) (sql)

Finally, verify the contents of the customers_bk table:

SELECT * FROM customers_bk;Code language: SQL (Structured Query Language) (sql)

Here is the partial output:

Oracle Data Pump Import Example

Summary #

  • Use the Oracle Data Pump Import tool to load an export dump file set into an Oracle Database server.
Was this tutorial helpful?