Today in the update to forget to write the update conditions, resulting in the entire table of data update all, scared the baby, still thought recovery, ask a colleague, they sent me a statement, modified a bit, in the implementation of a bit, the data on the miraculous recovery, here to do a record and share:
--Find the SCN number
select TIMESTAMP_TO_SCN (To_timestamp (' 2017-10-16 3:00:00 ', ' yyyy-mm-dd HH:MI:SS ')) from dual;
--Take out the SCN point data
Select * FROM Cen_reg.t_reg_person_audit SELECT * from Cen_reg.t_reg_person_audit as of SCN 18894273775
--Restore table Data cen_reg.t_reg_person_audit
INSERT INTO Cen_reg.t_reg_person_audit select * from Cen_reg.t_reg_person_ Audit as of SCN 18894273775;
1, execute the first statement before you need to modify 2017-10-16 3:00:00 this time, change this time to your updated start time, do not require very accurate, but the approximate scope to be correct, the implementation results are as follows:
The result: 18894273775 is the SCN number we need to execute the second sentence.
2, the implementation of the second sentence before the need to modify the select * from behind, changed to your updated table table name, and SCN number, I believe we also see, is the first step to find out the number
The result of the execution of this statement is that the table data of the previous t_reg_person_audit is not updated
3. Delete your updated table data
Delete from Cen_reg.t_reg_person_audit
4, that is above the implementation of the above the third inning = sentence, the data will be found, that is, the update before the data inserted into the Cen_reg.t_reg_person_audit table