Data Recovery after data is accidentally deleted in Oracle and committed
Background: Table A is deleted due to data misoperations.
-- 1. Back up the current data of Table A first.
-- 2. query the SCN number before a certain time point
Select max (Scn) FROM Sys. Smon_Scn_Time WHERE Time_Dp <To_Date (a time point, 'yyyymmdd hh24: mi: ss ');
-- 3. View table A data at A certain time point
SELECT * from a as of scn 'scn Number OF step 2 ';
-- 4. If you want to view the data, restore it.
SELECT row_movement FROM user_tables WHERE table_name = 'a ';
-- 5. If the result of step 4 is DISABLE, execute the following statement. Otherwise, skip
Alter table a enable row movement;
-- 6. Execute
Flashback table a to scn 'scn Number of step 2 ';
-- 7. If it is enable, no execution is required; otherwise
Alter table a disable row movement;
-- 8. If the permissions are insufficient, change the DBA user to perform the above operations.