dg备库恢复报ORA-19909: datafile 1 belongs to an orphan incarnatio
更新时间: 2023-04-20 01:32
用rman>duplicate target database for standby nofilenamecheck;在第一个备库上作第二个备库的创建后,第一个备库从新处于恢复模式,sql>recover managed standby database disconnect;后发现有错误,相对应的日志里如下的错误.同时也有一些与其它归档日志名不一样的东西,如下图:
报重庆思庄OCP官方认证培训,送RHCE培训课程,点击领取
alert_orcl.log中的日志如下;
Mon Oct 10 15:50:03 2016
Archived Log entry 237756 added for thread 2 sequence 124934 ID 0x4fd98d82 dest 1:
Mon Oct 10 17:10:57 2016
RFS[3]: Selected log 32 for thread 2 sequence 124936 dbid 1246535734 branch 811895258
Mon Oct 10 17:10:59 2016
Archived Log entry 237757 added for thread 2 sequence 124935 ID 0x4fd98d82 dest 1:
Mon Oct 10 17:43:18 2016
RFS[1]: Selected log 42 for thread 1 sequence 131172 dbid 1246535734 branch 811895258
Mon Oct 10 17:43:19 2016
Archived Log entry 237758 added for thread 1 sequence 131171 ID 0x4fd98d82 dest 1:
Mon Oct 10 20:53:45 2016
alter database recover managed standby database disconnect from session
Attempt to start background Managed Standby Recovery process (stdby)
Mon Oct 10 20:53:45 2016
MRP0 started with pid=52, OS id=11694
MRP0: Background Managed Standby Recovery process started (stdby)
started logmerger process
Mon Oct 10 20:53:50 2016
Managed Standby Recovery not using Real Time Apply
Warning: Recovery target destination is in a sibling branch
of the controlfile checkpoint. Recovery will only recover
changes to datafiles.
Datafile 1 (ckpscn 130259979458) is orphaned on incarnation#=3
MRP0: Detected orphaned datafiles!
Recovery will possibly be retried after flashback...
Errors in file /u01/app/oracle/diag/rdbms/stdby/stdby/trace/stdby_pr00_11696.trc:
ORA-19909: 数据文件 1 属于孤立的原型
ORA-01110: 数据文件 1: '+ORCLDATA/stdby/datafile/system.287.819682969'
Slave exiting with ORA-19909 exception
Errors in file /u01/app/oracle/diag/rdbms/stdby/stdby/trace/stdby_pr00_11696.trc:
ORA-19909: 数据文件 1 属于孤立的原型
ORA-01110: 数据文件 1: '+ORCLDATA/stdby/datafile/system.287.819682969'
Completed: alter database recover managed standby database disconnect from session
Recovery Slave PR00 previously exited with exception 19909
报重庆思庄OCP官方认证培训,送RHCE培训课程,点击领取
同时查看系统相关进程如下,没有MRP0进程:
SQL> select seqnce#,process,status from v$managed_standby;
SEQNCE# PROCESS STATUS
---------- ------------------ ------------------------
0 ARCH CONNECTED
0 ARCH CONNECTED
0 RFS IDLE
0 RFS IDLE
解决方法是:
[dbserver1::/home/oracle]$rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Oct 10 20:55:28 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1246535734)
RMAN> list incarnation of database;
using target database control file instead of recovery catalog
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 ORCL 1246535734 PARENT 1 2009-08-15 00:16:43
2 2 ORCL 1246535734 PARENT 945184 2010-05-11 22:10:02
3 3 ORCL 1246535734 PARENT 14600749921 2013-04-04 22:27:38
4 4 ORCL 1246535734 CURRENT 130257645313 2016-09-21 17:18:26
RMAN> reset database to incarnation 3; (这里的3要与日志里的incarnation#=3要对应)
database reset to incarnation 3
RMAN>
报重庆思庄OCP官方认证培训,送RHCE培训课程,点击领取
然后
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 1.7180E+10 bytes
Fixed Size 2050968 bytes
Variable Size 1677722728 bytes
Database B?rs 1.5485E+10 bytes
Redo B?rs 14725120 bytes
SQL> alter database mount standby database;
Database altered.
SQL> recover managed standby database disconnect;
Media recovery complete.
SQL>
此时再查看日志文件如下:
Attempt to start background Managed Standby Recovery process (stdby)
Mon Oct 10 21:05:19 2016
MRP0 started with pid=50, OS id=12763
MRP0: Background Managed Standby Recovery process started (stdby)
started logmerger process
Mon Oct 10 21:05:24 2016
Managed Standby Recovery not using Real Time Apply
Parallel Media Recovery started with 48 slaves
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Completed: alter database recover managed standby database disconnect from session
Media Recovery Log /oraback/archive/2_124762_811895258.dbf
Media Recovery Log /oraback/archive/1_131008_811895258.dbf
Media Recovery Log /oraback/archive/1_131009_811895258.dbf
Mon Oct 10 21:06:04 2016
同时查看相关系统进程
SQL> select seqnce#,process,status from v$managed_standby;
SEQUENCE# PROCESS STATUS
---------- --------- ------------
0 ARCH CONNECTED
0 ARCH CONNECTED
0 ARCH CONNECTED
0 ARCH CONNECTED
0 ARCH CONNECTED
0 ARCH CONNECTED
0 ARCH CONNECTED
0 ARCH CONNECTED
0 ARCH CONNECTED
0 ARCH CONNECTED
0 RFS IDLE
SEQUENCE# PROCESS STATUS
---------- --------- ------------
0 RFS IDLE
0 RFS IDLE
124938 RFS IDLE
0 RFS IDLE
131174 RFS IDLE
0 RFS IDLE
0 RFS IDLE
131025 MRP0 APPLYING_LOG
19 rows selected.
报重庆思庄OCP官方认证培训,送RHCE培训课程,点击领取
SQL>
至此,问题解决。