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

oracle 闪回查询实战

2013年06月07日 ⁄ 综合 ⁄ 共 376字 ⁄ 字号 评论关闭

declare
record_test test%rowtype;
cursor test_old is select * from test;
begin
--启用该时刻的数据
dbms_flashback.enable_at_time(to_timestamp('2007-08-14 12:17:21', 'YYYY-MM-DD HH12:MI:SS'));
--取出闪回数据
open test_old;
loop
   fetch test_old into record_test;
   exit when test_old%notfound;
   dbms_output.put_line('insert one find...');
end loop;
close test_old;
--禁用闪回查询
dbms_flashback.disable();
end;

好像truncate掉的数据不能闪回查询伽。。

抱歉!评论已关闭.