Flashback is a technology applied from Oracle10g. It can be used to view the data of a database at a time point in the past, restore the database to a State at a time point in time, and restore tables that have been accidentally deleted. Use it to restore the application of the deleted table.
First, use the following statement to enable the recycle bin function:
Alter system set recyclebin = on
Next, create a table and add a piece of data:
Create table test_tb (id number); insert into test_tb (id) values ('1 ');
Next, use the following statement to delete the table:
Drop table test_tb;
Then, you can use the following statement to view the deleted object:
Show recyclebin;
After the command is executed, the following content is displayed:
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
-----------------------------------------------------------------------------
TEST_TB BIN $ export K1/UoacDzgQwqZ9pVwPA = $0 TABLE: 06: 06: 38
Use the following statement to restore the deleted table:
Flashback table "BIN $ partition K1/UoacDzgQwqZ9pVwPA ==0 0" to before drop;
Use the following statement to check the recovery effect:
Select * from test_tb;
The output is as follows:
ID
----------
1
This indicates that the table to be deleted has been restored.