• notice
  • Congratulations on the launch of the Sought Tech site

Oracle's method of quickly recovering accidentally deleted data

In our daily work, we often accidentally delete Oracle data.When deleting and drop (without purge) tables, we can quickly restore them as follows:

(1) When delete deletes data by mistake:

We can recover by constructing a consistent read, provided that the accidentally deleted data is discovered in time, and the current undo block or undo is almost uncovered

create table quick_table as

select * from emp_temp as of timestamp (SYSTIMESTAMP-INTERVAL '60' MINUTE);

At this time, quick_table contains the data of the table 60 minutes ago, where 60 can be changed according to the actual situation.

(2) When drop deletes the table by mistake:

The premise is that we did not use the drop table XX purge method to delete the table, but through the drop table XX method to delete, then we can pass:

flashback table XXX to before drop;

In this way, a quick recovery can be carried out.

to sum up

The above methods have limitations, which requires us to be extra careful when operating the database in our daily work, and at the same time do the corresponding backup work to ensure that there is a backup every day, so as to be prepared.


Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+