启用flash back:
BEGIN
dbms_flashback.enable_at_time(SYSDATE-60/1440);
END;
验证数据:
SELECT *
FROM h2.s_company AS OF TIMESTAMP to_timestamp('2013-8-9 12:26:08', 'yyyy-mm-dd hh24:mi:ss');
关闭flash back:
BEGIN
dbms_flashback.disable;
END;
不关闭的话会出现:
ORA-08182: 在闪回模式下操作不受支持
接下来将数据插入原始表
INSERT INTO s_company_f1
SELECT *
FROM h2.s_company AS OF TIMESTAMP to_timestamp('2013-8-9 12:26:08', 'yyyy-mm-dd hh24:mi:ss');
这个是我情急之下采用的一个很弱智的方法, 只需要两句简单的DDL即可恢复:
alter table s_company_f1 enable row movement;
flashback table s_company_f1 to timestamp to_timestamp('2013-8-9 15:00:08', 'yyyy-mm-dd hh24:mi:ss');
- SQL> flashback table test_move to timestamp(systimestamp - interval '3' minute);
- flashback table test_move to timestamp(systimestamp - interval '3' minute)
- *
- ERROR at line 1:
- ORA-08189: cannot flashback the table because row movement is not enabled
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8520577/viewspace-768154/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8520577/viewspace-768154/