Tuesday, 9 June 2009

Exporting and importing a schema without data with datapump

The old exp/imp had a great option called row=n. This made you import a schema with everything but the actual rows. I have to do this all the time and here is how you do the exact same thing with Datapump.

The magic word is content=metadata_only!

expdp system directory=data_pump_dir dumpfile=myschema.exp logfile=myschema_exp.log schemas=myshema content=metadata_only

impdp system directory=data_pump_dir dumpfile=mydump.exp schemas=myschema content=metadata_only

No comments: