当前位置:  数据库>oracle

探索Oracle不完全恢复之--基于检查点恢复 第二篇

    来源: 互联网  发布时间:2017-05-03

    本文导语: 基于SCN的恢复,第二篇   1、察看当前的SCN,以便于后期数据丢失用来恢复: SQL> select current_scn from v$database;   CURRENT_SCN -----------     1511297   SQL> select file#,checkpoint_change#from v$datafile;       FILE# CHECKPOINT_CHANGE# ---------- ------------...

基于SCN的恢复,第二篇

 

1、察看当前的SCN,以便于后期数据丢失用来恢复:

SQL> select current_scn from v$database;

 

CURRENT_SCN

-----------

    1511297

 

SQL> select file#,checkpoint_change#from v$datafile;

 

    FILE# CHECKPOINT_CHANGE#

---------- ------------------

        1            1510535

        2            1510535

        3            1510535

        4            1510535

        5            1510535

         6            1510535

        7            1510535

 

7 rows selected.

 

SQL> col name format a45

SQL> set line 300

SQL> select name,checkpoint_change# fromv$datafile_header;

 

NAME                                         CHECKPOINT_CHANGE#

---------------------------------------------------------------

/DBBak2/oradata/WWL/system01.dbf                         1510535

/DBBak2/oradata/WWL/undotbs01.dbf                        1510535

/DBBak2/oradata/WWL/sysaux01.dbf                         1510535

/DBBak2/oradata/WWL/users01.dbf                          1510535

/DBBak2/oradata/WWL/wwl01.dbf                            1510535

/DBBak2/oradata/WWL/wwl02.dbf                            1510535

/DBBak2/oradata/WWL/wwl03.dbf                            1510535

 

7 rows selected.

 

SQL>

 

2、删除测试表

SQL> drop table wwl002 purge;

 

Table dropped.

 

SQL> drop table wwl003 purge;

 

Table dropped.

 

SQL> drop table wwl004 purge;

 

Table dropped.

 

SQL> drop table wwl005 purge;

 

Table dropped.

 

SQL> conn / as sysdba

Connected.

 

3、对数据库执行了DML操作后,数据库的SCN号改变了。

SQL> select current_scn from v$database;

 

CURRENT_SCN

-----------

   1511437

 

 

4、开始执行restore,到备份时候的状态:

RMAN> restore database;

 

Starting restore at 13-JUL-12

using target database control file insteadof recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=47 devtype=DISK

 

channel ORA_DISK_1: starting datafilebackupset restore

channel ORA_DISK_1: specifying datafile(s)to restore from backup set

restoring datafile 00001 to/DBBak2/oradata/WWL/system01.dbf

restoring datafile 00002 to/DBBak2/oradata/WWL/undotbs01.dbf

restoring datafile 00003 to/DBBak2/oradata/WWL/sysaux01.dbf

restoring datafile 00004 to/DBBak2/oradata/WWL/users01.dbf

restoring datafile 00005 to/DBBak2/oradata/WWL/wwl01.dbf

restoring datafile 00006 to/DBBak2/oradata/WWL/wwl02.dbf

restoring datafile 00007 to/DBBak2/oradata/WWL/wwl03.dbf

channel ORA_DISK_1: reading from backuppiece /DBSoft/product/10.2.0/db_1/dbs/01nft4mu_1_1

channel ORA_DISK_1: restored backup piece 1

piecehandle=/DBSoft/product/10.2.0/db_1/dbs/01nft4mu_1_1 tag=TAG20120712T095437

channel ORA_DISK_1: restore complete,elapsed time: 00:01:06

Finished restore at 13-JUL-12

 

5、开始执行恢复,到我们删除表之前的状态:

SQL> recover database until change1511297;

ORA-00279: change 1436429 generated at07/12/2012 09:54:38 needed for thread 1

ORA-00289: suggestion :/DBSoft/product/10.2.0/db_1/dbs/arch1_3_788372282.dbf

ORA-00280: change 1436429 for thread 1 isin sequence #3

 

 

Specify log: {=suggested |filename | AUTO | CANCEL}

auto

ORA-00279: change 1440657 generated at07/12/2012 14:00:52 needed for thread 1

ORA-00289: suggestion :/DBSoft/product/10.2.0/db_1/dbs/arch1_1_788450452.dbf

ORA-00280: change 1440657 for thread 1 isin sequence #1

 

 

ORA-00279: change 1440855 generated at 07/12/201215:08:58 needed for thread 1

ORA-00289: suggestion :/DBSoft/product/10.2.0/db_1/dbs/arch1_1_788454538.dbf

ORA-00280: change 1440855 for thread 1 isin sequence #1

 

 

ORA-00279: change 1441316 generated at07/12/2012 15:19:50 needed for thread 1

ORA-00289: suggestion :/DBSoft/product/10.2.0/db_1/dbs/arch1_1_788455190.dbf

ORA-00280: change 1441316 for thread 1 isin sequence #1

 

 

ORA-00279: change 1442275 generated at07/12/2012 15:52:01 needed for thread 1

ORA-00289: suggestion : /DBSoft/product/10.2.0/db_1/dbs/arch1_1_788457121.dbf

