删除A数据表中的一行数据时,不小心将表名写成了B,现在想恢复B中刚删除的的着一行数据怎么办...
解決方法
?
如果啟用了row movement,
ALTER TABLE table ENABLE ROW MOVEMENT;
則可以用
flashback table table_name to timestamp to_timestamp(...);
如果沒有,則用
select * from table_name as of timestamp to_timestamp(...);把刪除的row查詢出來再insert。
?
?
第一步:找到刪除數據的操作時間從( v$sql 或者 v$sqlarea 視圖里面查詢 )
select r.FIRST_LOAD_TIME,r.SQL_TEXT,r.optimizer_mode,r.module,r.action,r.LAST_ACTIVE_TIME?
from v$sqlarea r?
order by r.FIRST_LOAD_TIME desc ;
第二步:
create table t_table_recove
as
select * from t_table?
as of timestamp to_timestamp('2010-06-02 11:36:53','yyyy-mm-dd hh24:mi:ss');
to_timestamp('2010-06-02 11:36:53.000000','yyyy-mm-dd hh24:mi:ss.ff')
再將恢復后的數據放到原來表就可以了.
?
轉載于:https://www.cnblogs.com/liuzhuqing/archive/2012/05/08/7480929.html
總結
以上是生活随笔為你收集整理的删除A数据表中的一行数据时,不小心将表名写成了B,现在想恢复B中刚删除的的着一行数据怎么办...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 自动化测试框架实践2--STAF
- 下一篇: MEF学习笔记(6):出口和元数据