oracle datapump sample commands

 

EXPDP to multiple directories  :

Suppose you wish to take a expdp backup of a big table, but you don’t sufficient space in a single mount point to keep the dump.

In this case, we take expdp dump to multiple directory.

Create directories to pointing to diff PATH
SQL> create directory DIR1 as '/home/oracle/DIR1';
Directory created.

SQL> create directory DIR2 as '/home/oracle/DIR2';
Directory created.

parfile content
dumpfile=DIR1:test_%U.dmp,  DIR2:test_%U.dmp
logfile=test.log
directory=DIR1
parallel=2
tables=raj.test



EXCLUDE/INCLUDE option in EXPDP

dumpfile=test.dmp
logfile=test1.log
directory=TEST
exclude=TABLE:"IN ('EMP_TAB','DEPT')"
schemas=DBACLASS

Exclude few schemas while import:
dumpfile=test.dmp
logfile=test1.log
directory=TEST
EXCLUDE=SCHEMA:"IN ('WMSYS', 'OUTLN')"


export/Import only TABLE and INDEX ( OBJECT_TYPE)

dumpfile=FULL.dmp
logfile=full.log
directory=exp_dir
directory=DBATEST
INCLUDE=TABLE,INDEX



EXPDP to ASM diskgroup

Create a directory pointing to asm diskgroup( for dumpfiles)

SQL> create directory SOURCE_DUMP as '+NEWTST/TESTDB2/TEMPFILE';
Directory created


Create a directory pointing to a normal filesystem ( required for logfiles)

SQL> create directory EXPLOG as '/export/home/oracle';
Directory created.


export parfile
dumpfile=test.dmp
logfile=EXPLOG:test.log
directory=SOURCE_DUMP
tables=dbatest.EMPTAB
exclude=statistics




CLUSTER PARAMETER IN RAC

In a RAC database, if you are taking export with parallel option and the
datapump directory is not shared between the nodes, then set CLUSTER=N in expdp/impdp

parfile content:
dumpfile=asset_%U.dmp
logfile=asset.log
directory=VEN
parallel=32
cluster=N



Comments

Popular posts from this blog

How To Purge Optimizer Statistics Advisor Old Records From 12.2 Onwards (Doc ID 2660128.1)

Oracle session snapper

Oracle Materialized View In-Depth and Materialized View refresh issues in 19c