.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.logThis 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
.parfile - Job runs in background and continues after logout
Common Export .par File Examples
| Task | Sample .par File Content |
|---|---|
| Schema Export | schemas=HRdirectory=DATA_PUMP_DIRdumpfile=hr.dmplogfile=hr.log |
| Export Tables | tables=(HR.EMPLOYEES, HR.DEPARTMENTS)directory=DATA_PUMP_DIRdumpfile=hr_tab.dmplogfile=hr_tab.log |
| Full Export | full=ydirectory=DATA_PUMP_DIRdumpfile=full.dmplogfile=full.log |
| Tablespace Export | tablespaces=USERSdirectory=DATA_PUMP_DIRdumpfile=users.dmplogfile=users.log |
| Query-Based Export | tables=HR.EMPLOYEESquery="WHERE department_id=10"directory=DATA_PUMP_DIRdumpfile=dept10.dmplogfile=dept10.log |
| Parallel Export | schemas=HRparallel=4dumpfile=hr_%U.dmpdirectory=DATA_PUMP_DIRlogfile=hr_parallel.log |
| Exclude Objects | schemas=HRexclude=TABLE:"IN ('EMP_TEMP','DEPT_OLD')"directory=DATA_PUMP_DIRdumpfile=hr_clean.dmplogfile=hr_exclude.log |
| Include Specific Objects | schemas=HRinclude=TABLE:"= 'EMPLOYEES'"directory=DATA_PUMP_DIRdumpfile=emp_only.dmplogfile=emp_only.log |
| Compressed Dump File | schemas=HRcompression=alldirectory=DATA_PUMP_DIRdumpfile=hr_compressed.dmplogfile=hr_compressed.log |
| Network Mode Export | network_link=REMOTE_DB_LINKschemas=HRdirectory=DATA_PUMP_DIRdumpfile=hr_net.dmplogfile=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.logHow 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.dmpwithparallel=4 - Always check the
.logfile to verify success or errors - Avoid hardcoding passwords inside
.parfiles
