Several Oracle table accidentally deleted recovery method

1. Open Flash stored rights
the ALTER TABLE tableName the ENABLE Row Movement;
2. restore the table to the specified point in time
flashback table tableName to timestamp to_timestamp ( ' ' 2018-03-16 10:40:00 '', '' yyyy-mm -dd hh24: mi: ss '' );
the latter parameter is a time point to restore

The second: use ORacle snapshots of data to find a point in time
select * from tableName AS OF TIMESTAMP ( SYSTIMESTAMP - INTERVAL '100' MINUTE)

or

select * from tableName as of timestamp to_timestamp('2018-03-16 11:40:00','YYYY-MM-DD HH24:MI:SS');

Such data can query the specified time period, then copy the data to the original query table.

Third: Other

After deleting the table, it can be used as follows: user_recyclebin table name recently operated in the lookup table, and then use the Flashback (only for 10G and above).

select * from user_recyclebin;

FLASHBACK TABLE TABLE_NAME TO BEFORE DROP;

If it is deleted or modify the data inside, you can establish a data table will be deleted before a quick look back to modify the status of this table:

CREATE TABLE QUICK_TABLE AS SELECT * FROM TABLE_NAME AS OF TIMESTAMP SYSTEM-1/24, minus can set their own time (one hour before).

Fourth: SCN achieved by

SCN (System Change Number), it is the English spelling is: System Change Number, which is a database in a very important data structure.

SCN provides Oracle's internal clock mechanism can be seen as a logical clock, which is crucial for the recovery operation
Notes: Oracle recovery is performed only according to SCN.
It defines the version of the database at the exact moment a submission. When things submission, it is given a unique label SCN things. Some people think that means SCN, System Commit Number, SCN usually change only when submitted, so in many cases, these two terms are often used interchangeably.
In fact, what exactly is the word for us is not the most important, important is that we know SCN clock mechanism within Oracle, Oracle database to maintain consistency through the SCN, and Oracle essential recovery mechanism implemented by SCN.
1: Execute the following statement to convert the time to delete scn

select timestamp_to_scn (to_timestamp ( '2018-03-16 10:00:00 ', 'YYYY-MM-DD HH: MI: SS')) from dual;
Results: 11837812: scn point in the table is taken out.

select * from moAS OF SCN 11837813;

Finally, the results come find out insert to the original table

insert into mo select * from mo AS OF SCN 1183781

Guess you like

Origin www.linuxidc.com/Linux/2019-09/160608.htm