前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >记录一则RMAN恢复到历史备份(多个incarnation)

记录一则RMAN恢复到历史备份(多个incarnation)

作者头像
Alfred Zhao
发布2019-05-24 19:41:16
7830
发布2019-05-24 19:41:16
举报

环境: OEL 5.7 + Oracle 11.2.0.4 1.直接restore到想要恢复的时间点报错:

代码语言:javascript
复制
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也不行:

代码语言:javascript
复制
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之前的控制文件来尝试恢复:

代码语言:javascript
复制
[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;

可以成功恢复。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018-06-27 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
NAT 网关
NAT 网关(NAT Gateway)提供 IP 地址转换服务,为腾讯云内资源提供高性能的 Internet 访问服务。通过 NAT 网关,在腾讯云上的资源可以更安全的访问 Internet,保护私有网络信息不直接暴露公网;您也可以通过 NAT 网关实现海量的公网访问,最大支持1000万以上的并发连接数;NAT 网关还支持 IP 级流量管控,可实时查看流量数据,帮助您快速定位异常流量,排查网络故障。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档