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

摘自: http://blog.163.com/xiaohan_008/blog/static/126347420129994358263/

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

 

01 [root@rac1 ~]# uname -rm
02 2.6.18-194.el5xen x86_64
03 [root@rac1 ~]# su - grid
04 rac1-> crs_stat -t
05 Name           Type           Target    State     Host        
06 ------------------------------------------------------------
07 ora.DATADG.dg  ora....up.type ONLINE    ONLINE    rac1        
08 ora.GRIDDG.dg  ora....up.type ONLINE    ONLINE    rac1        
09 ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1        
10 ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac2        
11 ora.asm        ora.asm.type   ONLINE    ONLINE    rac1        
12 ora.devdb.db   ora....se.type ONLINE    ONLINE    rac1        
13 ora.eons       ora.eons.type  ONLINE    ONLINE    rac1        
14 ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               
15 ora....network ora....rk.type ONLINE    ONLINE    rac1        
16 ora.oc4j       ora.oc4j.type  OFFLINE   OFFLINE               
17 ora.ons        ora.ons.type   ONLINE    ONLINE    rac1        
18 ora....SM1.asm application    ONLINE    ONLINE    rac1        
19 ora....C1.lsnr application    ONLINE    ONLINE    rac1        
20 ora.rac1.gsd   application    OFFLINE   OFFLINE               
21 ora.rac1.ons   application    ONLINE    ONLINE    rac1        
22 ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1        
23 ora....SM2.asm application    ONLINE    ONLINE    rac2        
24 ora....C2.lsnr application    ONLINE    ONLINE    rac2        
25 ora.rac2.gsd   application    OFFLINE   OFFLINE               
26 ora.rac2.ons   application    ONLINE    ONLINE    rac2        
27 ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2        
28 ora....ry.acfs ora....fs.type ONLINE    ONLINE    rac1        
29 ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac2        
30 rac1->

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

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

        1 启动ora.oc4j服务:

01 rac1-> srvctl start oc4j   
02 OC4J could not be started
03 PRCR-1079 : Failed to start resource ora.oc4j
04 CRS-2501: Resource 'ora.oc4j' is disabled
05 rac1-> srvctl enable oc4j -h
06
07 Enable OC4J instance for Oracle Clusterware management.
08
09 Usage: srvctl enable oc4j [-n <NODE_NAME>] [-v]
10     -n <NODE_NAME>           Node name
11     -v                       Verbose output
12     -h                       Print usage
13 rac1-> srvctl enable oc4j   
14 rac1-> srvctl start oc4j -v
15 OC4J has been started
16 rac1-> crs_stat -t
17 Name           Type           Target    State     Host        
18 ------------------------------------------------------------
19 ora.DATADG.dg  ora....up.type ONLINE    ONLINE    rac1        
20 ora.GRIDDG.dg  ora....up.type ONLINE    ONLINE    rac1        
21 ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1        
22 ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac2        
23 ora.asm        ora.asm.type   ONLINE    ONLINE    rac1        
24 ora.devdb.db   ora....se.type ONLINE    ONLINE    rac1        
25 ora.eons       ora.eons.type  ONLINE    ONLINE    rac1        
26 ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               
27 ora....network ora....rk.type ONLINE    ONLINE    rac1        
28 ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    rac1        
29 ora.ons        ora.ons.type   ONLINE    ONLINE    rac1        
30 ora....SM1.asm application    ONLINE    ONLINE    rac1        
31 ora....C1.lsnr application    ONLINE    ONLINE    rac1        
32 ora.rac1.gsd   application    OFFLINE   OFFLINE               
33 ora.rac1.ons   application    ONLINE    ONLINE    rac1        
34 ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1        
35 ora....SM2.asm application    ONLINE    ONLINE    rac2        
36 ora....C2.lsnr application    ONLINE    ONLINE    rac2        
37 ora.rac2.gsd   application    OFFLINE   OFFLINE               
38 ora.rac2.ons   application    ONLINE    ONLINE    rac2        
39 ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2        
40 ora....ry.acfs ora....fs.type ONLINE    ONLINE    rac1        
41 ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac2        
42 rac1->

        2 启动ora.gsd服务:

