zoukankan      html  css  js  c++  java
  • 删除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')

    再将恢复后的数据放到原来表就可以了.

     

  • 相关阅读:
    Git 命令使用小笔记
    一个关于if else容易迷惑的问题
    浏览器与Node环境下的Event Loop
    镜面反射
    Socket通信原理
    Git
    vba工具
    为什么要用prototype
    Oracle 列转换为行, 逗号拼接.
    JS中的phototype
  • 原文地址:https://www.cnblogs.com/liuzhuqing/p/7480929.html
Copyright © 2011-2022 走看看