Sunday, May 21, 2006

Extract Index DDL

When restoring tables with export/import, it is common to disable any constraints, drop any non-primary key index, and disable any trigger. After the import simply enable constraints, enable triggers, and rebuild any index.

A quick way to get the index DDL is by using the export dump file. Run the dump file through import with the "indexfile" option.
imp file=export.dmp indexfile=index.sql fromuser=theSchemaOwner

File "index.sql" will be created. The tables will be in the file and commented out.

I learned this from Tom's web site.

No comments:

Post a Comment