1 2 | ALTER TABLE tablename ENABLE row movement ; flashback table tablename to timestamp to_timestamp('2012-09-13 13:00:00','yyyy-mm-dd hh24:mi:ss'); |
1 2 3 4 5 6 7 8 9 10 | $ sqlplus eygle/eygle SQL*Plus: Release 10.1.0.2.0 - Production on Wed Mar 30 08:52:04 2005 Copyright (c) 1982, 2004, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production With the Partitioning, OLAP and Data Mining options SQL>select count(*) from t1; COUNT(*) ---------- 9318 |
1 2 3 4 5 6 7 8 | SQL>delete from t1; 9318 rows deleted. SQL>commit; Commit complete. SQL>select count(*) from t1; COUNT(*) ---------- 0 |
1 2 3 4 5 6 7 8 9 10 11 12 | SQL>select dbms_flashback.get_system_change_number from dual; GET_SYSTEM_CHANGE_NUMBER ------------------------ 10671006 SQL>select count(*) from t1 as of scn 10671000; COUNT(*) ---------- 0 SQL>select count(*) from t1 as of scn 10670000; COUNT(*) ---------- 9318 |
1 2 3 4 5 6 7 8 | SQL>insert into t1 select * from t1 as of scn 10670000; 9318 rows created. SQL>commit; Commit complete. SQL>select count(*) from t1; COUNT(*) ---------- 9318 |
1 2 3 4 5 | . select * from t_viradsl t //查询t_viradsl中所有的数据,可以看到三条数据 . delete t_viradsl //删除t_viradsl中所有的数据,三条数据消失 . select * from t_viradsl t //无数据。 . insert into t_viradsl select * from t_viradsl as of timestamp to_Date('-- ::', 'yyyy-mm-dd hh:mi:ss') //已将误删除数据插入表中 . select * from t_viradsl t //又会看到三条数据。 |
1 | select * from t_viradsl2 as of timestamp to_Date('2011-01-19 15:28:00', 'yyyy-mm-dd hh24:mi:ss') |
欢迎光临 度量快速开发平台-专业、快速的软件定制快开平台 (http://plat.delit.cn/) | Powered by Discuz! X3.2 |