记录一则RMAN恢复到历史备份(多个incarnation)
2018-06-27 07:56 AlfredZhao 阅读(983) 评论(0) 编辑 收藏 举报环境: 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:04
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/27/2018 07:30:04
RMAN-20207: UNTIL TIME or RECOVERY WINDOW is before RESETLOGS time
2.查看incarnation,尝试RESET DATABASE TO INCARNATION也不行:
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 ORCL 1507617844 PARENT 1 2013-08-24 11:37:30
2 2 ORCL 1507617844 CURRENT 925702 2018-06-26 16:58:31
RMAN> RESET DATABASE TO INCARNATION 1;
database reset to incarnation 1
RMAN> restore database until time '2018-06-26 09:00:00';
Starting restore at 2018-06-27 07:30:40
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/27/2018 07:30:40
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore
RMAN> 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.CTL
RMAN> restore controlfile from '/u01/orabak/ORCL.656.1.20180626.CTL';
Starting restore at 2018-06-27 07:38:03
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/u01/oradata/orcl/control01.ctl
output file name=/u01/oradata/orcl/control02.ctl
Finished restore at 2018-06-27 07:38:07
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 ORCL 1506513914 PARENT 1 2013-08-24 11:37:30
2 2 ORCL 1506513914 CURRENT 925702 2018-06-13 22:19:40
RMAN>
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;
可以成功恢复。
AlfredZhao©版权所有「从Oracle起航,领略精彩的IT技术。」
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了