expdp and impdp

Description

Tasks for the Data Pump Import and Export utilities.

Both tasks are sharing the same syntax, wich is straightforward. All the parametrization is done via a separate parameter file or directly by including parameters within the expdp and impdp tags. The parameters are written as parameter=value pairs, like:

schemas=hr
dumpfile=hr1.dmp
exclude=INDEX:"LIKE 'EMP%'"
query=hr.employees:"WHERE department_id > 10 AND salary > 10000"
directory=dpump_dir1
logfile=log_dir:exp.log
           
Look at Oracle's Database Utilities documentation for a reference of all possible options.

A task can have both a parfile attribute and parameters between the enclosing task tags. In this case the parameters from the parfile will be appended to the parameters from the tags content.

Be carefull with file and directory names. Quote from the Oracle documentation:

"Because Data Pump is server-based, rather than client-based, dump files, log files, and SQL files are accessed relative to server-based directory paths. Data Pump requires you to specify directory paths as directory objects. A directory object maps a name to a directory path on the file system."

Attributes

Attribute Description Required
logonConnection string.

syntax: {username[/password] [@connect_identifier] | /} [AS {SYSOPER | SYSDBA}]| /NOLOG

N.b. the logon string will automatically get enclosed by apostrophes.
Yes
parfileName of a parameter file. No.
failonerror Indicates whether the build will continue if the command exits with an error code No. Defaults to 'false'
resultproperty Name of a property in which the return code of the command should be stored. Only of interest if failonerror=false. No.

Examples

Export the HR user

<ora:expdp 
    logon="sys/syspass@dbname as sysdba" 
    failonerror="yes">
    <![CDATA[
      schemas=hr
      dumpfile=hr.dmp
      exclude=INDEX:"LIKE 'EMP%'"
      query=hr.employees:"WHERE department_id > 10"
 ]]>
</ora:expdp>
           

Import with a parfile

<ora:impdp 
    logon="sys/syspass@dbname as sysdba" 
    failonerror="yes"
    parfile="hr-import.par">
</ora:expdp>