Thursday, July 26, 2012

Exporting(expdp) & Importing(impdp) specified objects Only

EXPORT/IMPORT only schema Tables :

Expdp system/******  dumpfile=XXXXX.dmp directory=EXPORT_DIR  schemas=DEMO    include=TABLE

generating a DDL for above Tables :

impdp system/*****  dumpfile=xxxxx.dmp directory=EXPORT_DIR schemas=DEMO sqlfile=table_DDL.sql 

If we need only for 1 table DDL from entire Tables then,

impdp system/*****  dumpfile=xxxxx.dmp directory=EXPORT_DIR schemas=DEMO sqlfile=tables_1.sql   include=TABLE:\"IN \(\'CUSTOMER\'\)\"

The above command creates a file tables_1.sql which contains only DEMO.CUSTOMER table DDL

NOTE:  SQLFILE parameter works only for import(impdp) and should have dumpfile available

Export and Import Only CONSTRAINTS:

Expdp system/wfargo#123 dumpfile=xxxxx.dmp directory=EXPORT_DIR   schemas= DEMO include=CONSTRAINT

Here in the above I’m exporting only DEMO schema constraints

If we want this DEMO schema DDL in a file then run the command below:

impdp system/****** dumpfile=XXXXX.dmp directory=EXPORT_DIR  schemas=DEMO   SQLFILE=constraint_DDL.sql 

Then a file constraint_DDL.sql will be created contains all DEMO schema constraints

You can find Creating a DDL for an INDEX here :


Post a Comment

Auto Scroll Stop Scroll