首页 » ORACLE 9i-23c » Troubleshooting Standby database recover failed with ORA-19906 ORA-10576 ORA-19909

Troubleshooting Standby database recover failed with ORA-19906 ORA-10576 ORA-19909

常常有客户配置oracle dataguard  1对多或级连(cascade) standby, 当需要一个测试环境时,通常考虑拿一个standby激活或snapshot dg,但如果在激活为可读写数据库时(Failover),如果提前DG参数没有清理,可能导致剩余standby database无法继续应用日志,这里简单记录。

如三套环境A ,B,C,  当前配置可能是因为switchover方便,配置归档所有都可以互传,如A库to bc,  B库to ac, C库to ab.

如果B库激活可想C库就会收到来自A,B primary的归档。

Standby C库报错日志

ORA-19906: recovery target incarnation changed during recovery
Managed Standby Recovery not using Real Time Apply
Recovery interrupted!
cannot find needed online log for redo thread 1
Some recovered datafiles maybe left media fuzzy.
Media recovery may continue but open resetlogs may fail


Error in file xxx.trc
ORA-10576 give up restoring recovered datafile to consistent state: some error occured
ORA-19906: recovery target incarnation changed during recovery
Close the database due to recovery session errors.

Trace file

Recovery target incarnation changed from 2 to 3
MRP0 Incarnation has changed! retry recovery...
ORA-19906: recovery target incarnation changed during recovery

清理C库非A传过去的arch

asmcmd> rm xxxx

rman target /
rman> crosscheck archivelog all;

SQL> alter database recover managed standby database disconect from sessions;

查看日志

Managed Standby Recovery starting Real Time Apply
Warning: Recovery target destination is in a sibling branch
of the controlfile checkpoint. Recovery will only recover
changes to datafiles.
MRP0: Detected orphaned datafiles!
Recovery will possibly be retried after flashback...

ORA-19909: datafile 1 belongs to an orphan incarnation
ORA-01110: datafile 1: '/system01.dbf'
Managed Standby Recovery not using Real Time Apply
2020-02-07T16:37:28.206171+09:00
Recovery Slave PR00 previously exited with exception 19909

当B库failover或转换为snapshot后,它的ARCn会发送 archivelog (which include incarnation change) 到 Cascading Standby Database或是配置了其它幸存的Standby database. 这样会传播incarnation到其它standby database, 导致MRP 中止。

所以正常的操作流程在standby转换以前应该是停止它的日志传递。

SQL> recover managed standby database cancel;

SQL> alter system set log_archive_dest_state_2=defer;

SQL> alter database convert to snapshot standby;
-- 
SQL> alter database recover managed standby database finish;
SQL> alter database activate standby database disconnect from session;

SQL> alter database open;

当 MRP0 因为报错 ORA-19909 and ORA-1110停止时,可以尝试 reset incarnation standby datbase.

rman target /
RMAN> list incarnation;
List of Database Incarnations
DB Key  IncKey DB Name  DB ID     STATUS  Reset SCN  Reset Time
------- ------ ------- ---------- ------- ---------- ----------
1       1      ProDB   1322653252 ORPHAN  1          xxxx
2       2      ProDB   1322653252 ORPHAN  xxxx       xxxx
3       3      ProDB   1322653252 CURRENT xxxxxxxx

当前standby Incarnation为3,而生产为2.

RMAN> reset database to incarnation 2;

重启应用日志恢复。

— over —

打赏

, , ,

目前这篇文章还没有评论(Rss)

我要评论