01 rac1-> srvctl status nodeapps   
02 VIP rac1-vip is enabled
03 VIP rac1-vip is running on node: rac1
04 VIP rac2-vip is enabled
05 VIP rac2-vip is running on node: rac2
06 Network is enabled
07 Network is running on node: rac1
08 Network is running on node: rac2
09 GSD is disabled
10 GSD is not running on node: rac1
11 GSD is not running on node: rac2
12 ONS is enabled
13 ONS daemon is running on node: rac1
14 ONS daemon is running on node: rac2
15 eONS is enabled
16 eONS daemon is running on node: rac1
17 eONS daemon is running on node: rac2
18 rac1->

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

01 rac1-> srvctl enable nodeapps -g
02 rac1-> srvctl status nodeapps 
03 VIP rac1-vip is enabled
04 VIP rac1-vip is running on node: rac1
05 VIP rac2-vip is enabled
06 VIP rac2-vip is running on node: rac2
07 Network is enabled
08 Network is running on node: rac1
09 Network is running on node: rac2
10 GSD is enabled
11 GSD is not running on node: rac1
12 GSD is not running on node: rac2
13 ONS is enabled
14 ONS daemon is running on node: rac1
15 ONS daemon is running on node: rac2
16 eONS is enabled
17 eONS daemon is running on node: rac1
18 eONS daemon is running on node: rac2
19 rac1->

       然后,启动GSD服务

01 rac1-> srvctl start nodeapps -g
02 PRKO-2002 : Invalid command line option: -g
03 rac1-> srvctl start nodeapps   
04 PRKO-2421 : Network resource is already started on node(s): rac1,rac2
05 PRKO-2420 : VIP is already started on node(s): rac1,rac2
06 PRKO-2420 : VIP is already started on node(s): rac1,rac2
07 PRKO-2422 : ONS is already started on node(s): rac1,rac2
08 PRKO-2423 : eONS is already started on node(s): rac1,rac2
09
10 rac1-> crs_stat -t
11 Name           Type           Target    State     Host        
12 ------------------------------------------------------------
13 ora.DATADG.dg  ora....up.type ONLINE    ONLINE    rac1        
14 ora.GRIDDG.dg  ora....up.type ONLINE    ONLINE    rac1        
15 ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1        
16 ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac2        
17 ora.asm        ora.asm.type   ONLINE    ONLINE    rac1        
18 ora.devdb.db   ora....se.type ONLINE    ONLINE    rac1        
19 ora.eons       ora.eons.type  ONLINE    ONLINE    rac1        
20 ora.gsd        ora.gsd.type   ONLINE    ONLINE    rac1        
21 ora....network ora....rk.type ONLINE    ONLINE    rac1        
22 ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    rac1        
23 ora.ons        ora.ons.type   ONLINE    ONLINE    rac1        
24 ora....SM1.asm application    ONLINE    ONLINE    rac1        
25 ora....C1.lsnr application    ONLINE    ONLINE    rac1        
26 ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
27 ora.rac1.ons   application    ONLINE    ONLINE    rac1        
28 ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1        
29 ora....SM2.asm application    ONLINE    ONLINE    rac2        
30 ora....C2.lsnr application    ONLINE    ONLINE    rac2        
31 ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
32 ora.rac2.ons   application    ONLINE    ONLINE    rac2        
33 ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2        
34 ora....ry.acfs ora....fs.type ONLINE    ONLINE    rac1        
35 ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac2        
36 rac1->

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

你可能感兴趣的:(如何处理11gR2 RAC下oc4j和gsd服务为OFFLINE状态?)