I. Table Restoration
If the purge permanent deletion option is not used for accidentally deleted tables, it is expected to be restored from the flash back area. The general steps are as follows:
1. query the deleted table from flash back.
Select * From recyclebin
2. Execute table Restoration
Flashback table TB to before drop. The TB here indicates the name of the table to be restored.
Ii. Table data recovery
If you do not have a truncate statement for the table records that are accidentally deleted, you can choose to restore the records based on the transaction commit time. The general steps are as follows:
1. First query from the flashback_transaction_query view. The view provides the table name, transaction commit time, undo_ SQL, and other fields for query.
For example, select * From flashback_transaction_query where table_name = 'test ';
2. Execute Table Record recovery
Generally, query is performed based on time. The query statement mode is select * from TB as of Timestamp to_timestamp (time, 'yyyy-mm-dd hh24: MI: ss '); TB indicates the table name, and time indicates a certain time point.
For example, select * from Scott. Test as of Timestamp to_timestamp ('2017-12-11 20:53:57 ', 'yyyy-mm-dd hh24: MI: ss ');
If data exists, the restoration is extremely simple. The statement is flashback table TB to timestamp to_timestamp (time, 'yyyy-mm-dd hh24: MI: ss ');
For example, flashback table Scott. Test to timestamp to_timestamp ('2017-12-11 20:47:30 ', 'yyyy-mm-dd hh24: MI: ss ');