閃回查詢找到誤刪除資料

lixiang114發表於2010-04-15

下午使用者打電話告知剛誤刪除一個使用者,馬上想到在不影響業務情況下使用閃回查詢,回家後模擬一下當時情況,記錄操作


SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 4月 14 23:29:11

Copyright (c) 1982, 2005, Oracle. All rights reserved.


連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> show user
USER 為 "LIXIANG"

SQL> create table test_20100414 as select * from dba_objects;
表已建立

SQL> select sysdate from dual;

SYSDATE
-------------------
2010-04-14 23:33:17

SQL> delete test_20100414 where owner='LIXIANG';

已刪除6行。

SQL> commit;

提交完成。

SQL> select count(*) from test_20100414;

COUNT(*)
----------
49783

SQL> select count(*) from test_20100414 as of timestamp to_timestamp('2010-4-14 23:33:17','yyyy-mm-dd hh24:mi:ss');

COUNT(*)
----------
49789


SQL> select object_name, owner
2 from test_20100414 as of timestamp to_timestamp('2010-4-14 23:33:17', 'yyyy-mm-dd hh24:mi:ss')
3 minus
4 select object_name, owner from test_20100414;

OBJECT_NAME
---------------------------------------------------------------------------------------------------
DEMO1
DEMO2
TEST100330
TEST20100413
TEST_20100414

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7417660/viewspace-1032878/,如需轉載,請註明出處,否則將追究法律責任。

相關文章