When I learned Oracle recently, I inadvertently saw Oracle's flashback technology flashback, when Oracle was deleting data or dropping, not directly deleted, but like Windows. Put the data into the Recycle Bin first.
Select * from User_recyclebin
You can see the user_recyclebin, you can see the recently deleted table and the index, as follows:
Let's test it with an example: delete the table data and test whether the data can be recovered.
Select * from TESTEMP1
The initial data is as follows:
Now let's delete the deptno=10 data, as follows:
Delete from where deptno=ten
View the data as follows:
Now that the data has been deleted, we use Oracle's flashback technology for recovery, as follows:
(1) Turn on the line movement function, otherwise error, as follows:
Alter Table TESTEMP1 Enable row movement
(2) Perform the flashback operation as follows:
Flashback Tabletotimestamp to_timestamp ('2017/5/31 16:15:52 ','yyyy-mm-dd hh24:mi:ss');
(3) View the table data as follows:
Below we directly delete the table drop, as follows: Delete the table and test whether the table is recoverable.
Drop Table TESTEMP1
View TESTEMP1, error as follows:
(2) Check the Trash bin as follows: There is a drop record.
SELECT * from User_recyclebin ORDER BY droptime Desc
(3) Perform the flashback as follows: The deleted form is resumed.
Table to Drop
Let's delete the structure of the table, delete a list of Sal, then test the table structure and whether the data can be recovered? as follows:
Look at the Recycle Bin and discover that there are no records, as follows:
Perform a flashback SQL error as follows:
Table to timestamp to_timestamp ('2017-05-31 16:40:00','yyyy-mm-dd Hh24:mi:ss');
Summary: Oracle's flashback functionality allows you to recover data if you delete data or drop table directly. Using Flashback is unrecoverable if you delete the table structure, or if you perform a delete table structure after deleting the data first . In addition, the use of the drop table table name purge or TRUNCATE table name cannot be recovered, as these two operations do not put data into the Recycle Bin but are deleted directly.
Oracle Flash back mechanism