在Oracle Enterprise Linux 5.5 X86_64位的机器上配置完11gR2 RAC后,grid用户执行crs_stat -t查看服务状态时,我们会看到有一些服务是OFFLINE状态,其中就包括ora.oc4j和ora.gsd这两类服务,具体状态,我们看下面的示例输出:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
[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服务:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
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 <NODE_NAME>] [-v]
-n <NODE_NAME> 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服务:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
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服务:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
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服务
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
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状态!