利用query flashback回复数据。比较麻烦 要写一个过程。
select to_char(sysdate,'yyyy/mm/dd hh24:mi:ss') from dual;
exec dbms_flashback.enable_at_time(sysdate-3/1440);
exec dbms_flashback.disable();
DECLARE
TYPE si_array IS TABLE OF serv_inst%ROWTYPE;
si_data si_array;
CURSOR flash_cur IS
SELECT *
FROM serv_inst;
flash_rec flash_cur%ROWTYPE;
BEGIN
dbms_flashback.enable_at_system_change_number(:scn_save);
OPEN flash_cur;
dbms_flashback.disable;
LOOP
FETCH flash_cur BULK COLLECT INTO si_data LIMIT 100;
FORALL i IN 1..si_data.COUNT
INSERT INTO serv_inst VALUES si_data(i);
EXIT WHEN flash_cur%NOTFOUND;
END LOOP;
CLOSE flash_cur;
COMMIT;
END;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11813230/viewspace-671588/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11813230/viewspace-671588/