1. 首页 > ITPUX技术网 > 正文

oracle数据库闪回基于时间的恢复

oracle数据库闪回基于时间的恢复

下面这篇文章是闪会基于时间点的恢复,可以恢复误删除的数据,刚好今天有客户遇到这样的案例
Microsoft Windows [版本 5.2.3790]
(C) 版权所有 1985-2003 Microsoft Corp.
C:\Documents and Settings\Administrator>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 – Production on 星期日 8月 1 15:03:50 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> create user hr identified by hr default tablespace users temporary tablesp
ace temp;
用户已创建。
SQL> grant connect,resource to hr;
授权成功。
SQL> conn hr/hr
已连接。
SQL>
SQL>
SQL>
SQL> create table test (id number);
表已创建。
SQL> insert into test values (100);
已创建 1 行。
SQL> commit;
提交完成。
SQL> select sysdate from dual;
SYSDATE
————–
01-8月 -10
SQL> alter session set nls_date_format=’yyyy-mm-dd hh24:mi:ss’;
会话已更改。
SQL> select sysdate from dual;
SYSDATE
——————-
2010-08-01 15:15:18
SQL> insert into test values (2000);
已创建 1 行。
SQL> commit;
提交完成。
SQL> select * from test;
ID
———-
100
2000

恢复数据到2010-08-01 15:15:18 之前
SQL> select * from test as of timestamp to_timestamp(‘2010-08-01 15:15:18′,’yyyy
-mm-dd hh24:mi:ss’);
ID
———-
100
SQL

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息