{"id":4226,"date":"2025-06-08T09:08:00","date_gmt":"2025-06-08T09:08:00","guid":{"rendered":"https:\/\/w3buddy.com\/?post_type=cposts&#038;p=4226"},"modified":"2025-06-15T19:19:29","modified_gmt":"2025-06-15T19:19:29","slug":"par-file-in-oracle-data-pump","status":"publish","type":"cposts","link":"https:\/\/w3buddy.com\/blog\/notes\/oracle-dba-d2d-tasks\/par-file-in-oracle-data-pump\/","title":{"rendered":".par File in Oracle Data Pump"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A <code>.par<\/code> file is a plain text file used with Oracle <code>expdp<\/code> or <code>impdp<\/code> commands to pass parameters. It keeps your commands short, readable, and reusable \u2014 ideal for scheduled and production jobs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Example: Export Multiple Tables<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Filename:<\/strong> <code>export_tables.par<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>tables=(HR.EMPLOYEES, HR.DEPARTMENTS)\ndirectory=DATA_PUMP_DIR\ndumpfile=hr_tables.dmp\nlogfile=hr_tables.log<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This exports selected tables from the HR schema to the path linked to <code>DATA_PUMP_DIR<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Run the Export<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><code>nohup expdp '\"\/ as sysdba\"' parfile=export_tables.par &amp;<\/code><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Uses parameters from the <code>.par<\/code> file<\/li>\n\n\n\n<li>Job runs in background and continues after logout<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Common Export <code>.par<\/code> File Examples<\/h2>\n\n\n\n<figure class=\"wp-block-table has-small-font-size\"><table><thead><tr><th>Task<\/th><th>Sample <code>.par<\/code> File Content<\/th><\/tr><\/thead><tbody><tr><td><strong>Schema Export<\/strong><\/td><td><code>schemas=HR<\/code><code>directory=DATA_PUMP_DIR<\/code><code>dumpfile=hr.dmp<\/code><code>logfile=hr.log<\/code><\/td><\/tr><tr><td><strong>Export Tables<\/strong><\/td><td><code>tables=(HR.EMPLOYEES, HR.DEPARTMENTS)<\/code><code>directory=DATA_PUMP_DIR<\/code><code>dumpfile=hr_tab.dmp<\/code><code>logfile=hr_tab.log<\/code><\/td><\/tr><tr><td><strong>Full Export<\/strong><\/td><td><code>full=y<\/code><code>directory=DATA_PUMP_DIR<\/code><code>dumpfile=full.dmp<\/code><code>logfile=full.log<\/code><\/td><\/tr><tr><td><strong>Tablespace Export<\/strong><\/td><td><code>tablespaces=USERS<\/code><code>directory=DATA_PUMP_DIR<\/code><code>dumpfile=users.dmp<\/code><code>logfile=users.log<\/code><\/td><\/tr><tr><td><strong>Query-Based Export<\/strong><\/td><td><code>tables=HR.EMPLOYEES<\/code><code>query=\"WHERE department_id=10\"<\/code><code>directory=DATA_PUMP_DIR<\/code><code>dumpfile=dept10.dmp<\/code><code>logfile=dept10.log<\/code><\/td><\/tr><tr><td><strong>Parallel Export<\/strong><\/td><td><code>schemas=HR<\/code><code>parallel=4<\/code><code>dumpfile=hr_%U.dmp<\/code><code>directory=DATA_PUMP_DIR<\/code><code>logfile=hr_parallel.log<\/code><\/td><\/tr><tr><td><strong>Exclude Objects<\/strong><\/td><td><code>schemas=HR<\/code><code>exclude=TABLE:\"IN ('EMP_TEMP','DEPT_OLD')\"<\/code><code>directory=DATA_PUMP_DIR<\/code><code>dumpfile=hr_clean.dmp<\/code><code>logfile=hr_exclude.log<\/code><\/td><\/tr><tr><td><strong>Include Specific Objects<\/strong><\/td><td><code>schemas=HR<\/code><code>include=TABLE:\"= 'EMPLOYEES'\"<\/code><code>directory=DATA_PUMP_DIR<\/code><code>dumpfile=emp_only.dmp<\/code><code>logfile=emp_only.log<\/code><\/td><\/tr><tr><td><strong>Compressed Dump File<\/strong><\/td><td><code>schemas=HR<\/code><code>compression=all<\/code><code>directory=DATA_PUMP_DIR<\/code><code>dumpfile=hr_compressed.dmp<\/code><code>logfile=hr_compressed.log<\/code><\/td><\/tr><tr><td><strong>Network Mode Export<\/strong><\/td><td><code>network_link=REMOTE_DB_LINK<\/code><code>schemas=HR<\/code><code>directory=DATA_PUMP_DIR<\/code><code>dumpfile=hr_net.dmp<\/code><code>logfile=hr_net.log<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Example: Import Tables Using <code>.par<\/code> File<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Filename:<\/strong> <code>import_tables.par<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>dumpfile=hr_tables.dmp\ndirectory=DATA_PUMP_DIR\ntables=(HR.EMPLOYEES, HR.DEPARTMENTS)\nlogfile=hr_import.log<\/code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How to Run the Import<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><code>nohup impdp '\"\/ as sysdba\"' parfile=import_tables.par &amp;<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This imports selected tables from the specified dump file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Notes<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To create and manage Oracle directories, refer to:<br>\ud83d\udd17 <a href=\"https:\/\/w3buddy.com\/blog\/notes\/oracle-dba-d2d-tasks\/create-directory\/\" target=\"_blank\" rel=\"noreferrer noopener\">Create Directory in Oracle<\/a><\/li>\n\n\n\n<li>Use <code>tables=(...)<\/code> for clean syntax when exporting multiple tables<\/li>\n\n\n\n<li>For large exports, use <code>dumpfile=exp_%U.dmp<\/code> with <code>parallel=4<\/code><\/li>\n\n\n\n<li>Always check the <code>.log<\/code> file to verify success or errors<\/li>\n\n\n\n<li>Avoid hardcoding passwords inside <code>.par<\/code> files<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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 \u2014 ideal for scheduled and production jobs. Example: Export Multiple Tables Filename: export_tables.par This exports selected tables from the HR schema to the path linked to DATA_PUMP_DIR. How to [&hellip;]<\/p>\n","protected":false},"template":"","meta":{"googlesitekit_rrm_CAowu461DA:productID":""},"categories":[952,984],"class_list":["post-4226","cposts","type-cposts","status-publish","hentry","category-notes","category-oracle-dba-d2d-tasks"],"_links":{"self":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/cposts\/4226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/cposts"}],"about":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/types\/cposts"}],"wp:attachment":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/media?parent=4226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/categories?post=4226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}