ORA-16139 Oracle DG无法正常切换

一、系统环境:
DB version:Oracle 10.2.0.1
OS version:Oracle Linux 5

二、问题描述:
 对DG进行主备库切换,第一次从主库切(A机)换成备库(B机)时正常切完,并且主库的数据正常同步到备库.再次切换时备库(A机)无法切换回主库,提示ORA-16129.但是主库(B机)能够正常切换到备库状态。

错误提示:
  1* alter database commit to switchover to primary with session shutdown
SYS@DGDA>/
alter database commit to switchover to primary with session shutdown
*
ERROR at line 1:
ORA-16139: media recovery required

此时备库的切换状态为:
SYS@DGDA>select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
SWITCHOVER LATENT

如下是备库(A机)上的alert日志:
RFS[6]: Assigned to RFS process 11056
RFS[6]: Identified database type as 'physical standby'
RFS[6]: Archived Log: '/home/oracle/archive/DGDA/1_28_860002427.arc'
Thu Oct  9 10:19:02 2014
alter database commit to switchover to primary with session shutdown
Thu Oct  9 10:19:02 2014
ALTER DATABASE SWITCHOVER TO PRIMARY (DGDA)
Thu Oct  9 10:19:02 2014
If media recovery active, switchover will wait for completion
Database not available for switchover
  End-Of-REDO archived log file has been received
  Archived log files detected beyond End-Of-REDO
  Incomplete recovery SCN:0:411564 archive SCN:0:412008
Database not available for switchover
  End-Of-REDO archived log file has been received
  Archived log files detected beyond End-Of-REDO
  Incomplete recovery SCN:0:411564 archive SCN:0:412008
Switchover: Media recovery required - standby not in limbo
ORA-16139 signalled during: alter database commit to switchover to primary with session shutdown...
三、解决方法
通过alert日志可以看到应该是还有日志没有被应用导致无法切换。于是在备库(A机)上执行应用日志命令:

SYS@DGDA>alter database recover managed standby database disconnect from session;
Database altered.

SYS@DGDA>select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
TO PRIMARY
此时再次查看状态发现已经可以转换了。
然后继续执行切换操作
SYS@DGDA>alter database commit to switchover to primary with session shutdown
SYS@DGDA>/
Database altered.
SYS@DGDA>shutdown immediate;
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SYS@DGDA>startup
ORACLE instance started.
Total System Global Area  536870912 bytes
Fixed Size                  1220460 bytes
Variable Size             146800788 bytes
Database Buffers          385875968 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.

问题解决。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26723566/viewspace-1294118/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26723566/viewspace-1294118/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值