恢复被delete的数据
假设表名称为:table_delete
查看系统当前时间
|
--获得系统当前时间 select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual; |
查看删除数据之前的某个时间点该表里面的数据
|
select * from table_delete as of timestamp to_timestamp('2015-12-18 17:16:00','yyyy-mm-dd hh24:mi:ss'); |
如果这个时间点里面有被删除的数据,则恢复数据到这个时间
|
flashback table table_delete totimestamp to_timestamp('2015-12-18 17:16:00','yyyy-mm-dd hh24:mi:ss'); |
如果出现
则执行
|
alter table table_delete enable row movement; |
如果出现
则是因为该表是被truncate的,该方法无效
恢复被truncate的表
假设被删除的表名称为:testtruncate
查看回收站
|
select * from user_recyclebin order by droptime desc ; |
恢复
|
flashback table testtruncate to before drop; |
或者
|
flashback table "BIN$KdgUA10bBhngUwEAAH8dOA==$0" to before drop rename to newName; |
注意:表名用双引号
1907

被折叠的 条评论
为什么被折叠?



