ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle 闪回基于时间的恢复

oracle 闪回基于时间的恢复

原创 Linux操作系统 作者:paulyibinyi 时间:2010-08-01 15:26:46 0 删除 编辑

       我写过一篇oracle 9i 闪回基于scn的恢复 http://space.itpub.net/7199859/viewspace-179722

下面这篇文章是闪会基于时间点的恢复,可以恢复误删除的数据,刚好今天有客户遇到这样的案例

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

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7199859/viewspace-669952/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
学习数据库

注册时间:2007-12-11

  • 博文量
    907
  • 访问量
    6894393