天天看点

oracle 10g的闪回特性

1.先介绍两个表:

select * from tab; --查看有那些表

select * from ind; --查看有那些索引

2.试验脚本

create table abc

(

id int

);

create index abc on abc(id);

commit;

insert into abc values(1);

insert into abc values(2);

insert into abc values(3);

insert into abc values(4);

3.接下来

select * from tab看一下多了个abc表

4.然后

drop table abc;

commit; ---表abc被删除了。

select * from tab 看一下多了一个表。 以bin开头的 名字挺意外。

5.然后:

依赖于原表的存储过程都失效了。而建在表上的索引和触发器也会被重新命名。

表实际没有被删除,而是放在了oracle 的回收站里边。

shwo recyclebin --查看表个删除的表的对应关系。

6.然后:

恢复数据表

flashback table abc to before drop

select * from tab;

select * from abc ; -- 表abc 已经恢复了。

在看一下索引恢复了没有 -也恢复了,但是索引的名字已经变了。

ALTER INDEX " BIN$1++ilvsQQ7mfPh2pvont5A==$0" RENAME TO abc;

对象恢复后,回收站的空间并没有被释放,

释放空间 purge recyclebin; purge--清理,回收。

删除表 并且让表不进入回收站。 ---drop table student purge ;

这样删掉的话,表是没有办法恢复的。