现在的位置: 首页 > 综合 > 正文

oracle表数据误删还原

2013年12月01日 ⁄ 综合 ⁄ 共 303字 ⁄ 字号 评论关闭

首先,找到数据删除前的一个时间点。

select timestamp_to_scn(to_timestamp('2013-10-12 8:30:00', 'YYYY-MM-DD HH24:MI:SS')) from dual;

如,我这里得到的点为36551273744。

然后根据这个点找到你所删除文件的表的数据。使用一个临时表把这些数据存放起来。

create table 临时表 as select * from 清空原表 as of scn 36551273744;

delete from 被删除数据的表 where 1=1;

把临时表的数据放回原表

insert into 被删除数据的表 select  * from 临时表;

删除临时表

drop table 临时表;

抱歉!评论已关闭.