一、系统环境:
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/