Sometimes accidentally deleted data in the database, was very nervous, to be finished, delete the library on foot! ? And so
we can use the following method to solve:
divided into two methods: scn and time stamps are two ways to recover.
A delete by scn recovered and submitted data
1, the scn number of the current database
select current_scn from v $ database; (switch to sys user or system user query)
query to scn Number: 1,499,223
2 query the current number scn before scn
the SELECT * from table name as of scn 1499220; (determining whether to delete the data exists, if there is, then restore the data; if not, continue to shrink scn No.)
3, recover deleted and submitted data
flashback table table name to scn 1499220;
Second, delete recovery through time and submitted data
1, query the current system time
SELECT TO_CHAR (SYSDATE, 'YYYY-mm-dd HH24: mi The: SS') from Dual;
2, data query to delete the data of a time point
select * from table as of timestamp to_timestamp ( '2013-05-29 15:29:00 ', 'yyyy-mm-dd hh24: mi: ss'); ( if not, continue to narrow)
3, and has been undelete data submitted
flashback table name of the table to timestamp to_timestamp ( '2013-05-29 15:29:00' , 'yyyy-mm-dd hh24: mi: ss');
Note: If the above statement is executed, an error occurs. You can try alter table table name enable row movement; // Allows you to change the time stamp