ORACLE表数据恢复

1.

//恢复的时间点

exec dbms_flashback.enable_at_time(to_date('2012-07-02 20:15:00','yyyy-mm-dd hh24:mi:ss'));

//恢复数据
set serveroutput on
DECLARE r_temp kgdata.dt_corrention_detail%ROWTYPE;
CURSOR c_temp IS SELECT * FROM kgdata.dt_corrention_detail;
BEGIN
OPEN c_temp;
dbms_flashback.disable;
LOOP
FETCH c_temp INTO r_temp;
EXIT WHEN c_temp%NOTFOUND;
insert into kgdata.dt_corrention_detail(FS_WEIGHTNO,FD_COMPATEDATE,FN_ALLOWDIFF,FN_WEIGHT,
FN_SHOWWEIGHT,FN_DIFFWEIGHT,fs_judgeresult,fs_operator,fs_shift,fs_term,fs_memo,fs_pointcode) values (
r_temp.FS_WEIGHTNO,r_temp.FD_COMPATEDATE,r_temp.FN_ALLOWDIFF,r_temp.FN_WEIGHT,
r_temp.FN_SHOWWEIGHT,r_temp.FN_DIFFWEIGHT,r_temp.fs_judgeresult,r_temp.fs_operator,r_temp.fs_shift,r_temp.fs_term,r_temp.fs_memo,r_temp.fs_pointcode
);
commit;
END LOOP;

CLOSE c_temp;


2.

insert into kgdata.dt_corrention_detail
select * from kgdata.dt_corrention_detail as of timestamp to_timestamp('2007-07-23 10:20:00', 'yyyy-mm-dd hh24:mi:ss');



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值