oracle 误删数据恢复

时间:2022-04-11 07:18:57

1.根据时间点查系统版本号scn:

select timestamp_to_scn(to_timestamp('2013-01-07 11:20:00','YYYY-MM-DD HH:MI:SS')) from dual

2.查看被误删数据的表scn时间点的数据是否要恢复的数据:
select count(*) from ct_sal_orderToSaleIssue  as of scn 44482681

3.创建临时保存数据的表:
create table temp1 as select * from ct_sal_orderToSaleIssue

4.往临时数据表插入被误删前的数据:
insert into temp1 select * from ct_sal_orderToSaleIssue as of scn 44482681

5.从临时表往原表上插入被删除的数据:
insert into ct_sal_orderToSaleIssue select * from temp1