Oracle retrieve deleted table

1、select * from recyclebin where 1=1 

and original_name='XXX' -- table name, uppercase

order by droptime desc;

Query the dropped table to check whether the dropped table is in the recycle bin.

2. In command mode:

SQL> show parameter recyclebin

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

recyclebin                           string      on

Check whether the recycle bin mechanism is enabled. If it is on, the table name is enabled. It is recommended to enable the recycle bin mechanism, which is very useful.

 

3. Recover deleted table from recycle bin

In command mode, Flashback table XXXX to before drop can be executed.

When this command is executed, if the XXXX table already exists and has data, the table in the recycle bin can be renamed and restored.

In command mode, execute Flashback table xxxx to before drop rename to xxxx_bak;

 

4. Restore updated data

First query the updated statement

select * from V$SQL where SQL_TEXT like '%update XXXX set xx%'--find out the point in time you need to restore

After the updated statement is found, the updated time will be obtained, then:

create table t_table_recove --new table
as select * from xxxx--the table you misoperated
as of timestamp to_timestamp('2013-09-23 11:38:46','yyyy-mm-dd hh24:mi:ss' );--time point

 

5. Get data updated at a certain point in time

SELECT * FROM xxxxAS OF TIMESTAMP SYSDATE-3/1440;

SYSDATE: current time

3: Three minutes

The meaning of this statement is to obtain the data of the time point three minutes ago.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326346050&siteId=291194637