关于误drop表后从回收站中取回表,需要记住一些细节,比如,这时其实该表的索引已经丢了。
一定要在恢复该表的同时记住将索引及约束等属性补完善。
drop table t purge;
create table t as select * from dba_objects;
create index idx_object_id on t(object_id);
set autotrace off
select index_name,status from user_indexes where table_name='T';
INDEX_NAME | STATUS |
---|---|
IDX_OBJECT_ID | VALID |
drop table t;
flashback table t to before drop;
表取回来了,但注意此时索引实际丢了,当取回表后记得重建索引
select status from user_indexes where index_name='IDX_OBJECT_ID';
未选定行