Hi Brian, I exported a schema from a production database and tried to import to the same schema in the test database. The import completed with lots of unique constraint violation and "parent key not found" error messages. How to fix it? Do I need to disable all the constraints before importing the data? By the way, no triggers got imported. Thank you.

    Requires Free Membership to View

If the tables already exist in your test database, then you may have to disable the constraints before importing the data. Normally, I drop the objects before importing them anew in a test environment. The quickest way to accomplish that is to drop the schema owner and re-create it.

You should not get constraint violations if the tables do not exist because the constraints will not be created until after the data has been imported.

This was first published in August 2007

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

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