.par File in Oracle Data Pump
A .par
file is a plain text file used with Oracle expdp
or impdp
commands to pass parameters. It keeps your commands short, readable, and reusable — ideal for scheduled and production jobs.
Example: Export Multiple Tables
Filename: export_tables.par
tables=(HR.EMPLOYEES, HR.DEPARTMENTS)
directory=DATA_PUMP_DIR
dumpfile=hr_tables.dmp
logfile=hr_tables.log
This exports selected tables from the HR schema to the path linked to DATA_PUMP_DIR
.
How to Run the Export
nohup expdp '"/ as sysdba"' parfile=export_tables.par &
- Uses parameters from the
.par
file - Job runs in background and continues after logout
Common Export .par
File Examples
Task | Sample .par File Content |
---|---|
Schema Export | schemas=HR directory=DATA_PUMP_DIR dumpfile=hr.dmp logfile=hr.log |
Export Tables | tables=(HR.EMPLOYEES, HR.DEPARTMENTS) directory=DATA_PUMP_DIR dumpfile=hr_tab.dmp logfile=hr_tab.log |
Full Export | full=y directory=DATA_PUMP_DIR dumpfile=full.dmp logfile=full.log |
Tablespace Export | tablespaces=USERS directory=DATA_PUMP_DIR dumpfile=users.dmp logfile=users.log |
Query-Based Export | tables=HR.EMPLOYEES query="WHERE department_id=10" directory=DATA_PUMP_DIR dumpfile=dept10.dmp logfile=dept10.log |
Parallel Export | schemas=HR parallel=4 dumpfile=hr_%U.dmp directory=DATA_PUMP_DIR logfile=hr_parallel.log |
Exclude Objects | schemas=HR exclude=TABLE:"IN ('EMP_TEMP','DEPT_OLD')" directory=DATA_PUMP_DIR dumpfile=hr_clean.dmp logfile=hr_exclude.log |
Include Specific Objects | schemas=HR include=TABLE:"= 'EMPLOYEES'" directory=DATA_PUMP_DIR dumpfile=emp_only.dmp logfile=emp_only.log |
Compressed Dump File | schemas=HR compression=all directory=DATA_PUMP_DIR dumpfile=hr_compressed.dmp logfile=hr_compressed.log |
Network Mode Export | network_link=REMOTE_DB_LINK schemas=HR directory=DATA_PUMP_DIR dumpfile=hr_net.dmp logfile=hr_net.log |
Example: Import Tables Using .par
File
Filename: import_tables.par
dumpfile=hr_tables.dmp
directory=DATA_PUMP_DIR
tables=(HR.EMPLOYEES, HR.DEPARTMENTS)
logfile=hr_import.log
How to Run the Import
nohup impdp '"/ as sysdba"' parfile=import_tables.par &
This imports selected tables from the specified dump file.
Notes
- To create and manage Oracle directories, refer to:
🔗 Create Directory in Oracle - Use
tables=(...)
for clean syntax when exporting multiple tables - For large exports, use
dumpfile=exp_%U.dmp
withparallel=4
- Always check the
.log
file to verify success or errors - Avoid hardcoding passwords inside
.par
files