Datafile 1 (ckpscn 3391666) is orphaned on incarnation#=6
MRP0: Detected orphaned datafiles!
Recovery will possibly be retried after flashback...
Errors in file /opt/app/oracle/diag/rdbms/oradbsdb/oradbsdb1/trace/oradbsdb1_pr00_32625.trc:
ORA-19909: datafile 1 belongs to an orphan incarnation
ORA-01110: data file 1: '+ORADATA_DG/oradbsdb/datafile/system.286.977992327'
Managed Standby Recovery not using Real Time Apply
Recovery Slave PR00 previously exited with exception 19909
Wed Jun 06 08:52:50 2018
MRP0: Background Media Recovery process shutdown (oradbsdb1)
Wed Jun 06 08:52:50 2018
Completed: alter database recover managed standby database using current logfile disconnect
Wed Jun 06 08:54:30 2018
Primary database is in MAXIMUM PERFORMANCE mode
一、incarnation对比
查看主库incarnation
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 ORADB 2730636247 PARENT 1 24-AUG-13
2 2 ORADB 2730636247 PARENT 925702 29-MAY-18
4 4 ORADB 2730636247 PARENT 2700346 01-JUN-18
3 3 ORADB 2730636247 ORPHAN 2702882 01-JUN-18
5 5 ORADB 2730636247 PARENT 2994001 05-JUN-18
6 6 ORADB 2730636247 CURRENT 3023041 05-JUN-18
查看备库incarnation
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 ORADB 2730636247 PARENT 1 24-AUG-13
2 2 ORADB 2730636247 PARENT 925702 29-MAY-18
4 4 ORADB 2730636247 PARENT 2700346 01-JUN-18
3 3 ORADB 2730636247 ORPHAN 2702882 01-JUN-18
5 5 ORADB 2730636247 PARENT 2994001 05-JUN-18
6 6 ORADB 2730636247 PARENT 3023041 05-JUN-18
7 7 ORADB 2730636247 CURRENT 3391541 06-JUN-18
二、重置备库incarnation
SQL> shutdown immediate;
RMAN> startup mount;
RMAN> list incarnation of database;
RMAN> reset database to incarnation 6;
database reset to incarnation 6
RMAN> recover database;
Starting recover at 06-JUN-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=12 instance=oradbsdb1 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=470 instance=oradbsdb1 device type=DISK
starting media recovery
archived log for thread 1 with sequence 209 is already on disk as file +RECOVERY_DG/oradbsdb/archivelog/1_209_977983106.dbf
archived log for thread 1 with sequence 210 is already on disk as file +RECOVERY_DG/oradbsdb/archivelog/1_210_977983106.dbf
archived log file name=+RECOVERY_DG/oradbsdb/archivelog/1_208_977983106.dbf thread=1 sequence=208
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 06/06/2018 09:09:04
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '+RECOVERY_DG/oradbsdb/archivelog/1_208_977983106.dbf'
ORA-00328: archived log ends at change 3391541, need later change 3391666
ORA-00334: archived log: '+RECOVERY_DG/oradbsdb/archivelog/1_208_977983106.dbf'
RMAN> exit
三、恢复备库
1、恢复发现报错,查找恢复报错归档日志
SQL> select name, thread#, sequence#, archived, applied, status from
v$archived_log
where 3391666 between FIRST_CHANGE# and NEXT_CHANGE#;
NAME
--------------------------------------------------------------------------------
THREAD# SEQUENCE# ARC APPLIED S
---------- ---------- --- --------- -
+RECOVERY_DG/oradbsdb/archivelog/1_2_978079648.dbf
1 2 YES NO A
2、将主库的该日志拷贝过来
3、注册该日志
SQL> alter database register or replace logfile '</absolute path/archive log file name>';
4、再次恢复
SQL> alter database recover automatic managed standby database disconnect from session;