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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Imp from t1 to t2

Status
Not open for further replies.

ManjulaMadhu

Programmer
Jan 7, 2003
85
SG
Hi,

I would like to know if its possible to imp data (exported from table t1 ,say) to table t2 having the same structure?

One way is to import t1 and rename to t2.
But, it would be great if we can import directly to t2.
 
Try this:
create table t2 as select * from t1;

If t2 already exists and has the same structure as t1, just insert:

insert into t2 select * from t1;
Regards, Dima
 
Sem, I think Manjula is trying to take data from T1 that was exported using EXP and then import it using IMP into T2. I gather you are doing this to compare what the table was to what it is now. I believe I have heard some of the guru's here mention a way to do this, but I don't know what it is.

Could you not make a copy of Table1 (Table1Back), import the old Table1 (over copying the current Table1), save that copy off as Table2, and then copy Table1Back data back into Table1? Seems like a little bit of shuffling, but depending on the amount of data you are talking about, it shouldn't take too long. Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
 

The unsupported workaround for this one is to...

1. do an export of the table.
2. edit the dump file to change the table names from t1 to t2.
3. import the table.

This is not recommended by Oracle though...


Robbie

"The rule is, not to besiege walled cities if it can possibly be avoided" -- Art of War
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top