Oracle EXPDP PAR File Example

When you work with Data pump, you have to specify the parameters both while exporting and importing. A sample data pump export and import looks like below:

Data Pump Export:
=================
expdp directory=datapump dumpfile=scott_bkp.dmp logfile=scott_bkp.log schemas='SCOTT'

Data Pump Import:
=================
impdp directory=datapump dumpfile=scott_bkp.dmp logfile=imp_schema.log
remap_schema='SCOTT:SCOTT'

The above example is very simple and straight forward. But, in real-time, you might perform very complex export and import. It becomes very tedious job for DBA to type entire expdp/impdp command. Also, in some environments, you might perform same export and import maybe daily or weekly.

Expdp Parameter File

Data Pump jobs can be automated using PAR file. You basically create one par file which contains all the export or import parameters and just call the par file at expdp utility. A sample example of how par files works is below:

# cat exp.par
Username=scott/tiger
tables=scott.emp
directory=EXP_DIR
dumpfile=QUERY_EXP.dmp
logfile=QUERY_EXP.log

And! Its very simple to call the above export PAR file

# expdp parfile=exp.par

Frequently Asked Questions

What is parameter file?

Parameter file is simple text file which can be called by data pump utilities like expdp and impdp. This file can be created anywhere on the server and there is no need to involve the DBA

What is the parameter file naming convention?

You can specify any extension but it is recommended to use .par

What all can I specify in parameter file?

You can specify every parameter that you use with expdp inside the par file.

Can I use par file both while export and import?

Yes

Was this article helpful?

Related Articles

Leave a Comment