oracle表数据还原和恢复
一:表的恢复 对误删的表,只要没有使用PURGE永久删除选项,那么从flash back区恢复回来希望是挺大的。一般步骤有: 1、从flash back里查询被删除的表 select * from recyclebin 2.执行表的恢复 flashback table tb to before drop,这里的tb代表你要恢复的表的名称。 二:表数据恢复 对误删的表记录,只要没有truncate语句,就可以根据事务的提交时间进行选择恢复,一般步骤有: 1、先从flashback_transaction_query视图里查询,视图提供了供查询用的表名称、事务提交时间、UNDO_SQL等字段。 如:select * from flashback_transaction_query where table_name='TEST'; 一般先根据时间进行查询,查询语句模式为select * fromtb as of timestamp to_timestamp(time,'yyyy-mm-dd hh24:mi:ss'); tb指表名称,time指某个时间点 如select * from scott.test as of timestamp to_timestamp('2009-12-11 20:53:57',51); font-family:Arial; font-size:14px; line-height:26px"> 若有数据,恢复极为简单了,语句为flashback table tb to timestamp to_timestamp(time,51); font-family:Arial; font-size:14px; line-height:26px"> 如flashback table scott.test to timestamp to_timestamp('2009-12-11 20:47:30','yyyy-mm-dd hh24:mi:ss'); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |