美文网首页
01.Oracle 数据库误删除数据怎么恢复

01.Oracle 数据库误删除数据怎么恢复

作者: 还没想好ONE | 来源:发表于2021-04-12 10:50 被阅读0次

    数据误删除怎么恢复

    SQL操作

    • 先查询数据,并确认where范围
    select * from 表名 as of timestamp to_timestamp('删除时间点','yyyy-mm-dd hh24:mi:ss');
    例如:
    select * from student as of timestamp to_timestamp('20210412','yyyy-mm-dd hh24:mi:ss');
    select * from student as of timestamp to_timestamp('20210412','yyyy-mm-dd hh24:mi:ss') where id = 1;
    
    • 插入数据
    insert into 表名 ( select * from 表名  
           as of timestamp to_timestamp('删除时间点','yyyy-mm-dd hh24:mi:ss'  )
     );
    例如:
    insert into student ( select * from student 
           as of timestamp to_timestamp('20210412','yyyy-mm-dd hh24:mi:ss'  )
     );
    insert into student ( select * from student 
           as of timestamp to_timestamp('20210412','yyyy-mm-dd hh24:mi:ss'  )
     ) where id = 1;
    
    • 后续待更新

    相关文章

      网友评论

          本文标题:01.Oracle 数据库误删除数据怎么恢复

          本文链接:https://www.haomeiwen.com/subject/fggtlltx.html