利用闪回恢复delete from table数据(单点恢复)
1、As of timestamp 的示例(利用时间恢复): SQL> delete from A; 已删除4行。 SQL> commit; 提交完成。
1.1查询时间点数据 select * from A as of timestamp to_timestamp('2009-10-15 19:04:16','YYYY-MM-DD hh24:mi:ss'); 1.2恢复数据插入到A表中 SQL>Insert into A select * from A as of timestamp to_timestamp('2009-10-15 19:04:16','YYYY-MM-DD hh24:mi:ss'); 已创建4行。 SQL> COMMIT; 提交完成。 SQL> select * from A; ID ---------- 2 1 3 4
2. As of scn 示例(利用SCN来恢复) 2.1查看SCN 和 timestamp 之间的对应关系: select scn,to_char(time_dp,'yyyy-mm-dd hh24:mi:ss')from sys.smon_scn_time; 2.2.用Flashback Query恢复之前的数据: SQL> insert into A select * from A as of scn 1095782; 已创建4行。 SQL> commit; 提交完成。 SQL> select * from A; ID ---------- 2 1 3 4
