oracle restore deleted data

There are two methods: scn and timestamp recovery.
1. Restore deleted and submitted data through scn
  1. Obtain the scn number of the current database
    select current_scn from v$database; (switch to sys user or system user query) 
    The queried scn number is: 1499223
  2. Query the current scn number The previous scn
    select * from table name as of scn 1499220; (determine whether the deleted data exists, if so, restore the data; if not, continue to reduce the scn number)
  3. Restore the deleted and submitted data
    flashback table table name to scn 1499220;
2. Recover deleted and submitted data by time
  1. Query the current system time
    select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
  2. Query the time point of deleted data The data
    select * from table name as of timestamp to_timestamp('2013-05-29 15:29:00','yyyy-mm-dd hh24:mi:ss'); (if not, continue to narrow the scope)
  3. Restore deleted and submitted data
    flashback table table name to timestamp to_timestamp('2013-05-29 15:29:00','yyyy-mm-dd hh24:mi:
    Note: If the above statement is executed, an error occurs. You can try to execute alter table table name enable row movement; //Allow to change the timestamp

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326116464&siteId=291194637