No great genius has ever existed without some touch of madness.

Monday 31 October 2011

Data Pump


Data pump utility is useful when you need to clone a database, refresh the development database or move the databases between different operating systems.
Another big advantage is the network export feature, using which you can export the data to the target server directly using data filters and metadata filters; without having to create the dump files.
The Data Pump export utility can be invoked via two methods:
By using the expdp command from the command prompt
By using “Export to Export Files” under data movement section of the OEM.

There are 4 export modes available in the data pump.
Database – Export the entire database
Schemas – You can selectively export the required schema rather everything
Tables – If you are looking to restore few sets of tables
Tablespace – this option is same like Tables export but exports all of the tables from any tablespace.



Parallel Full Export and Import:
Assuming you have created DIR1, DIR2 directory objects and you want each file be 2 GB in size.
$ expdp
FULL=y
PARALLEL=2
DUMPFILE=DIR1:exp1%U.dmp, DIR2:exp2%U.dmp
FILESIZE=2G
The %u implies that multiple files may be generated and start at 01 with a two-digital number.

Now, you can import to different directory (REMOTE).
$ impdp
DIRECTORY=remote
PARALLEL=2
DUMPFILE=exp1%U.dmp, exp2%U.dmp


You can also move objects from one tablespace to another by using the REMAP_TABLESPACE option.
Example:
$ impdp
SCHEMAS=iself
REMAP_TABLESPACE=iself_tablespace:urself_tablespace


database
expdp vallep/password directory=datapump full=y dumpfile=data.dmp filesize=2G parallel=2 logfile=full.log
Note: increase the parallel option based on the number of CPU's you have
impdp system/password full=y dumpfile=data.dmp nologfile=y


Using Data Pump Export from Command Prompt
expdp username/password@servicename DIRECTORY=dpump DUMPFILE=dumpfile.DMP
FULL=y LOGFILE=logfile.LOG

No comments:

Post a Comment