首页 > 数据库 > 数据库开发技术 > 闪回查询找到误删除数据
下午用户打电话告知刚误删除一个用户,马上想到在不影响业务情况下使用闪回查询,回家后模拟一下当时情况,记录操作
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
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7417660/viewspace-1032878/ ,如需转载,请注明出处,否则将追究法律责任。