Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import data from two database and merge.

Status
Not open for further replies.

girimak123

Technical User
Sep 3, 2003
3
US
I have data on two different database instance. I want merge the data on a single database. Is it possible to do import and merge database?. If not, what are the options I have?
Thanks in advance.
 
Girimak,

You are always able to import schemas/tables from foreign Oracle instances into yet another database. But first, we need a bit more information. When you say, "I want merge the data on a single database..." do you mean that you have tables with the same names that you want to merge into one table? If so, are the unique identifiers for the rows still unique across both tables? If that is true, you can just do a standard import and when importing the second identically named table, specify "IGNORE=Y" to ignore the fact that the table already exists.

Please tell us more facts about the "merging" you intend to do.

Dave
 
The ignore parameter in import will ignore errors during the import procedure. If there is a table of the same name in the target db will this cause the data in the original db to be overwritten with the new data, I have not been able to find out whether there is an append option in this case that might add the data at the end of the table.
If this option does exist unique constraints would need to be disabled prior to the load.

simmo
 
Hi,
There may be methods to do that import in one step, but I would import each set of data into new holding tables ( created by a different user to avoid name conflicts) and use
Code:
'insert into existing_table select * from new_table'
- assuming identical structures, or
Code:
'insert into existing_table(col1,col2,col3,..) select
col1,col2,col3,... from new_table'

The separating of the steps allows for error checking and manipulation of the incoming data...

[profile]
 
Hi,
Thanks for reply and suggestions. I have two identical database. Due to merging of two groups I have to integrate the data on one database. Being same application, tables are identical on both DB. I have created development db and imported one DB on it along with tables and data. I want to upend the data from second DB. There are about 30 tables in the application. I assume there are no duplication records, but will be glad to take care of it, if possible. I understand keeping referential integrity is challenging issue.
 
Try to disable referencial constraints before importing 2nd portion of data and enable them with EXCEPTIONS clause to process possible duplicates/orphans later.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top