Flashback


test@ORCL>exec :scn := dbms_flashback.get_system_change_number

PL/SQL procedure successfully completed.

test@ORCL>print scn

       SCN
----------
    682621

test@ORCL>select count(*) from emp;

  COUNT(*)
----------
 14

test@ORCL>delete from emp;

14 rows deleted.

 

test@ORCL>select count(*) from emp;

  COUNT(*)
----------
  0

test@ORCL>commit;

Commit complete.

 


test@ORCL>select *
  2  from (select count(*) from emp),
  3  (select count(*) from emp as of scn:scn)
  4  /

  COUNT(*)   COUNT(*)
---------- ----------
  0    14


test@ORCL>flashback table emp to scn:scn
  2  ;

Flashback complete.

 

 

PL/SQL procedure successfully completed.

 

test@ORCL>print scn

       SCN
----------
    682621

test@ORCL>select count(*) from t;

  COUNT(*)
----------
  0

test@ORCL>drop table t;

Table dropped.

 

test@ORCL>flashback table t to scn:scn
  2  ;
flashback table t to scn:scn
                *
ERROR at line 1:
ORA-00942: table or view does not exist

 

这样无法恢复被删除的表

 

 

 

There is a table tb in database, use it to perform dropping table and flashbacking operation;

 

There is a index tb_index on table tb;

 

 Drop table tb ;

 

Table tb is missing from system table tab;

 

 The table tb deleted is in recyclebin.

 

The index on table tb is deleted also;

 

 Use flashback command to restore the table had been deleted.

 

 

 

 

 参考:http://www.sudu.cn/info/article/articleInfo.php?aId=196883

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值