利用Flashback轻松找回误删除数据

测试:
1.首先创建一张表TEST
create table test (name int)
2.插入两条数据:
insert into test values (1);
insert into test values (1);
3.对表启动移动行

ALTERTABLE table ENABLE ROW MOVEMENT;

4.删除表:

drop table test

5.在回收站查询表:

SHOWRECYCLEBIN;

或者

SELECTobject_name AS recycle_name, original_name, type

FROMrecyclebin;

这个时候我们在回收站还是可以看到表test的,Flashback Drop就是从这里讲数据恢复的。

6.恢复数据:

FLASHBACK table to test to before drop;

7.查询数据:

select * from test

这时候就可以看到数据已经都还原了。非常好的功能,不需要像SQL Server那样从备份中还原。

Flashbackup drop有一些条件限制:

Objects must meet the following prerequisites to be eligible for retrieval from the
recycle bin:
■ The recycle bin is only available for non-system, locally managed tablespaces. If a
table is in a non-system, locally managed tablespace, but one or more of its
dependent segments (objects) is in a dictionary-managed tablespace, then these
objects are protected by the recycle bin.
■ Tables that have Fine-Grained Auditing (FGA) and Virtual Private Database (VPD)
policies defined over them are not protected by the recycle bin.
■ Partitioned index-organized tables are not protected by the recycle bin.
■ The table must not have been purged, either by a user or by Oracle Database
because of a space reclamation operation.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值