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

Copying data from a master table to another database

I have a 9i database with about 1,000 tables. Now I have to copy the data from here to another DB with the same structure. The goal is to select data from a master table and copy it to the destination DB with all dependent data. Is there an easy way to do this or a tool I can use?

I have a 9i database with about 1,000 tables. Now I have to copy the data from here to another DB with the same structure. The goal is to select data from a master table and copy it to the destination DB with all dependent data. Something like:
INSERT INTO table1@link SELECT * from table1 
The WHERE condition works fine, but does not do a "deep copy." Is there an easy way to do this or a tool I can use?
I'm not sure what "deep copy" means, but most DBAs use CTAS (Create Table as Select) for this.

I would generate a script that reads the data dictionary to create the move syntax. Something like this:

spool runme.sql

select

   'create table '||table_name||'@dblinkname as select * from '||table_name'||';'

from dba_table where owner = 'SCOTT';

spool off;

@runme
This was last published in November 2005

Dig Deeper on Oracle and SQL

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