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

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:218

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

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】