admin管理员组

文章数量:1538748

在使用oracle数据时,如果一不小心把table中的数据delete掉并且已经提交了,在删除后的几个小时内是可以恢复的。方法如下:

1、查询出误删掉的数据:

select *  
  from 表名 as of timestamp to_timestamp('2021-08-24 12:15:00', 'yyyy-mm-dd hh24:mi:ss')
 where 删除的数据;

to_timestamp('2021-08-24 12:15:00', 'yyyy-mm-dd hh24:mi:ss'):指的是删除前的某个时间点。

2、将查出的误删的数据在重新插入表中

insert into tablename
select *  
  from tablename as of timestamp to_timestamp('2021-08-24 12:15:00', 'yyyy-mm-dd hh24:mi:ss')
 where 删除的数据;

本文标签: 数据库数据ORACLEDelete