Q
Problem solve Get help with specific problems with your technologies, process and projects.

Importing table structure only to new schema

How do I import the table structure only to another schema with a different tablespace for data, as well as for constraints?

How do I import the table structure only to another schema with a different tablespace for data, as well as for constraints? The data is stored at mydata.dbf whereas the index is stored at myindex.dbf. I would like to import the schema into mydata2.dbf and myindex2.dbf.
One method is to use Oracle's export/import utilities.
  1. Export the table's definition with the constriants and indexes:
    exp userid=system file=my_dump.dmp 
    tables=EMP rows=n constraints=y indexes=y
    
  2. Use the import utility to create a file that can be used to create the table and indexes:
    imp userid=system file=my_dump.dmp 
    full=y indexfile=create.sql
    
  3. Modify the create.sql script created in step two with any text editor. You can change the tablespace or other storage information at this time.
  4. Run the modified script in the destination database.
This was last published in July 2006

Dig Deeper on Oracle database backup and recovery

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close