Oracle Database Accidentally Deleted Data Operation Recovery Guide

Please note that this operation [Flashback Query] can only recover data deleted within 24 hours
1. OLTP system: 15 minutes
2. Mixing: 1 hour
3. DSS system: 3 hours
4. Flashback query: 24 hours

Explanation of some logos

tableName: The name of the table you deleted by mistake
2023-12-14 23:45:00: The time you determined that the data must exist within 24 hours

Get snapshot data of a table at a certain moment

select * from tableName
as of timestamp 
to_timestamp('2023-12-14 23:45:00', 'yyyy-mm-dd hh24:mi:ss');

Error explanation

ORA-08180: No snapshot based on the specified time was found,
ORA-01555: Snapshot is too old: rollback segment number xx is too small, etc.

The row movement function must be enabled before the flashback operation (enable the mobile flashback function permission)

alter table 
tableName
enable row movement;

Start rollback and execute the rollback SQL statement

flashback table tableName
to timestamp 
to_timestamp('2023-12-14 23:45:00', 'yyyy-mm-dd hh24:mi:ss');

Guess you like

Origin blog.csdn.net/m0_54765221/article/details/135011837