Category Archives: Database Restore

Recover table from Oracle Flashback Feature

Data restore completed using ORACLE’s flashback feature.

=== Setps taken:
— FOr auditing Purpose
SQL> exec dbms_output.put_line(‘00021258 ‘);
PL/SQL procedure successfully completed.

— Retrive Data from Flashback history
SQL> create table Shema_name.table_name_ASOF as SELECT  *  FROM Shema_name.table_name AS OF TIMESTAMP TO_TIMESTAMP(‘2014-07-17 06:01:00’, ‘YYYY-MM-DD HH:MI:SS’);
Table created.

— Create backup of current table
SQL> create table Shema_name.table_name_BAKUP_0717 as SELECT  *  FROM Shema_name.table_name ;
Table created.

— Wipe out Bad data
SQL> truncate table  Shema_name.table_name;
Table truncated.

— Load data from Flashback
SQL> insert into  Shema_name.table_name select * from Shema_name.table_name_ASOF;
204973 rows created.

SQL> commit;
Commit complete.