ORA-00280: change 1442275 for thread 1 isin sequence #1

 

 

ORA-00279: change 1442953 generated at07/12/2012 16:25:06 needed for thread 1

ORA-00289: suggestion :/DBSoft/product/10.2.0/db_1/dbs/arch1_1_788459106.dbf

ORA-00280: change 1442953 for thread 1 isin sequence #1

 

 

ORA-00279: change 1462958 generated at07/12/2012 16:28:16 needed for thread 1

ORA-00289: suggestion :/DBSoft/product/10.2.0/db_1/dbs/arch1_2_788459106.dbf

ORA-00280: change 1462958 for thread 1 is insequence #2

ORA-00278: log file'/DBSoft/product/10.2.0/db_1/dbs/arch1_1_788459106.dbf' no

longer needed for this recovery

 

 

ORA-00279: change 1462963 generated at07/12/2012 17:17:59 needed for thread 1

ORA-00289: suggestion :/DBSoft/product/10.2.0/db_1/dbs/arch1_1_788462279.dbf

ORA-00280: change 1462963 for thread 1 isin sequence #1

 

 

ORA-00279: change 1483784 generated at07/12/2012 17:54:25 needed for thread 1

ORA-00289: suggestion :/DBSoft/product/10.2.0/db_1/dbs/arch1_2_788462279.dbf

ORA-00280: change 1483784 for thread 1 isin sequence #2

ORA-00278: log file'/DBSoft/product/10.2.0/db_1/dbs/arch1_1_788462279.dbf' no

longer needed for this recovery

 

 

ORA-00279: change 1486119 generated at07/12/2012 20:35:27 needed for thread 1

ORA-00289: suggestion :/DBSoft/product/10.2.0/db_1/dbs/arch1_1_788474127.dbf

ORA-00280: change 1486119 for thread 1 isin sequence #1

 

 

ORA-00279: change 1487388 generated at07/12/2012 21:31:17 needed for thread 1

ORA-00289: suggestion :/DBSoft/product/10.2.0/db_1/dbs/arch1_1_788477477.dbf

ORA-00280: change 1487388 for thread 1 isin sequence #1

 

 

Log applied.

Media recovery complete.

SQL>

 

6、执行完恢复之后,SCN被清空

SQL> select current_scn from v$database;

 

CURRENT_SCN

-----------

         0

 

7、这个时候我们需要对redo也进行清空

SQL> alter database open restlogs;

 

8、由此可以见得,数据已经恢复回来了:

SQL> select * from tab;

 

TNAME                          TABTYPE  CLUSTERID

------------------------------ -----------------

WWL001                         TABLE

WWL002                         TABLE

WWL003                         TABLE

WWL004                         TABLE

WWL005                         TABLE

 

SQL> select * from wwl005;

 

       ID NAME

---------- ------------

        1 wwl

        2 prodence

        3 woo

        4 xgx

        5 cms

 

SQL>

 

相关阅读:

探索Oracle之RMAN_01概念

探索Oracle之RMAN_02基本使用

��索Oracle之RMAN_03非一致性备份

探索Oracle之RMAN_04非一致性备份

探索Oracle之RMAN_05增量备份

探索Oracle之RMAN_06备份策略

探索Oracle之RMAN_07单个数据文件丢失恢复

探索Oracle之RMAN_07整个业务表空间丢失恢复

探索Oracle之RMAN_07 磁盘损坏数据丢失恢复

探索Oracle之RMAN_07 数据库所有文件全部丢失恢复

探索Oracle之RMAN_07 重做日志redu文件丢失恢复

探索Oracle之RMAN_07 参数文件丢失恢复

探索Oracle之RMAN_07控制文件丢失恢复

探索Oracle之RMAN_07 system表空间丢失恢复


    
 
 

您可能感兴趣的文章:

 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • 生命游戏探索 Golly
  • 每个人都能探索太阳 JHelioviewer
  • 关于<Java 2 完全探索>的三个问题
  • 各位大虾请问:有本<java完全探索>的书怎么样
  • 最近探索JBOSS+TOMCAT,但发现2.4.3版本的没有帮助@!!!
  • 能亲身投入最先进系统的开发和最先进技术的探索,将是您一生的骄傲,您愿加入我们吗?
  • 探索linux的道路上有点迷失了,希望大家给小弟提点建议,谢谢啦~
  • Linux 编译原来内核失败原因探索
  • 大家评论一下这两本书:《java入门经典》、《java完全探索》好吗?我正在看《核心技术卷I》,怎么觉得写的很零碎呀??请看过这些数的兄弟多多指点一下,小弟多谢了!!? //bow bow
  • PHP内核探索:变量概述
  • 正则表达式不区分大小写以及解决思路的探索 .
  • 菜鸟的提问:为什么很多人都推荐Debian发行版?大伙觉的那个发行版更适合深入探索Linux
  • MSSQL优化之探索MSSQL执行计划(转)
  • Eclipse中自动重构实现探索
  • Oracle9i 动态SGA,PGA特性探索
  • PHP内核探索:变量存储与类型使用说明
  • 正则应用之 逆序环视探索 .
  • 探索ORACLE之ASM概念(完整版)


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,