解决11gR2 RAC主库SWITCHOVER_STATUS为FAILED DESTINATION案例一则

简单记录一则处理11gR2 RAC主库的SWITCHOVER_STATUS为FAILED DESTINATION的案例

主库为OEL 5.5 X86_64位的11gR2的双节点RAC,物理备库是OEL 5.5 X86_64位的单实例库,在主库的V$DATABASE动态性能表中看到节点2的SWITCHOVER_STATUS状态为FAILED DESTINATION:

SQL> select inst_id,current_scn,protection_mode,database_role,force_logging,open_mode,switchover_status from gv$database;

INST_ID CURRENT_SCN PROTECTION_MODE      DATABASE_ROLE FOR OPEN_MODE  SWITCHOVER_STATUS
------- ----------- -------------------- ------------- --- ---------- --------------------
      2    16961718 MAXIMUM PERFORMANCE  PRIMARY       YES READ WRITE FAILED DESTINATION
      1    16961719 MAXIMUM PERFORMANCE  PRIMARY       YES READ WRITE RESOLVABLE GAP

SQL>

并且在备库的alert文件里看到下述错误信息:

 

.....
Fri Mar 16 09:29:11 2012
Error 1031 received logging on to the standby
FAL[client, ARC1]: Error 1031 connecting to devdb2 for fetching gap sequence
Errors in file /u01/app/oracle/diag/rdbms/phydb/phydb/trace/phydb_arc1_3897.trc:
ORA-01031: insufficient privileges
Errors in file /u01/app/oracle/diag/rdbms/phydb/phydb/trace/phydb_arc1_3897.trc:
ORA-01031: insufficient privileges
Fri Mar 16 09:33:06 2012
...

同样看到/u01/app/oracle/diag/rdbms/phydb/phydb/trace/phydb_arc1_3897.trc里也有类似的信息:

 

*** 2012-03-16 09:29:11.683
OCISessionBegin failed. Error -1
.. Detailed OCI error val is 1031 and errmsg is 'ORA-01031: insufficient privileges
'
OCISessionBegin failed. Error -1
.. Detailed OCI error val is 1031 and errmsg is 'ORA-01031: insufficient privileges
'
*** 2012-03-16 09:29:11.738 4132 krsh.c
Error 1031 received logging on to the standby
*** 2012-03-16 09:29:11.741 4132 krsh.c
FAL[client, ARC1]: Error 1031 connecting to devdb2 for fetching gap sequence
ORA-01031: insufficient privileges
ORA-01031: insufficient privileges

基本可以判断出是物理备库无法连接主库的节点2,提示权限不够,极有可能是口令文件的配置造成问题的原因。

果然,在主库上重新修改SYS用户口令之后,并将口令文件SCP至物理备库后,过一段时间后,物理备库alert文件出现下述正常信息:

Fri Mar 16 09:45:44 2012
RFS[5]: Assigned to RFS process 4212
RFS[5]: Identified database type as 'physical standby': Client is ARCH pid 6051
RFS[5]: Opened log for thread 2 sequence 239 dbid 676938241 branch 772208260
Archived Log entry 496 added for thread 2 sequence 239 rlc 772208260 ID 0x28b1d7da dest 2:
RFS[5]: Opened log for thread 2 sequence 240 dbid 676938241 branch 772208260
Archived Log entry 497 added for thread 2 sequence 240 rlc 772208260 ID 0x28b1d7da dest 2:
RFS[5]: Opened log for thread 2 sequence 241 dbid 676938241 branch 772208260
Archived Log entry 498 added for thread 2 sequence 241 rlc 772208260 ID 0x28b1d7da dest 2:
Fri Mar 16 09:45:48 2012

到主库上重新查看SWITCHOVER_STATUS状态信息:

 

SQL> select inst_id,current_scn,protection_mode,database_role,force_logging,open_mode,switchover_status from gv$database;

INST_ID CURRENT_SCN PROTECTION_MODE      DATABASE_ROLE FOR OPEN_MODE  SWITCHOVER_STATUS
------- ----------- -------------------- ------------- --- ---------- --------------------
      2    16961718 MAXIMUM PERFORMANCE  PRIMARY       YES READ WRITE TO STANDBY
      1    16961719 MAXIMUM PERFORMANCE  PRIMARY       YES READ WRITE LOG SWITCH GAP

SQL>

备库执行Redo Apply:

 

SQL> alter database recover managed standby database using current logfile disconnect from session;

最后,主库双节点日志全部传输至物理备库,且已经全部被应用:

 

SQL> select name,thread#,sequence#,applied from v$archived_log ;
NAME                                                            THREAD#  SEQUENCE# APPLIED
------------------------------------------------------------ ---------- ---------- ---------
/home/oracle/arch/ARC_1_0000000335_772208260.arc                      1        335 YES
/home/oracle/arch/ARC_2_0000000233_772208260.arc                      2        233 YES
/home/oracle/arch/ARC_2_0000000234_772208260.arc                      2        234 YES
/home/oracle/arch/ARC_2_0000000235_772208260.arc                      2        235 YES
/home/oracle/arch/ARC_2_0000000236_772208260.arc                      2        236 YES
/home/oracle/arch/ARC_1_0000000336_772208260.arc                      1        336 YES
/home/oracle/arch/ARC_1_0000000338_772208260.arc                      1        338 YES
/home/oracle/arch/ARC_1_0000000337_772208260.arc                      1        337 YES
/home/oracle/arch/ARC_1_0000000339_772208260.arc                      1        339 YES
/home/oracle/arch/ARC_2_0000000239_772208260.arc                      2        239 YES
/home/oracle/arch/ARC_2_0000000240_772208260.arc                      2        240 YES

NAME                                                            THREAD#  SEQUENCE# APPLIED
------------------------------------------------------------ ---------- ---------- ---------
/home/oracle/arch/ARC_2_0000000241_772208260.arc                      2        241 YES
/home/oracle/arch/ARC_1_0000000340_772208260.arc                      1        340 IN-MEMORY
/home/oracle/arch/ARC_2_0000000238_772208260.arc                      2        238 YES
/home/oracle/arch/ARC_2_0000000237_772208260.arc                      2        237 YES
/home/oracle/arch/ARC_2_0000000242_772208260.arc                      2        242 YES

至此,解决问题。在本案例中导致物理备库的SWITCHOVER_STATUS为FAILED DESTINATION的原因是口令文件出错,导致的,简单记录一下

评论 (1)

  • hqx| 2012年3月18日

    嘿嘿,为什么无缘无故,口令文件不行了呀。

  • 发表评论

    邮箱地址不会被公开。 必填项已用*标注