如何处理11gR2 RAC下oc4j和gsd服务为OFFLINE状态?

        在Oracle Enterprise Linux 5.5 X86_64位的机器上配置完11gR2 RAC后,grid用户执行crs_stat -t查看服务状态时,我们会看到有一些服务是OFFLINE状态,其中就包括ora.oc4jora.gsd这两类服务,具体状态,我们看下面的示例输出:

[root@rac1 ~]# uname -rm
2.6.18-194.el5xen x86_64
[root@rac1 ~]# su - grid
rac1-> crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.DATADG.dg  ora....up.type ONLINE    ONLINE    rac1        
ora.GRIDDG.dg  ora....up.type ONLINE    ONLINE    rac1        
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1        
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac2        
ora.asm        ora.asm.type   ONLINE    ONLINE    rac1        
ora.devdb.db   ora....se.type ONLINE    ONLINE    rac1        
ora.eons       ora.eons.type  ONLINE    ONLINE    rac1        
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               
ora....network ora....rk.type ONLINE    ONLINE    rac1        
ora.oc4j       ora.oc4j.type  OFFLINE   OFFLINE               
ora.ons        ora.ons.type   ONLINE    ONLINE    rac1        
ora....SM1.asm application    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    OFFLINE   OFFLINE               
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    OFFLINE   OFFLINE               
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2        
ora....ry.acfs ora....fs.type ONLINE    ONLINE    rac1        
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac2        
rac1-> 

        那么,是我们的RAC配置有问题吗?这两类服务没有ONLINE会不会影响RAC数据库呢?我们又该如何启动这些服务呢?

        其实,我们的RAC配置是没有问题的,也不会影响数据库正常运行。在默认情况下,其中的ora.gsd服务状态是OFFLINE状态,我们可不予理会,除非需要在11g Cluster上配置Oracle 9iR2的RAC。但凡以grid用户执行crs_stat -t命令,看到Target和State这两列的状态均为OFFLINE,我们均可忽略。但是,我们该如何使之启动呢?

        1 启动ora.oc4j服务:

rac1-> srvctl start oc4j   
OC4J could not be started
PRCR-1079 : Failed to start resource ora.oc4j
CRS-2501: Resource 'ora.oc4j' is disabled
rac1-> srvctl enable oc4j -h

Enable OC4J instance for Oracle Clusterware management.

Usage: srvctl enable oc4j [-n ] [-v]
    -n            Node name
    -v                       Verbose output
    -h                       Print usage
rac1-> srvctl enable oc4j   
rac1-> srvctl start oc4j -v
OC4J has been started
rac1-> crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.DATADG.dg  ora....up.type ONLINE    ONLINE    rac1        
ora.GRIDDG.dg  ora....up.type ONLINE    ONLINE    rac1        
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1        
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac2        
ora.asm        ora.asm.type   ONLINE    ONLINE    rac1        
ora.devdb.db   ora....se.type ONLINE    ONLINE    rac1        
ora.eons       ora.eons.type  ONLINE    ONLINE    rac1        
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               
ora....network ora....rk.type ONLINE    ONLINE    rac1        
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    rac1        
ora.ons        ora.ons.type   ONLINE    ONLINE    rac1        
ora....SM1.asm application    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    OFFLINE   OFFLINE               
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    OFFLINE   OFFLINE               
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2        
ora....ry.acfs ora....fs.type ONLINE    ONLINE    rac1        
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac2        
rac1-> 

        2 启动ora.gsd服务:

rac1-> srvctl status nodeapps   
VIP rac1-vip is enabled
VIP rac1-vip is running on node: rac1
VIP rac2-vip is enabled
VIP rac2-vip is running on node: rac2
Network is enabled
Network is running on node: rac1
Network is running on node: rac2
GSD is disabled
GSD is not running on node: rac1
GSD is not running on node: rac2
ONS is enabled
ONS daemon is running on node: rac1
ONS daemon is running on node: rac2
eONS is enabled
eONS daemon is running on node: rac1
eONS daemon is running on node: rac2
rac1-> 

       从上,我们看到GSD服务状态是disabled,接下来enable GSD服务:

rac1-> srvctl enable nodeapps -g
rac1-> srvctl status nodeapps 
VIP rac1-vip is enabled
VIP rac1-vip is running on node: rac1
VIP rac2-vip is enabled
VIP rac2-vip is running on node: rac2
Network is enabled
Network is running on node: rac1
Network is running on node: rac2
GSD is enabled
GSD is not running on node: rac1
GSD is not running on node: rac2
ONS is enabled
ONS daemon is running on node: rac1
ONS daemon is running on node: rac2
eONS is enabled
eONS daemon is running on node: rac1
eONS daemon is running on node: rac2
rac1-> 

       然后,启动GSD服务

rac1-> srvctl start nodeapps -g
PRKO-2002 : Invalid command line option: -g
rac1-> srvctl start nodeapps   
PRKO-2421 : Network resource is already started on node(s): rac1,rac2
PRKO-2420 : VIP is already started on node(s): rac1,rac2
PRKO-2420 : VIP is already started on node(s): rac1,rac2
PRKO-2422 : ONS is already started on node(s): rac1,rac2
PRKO-2423 : eONS is already started on node(s): rac1,rac2

rac1-> crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.DATADG.dg  ora....up.type ONLINE    ONLINE    rac1        
ora.GRIDDG.dg  ora....up.type ONLINE    ONLINE    rac1        
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1        
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac2        
ora.asm        ora.asm.type   ONLINE    ONLINE    rac1        
ora.devdb.db   ora....se.type ONLINE    ONLINE    rac1        
ora.eons       ora.eons.type  ONLINE    ONLINE    rac1        
ora.gsd        ora.gsd.type   ONLINE    ONLINE    rac1        
ora....network ora....rk.type ONLINE    ONLINE    rac1        
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    rac1        
ora.ons        ora.ons.type   ONLINE    ONLINE    rac1        
ora....SM1.asm application    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2        
ora....ry.acfs ora....fs.type ONLINE    ONLINE    rac1        
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac2        
rac1-> 

          最后,我们看到所有的服务状态都是ONLINE状态!

评论 (3)

  • Rix Chan| 2012年3月14日

    11g RAC我还没有玩过呢
    10g我通常这么做的
    crs_stat -p | grep
    crs_start
    eg:crs_start ora.gsd
    不知道有没有什么区别呢?

  • Asher| 2012年3月15日

    To Rix Chan:
    慢慢来了,总有机会接触11gRAC的。
    10g、11g RAC还是有一些区别的。
    对于你说的那条命令而言,11g下,已经不再推荐使用crs_start命令来启动服务了,转而由crsctl来取代之。

  • mikixiyou| 2012年4月24日

    这个帖子写不错。正研究11gRAC,对这2个服务刚好困惑。
    11gRAC,你用多久了?

  • 发表评论

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