How to replace the damaged table by backup table [message #182971] |
Wed, 19 July 2006 00:23  |
sreehari
Messages: 101 Registered: May 2006
|
Senior Member |
|
|
Hi all
I have a table T1 in the server S1..by mistake..i lost some data in the T1 table..
I have the same table T1 in another server S2. How can i copy this table into the server S1 by replacing the damaged table...
Thanks
|
|
|
Re: How to replace the damaged table by backup table [message #182976 is a reply to message #182971] |
Wed, 19 July 2006 01:11  |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
If those servers are in the same network, you can:
a) insert data into damaged table
INSERT INTO original_table
SELECT * FROM backup_table@another_server;
b) drop damaged table and create a new one
DROP original_table;
CREATE original_table AS
SELECT * FROM backup_table@another_server;
Otherwise, create an export file of this table on backup server and import it into the original table:
ANOTHER_SERVER> EXP username/password@database TABLES=backup_table FILE=backup.dmp
THIS_SERVER_SQLPLUS> TRUNCATE TABLE original_table;
THIS_SERVER> IMP username/password@database FILE=backup.dmp IGNORE=Y
|
|
|