博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
记录一则RMAN恢复到历史备份(多个incarnation)
阅读量:6905 次
发布时间:2019-06-27

本文共 4541 字,大约阅读时间需要 15 分钟。

环境: OEL 5.7 + Oracle 11.2.0.4

1.直接restore到想要恢复的时间点报错:

RMAN> sql "alter session set nls_date_format=''yyyy-mm-dd hh24:mi:ss''";RMAN> restore database until time '2018-06-26 09:00:00';Starting restore at 2018-06-27 07:30:04using channel ORA_DISK_1using channel ORA_DISK_2using channel ORA_DISK_3using channel ORA_DISK_4using channel ORA_DISK_5using channel ORA_DISK_6RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of restore command at 06/27/2018 07:30:04RMAN-20207: UNTIL TIME or RECOVERY WINDOW is before RESETLOGS time

2.查看incarnation,尝试RESET DATABASE TO INCARNATION也不行:

RMAN> list incarnation;List of Database IncarnationsDB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time------- ------- -------- ---------------- --- ---------- ----------1       1       ORCL     1507617844       PARENT  1          2013-08-24 11:37:302       2       ORCL     1507617844       CURRENT 925702     2018-06-26 16:58:31RMAN> RESET DATABASE TO INCARNATION 1;database reset to incarnation 1RMAN> restore database until time '2018-06-26 09:00:00';Starting restore at 2018-06-27 07:30:40using channel ORA_DISK_1using channel ORA_DISK_2using channel ORA_DISK_3using channel ORA_DISK_4using channel ORA_DISK_5using channel ORA_DISK_6RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of restore command at 06/27/2018 07:30:40RMAN-06026: some targets not found - aborting restoreRMAN-06023: no backup or copy of datafile 4 found to restoreRMAN-06023: no backup or copy of datafile 3 found to restoreRMAN-06023: no backup or copy of datafile 2 found to restoreRMAN-06023: no backup or copy of datafile 1 found to restoreRMAN> list backup of database;specification does not match any backup in the repository

此时catalog start with 之前的全备也不认。

思考一下。。
3.恢复一个incarnation之前的控制文件来尝试恢复:

[ora11204@OEL-ASM orabak]$ ls -lrth |grep CTL-rw-r----- 1 ora11204 oinstall  12M Jun 26 15:00 ORCL.656.1.20180626.CTL-rw-r----- 1 ora11204 oinstall  12M Jun 26 16:00 ORCL.660.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 17:00 ORCL.1.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 18:00 ORCL.3.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 19:00 ORCL.5.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 20:00 ORCL.7.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 21:00 ORCL.9.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 22:00 ORCL.11.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 23:00 ORCL.13.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 00:00 ORCL.15.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 01:00 ORCL.17.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 02:00 ORCL.25.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 03:00 ORCL.27.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 04:00 ORCL.29.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 05:00 ORCL.31.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 06:00 ORCL.33.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 07:00 ORCL.35.1.20180627.CTLRMAN> restore controlfile from '/u01/orabak/ORCL.656.1.20180626.CTL';Starting restore at 2018-06-27 07:38:03using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=19 device type=DISKchannel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:03output file name=/u01/oradata/orcl/control01.ctloutput file name=/u01/oradata/orcl/control02.ctlFinished restore at 2018-06-27 07:38:07RMAN> alter database mount;database mountedreleased channel: ORA_DISK_1RMAN> list incarnation;List of Database IncarnationsDB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time------- ------- -------- ---------------- --- ---------- ----------1       1       ORCL     1506513914       PARENT  1          2013-08-24 11:37:302       2       ORCL     1506513914       CURRENT 925702     2018-06-13 22:19:40RMAN> RMAN> sql "alter session set nls_date_format=''yyyy-mm-dd hh24:mi:ss''";RMAN> restore database until time '2018-06-26 09:00:00';直接可以成功转储。RMAN> recover database until time '2018-06-26 09:00:00';直接可以成功恢复。RMAN> alter database open resetlogs;

可以成功恢复。

转载地址:http://kpldl.baihongyu.com/

你可能感兴趣的文章
ARTS打卡计划第三周-Review
查看>>
jQuery validation
查看>>
JavaScript知识架构学习路径(一)- 变量篇
查看>>
组合·莫比乌斯函数
查看>>
MySQL左右连接查询中的NULL的数据筛选问题
查看>>
在Linux下运行引入了外部jar包的java程序
查看>>
段错误 核心已转储尝试解决
查看>>
正则表达式
查看>>
第四次软工作业-代码规范
查看>>
USACO Section 1.5 Number Triangles
查看>>
酷派大神 F1 连接调试,日志获取的方法
查看>>
20050425:公测啊,晚点再说
查看>>
asp.net报错“尝试读取或写入受保护的内存。这通常指示其他内存已损坏”的解决办法...
查看>>
自定义验证控件CustomValidator的使用
查看>>
Homework3
查看>>
程序猿想聊天 - 創問 4C 團隊教練心得(二)
查看>>
Windows Azure媒体服务使得伦敦奥运会的云端传输成为可能
查看>>
错误:媒体集有 2 个媒体簇,但只提供了 1 个 sql2005 备份错误。
查看>>
Linux命令行快捷键
查看>>
Azure Messaging-ServiceBus Messaging消息队列技术系列6-消息回执
查看>>