Copy Oracle Database but with no data
Copy Oracle Database but with no data

    Requires Free Membership to View

    By submitting your registration information to SearchOracle.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchOracle.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

I desperately need to make an exact copy of my current (and rather large) Oracle database. All that I need is a copy containing all the tables, with their appropriate fields and relationships. I do not need the data, only a test database to, well test new ideas on.

You can use export/import or Data Pump to do the trick. You'll end up exporting the database objects without any rows of data and then importing the empty tables into your destination.

To do this with export/import, use the following to move one schema:

exp file=my_dump.dmp owner=schema_name rows=n

The ROWS=N parameter tells Oracle not to export any data. Then just import at your destination:

imp file=my_dump.dmp fromuser=schema_name

You can accomplish the same thing with the newer Data Pump utilities similar to the following:

expdp directory=data_pump_dir dumpfile=my_dump.dmp schemas=schema_name content=metadata_only

impdp directory=data_pump_dir dumpfile=my_dump.dmp schemas=schema_name

This was first published in July 2011

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.