系统检查
检查共享设备
一般情况下, 存放OCR 和 Voting Disk 的OCFS2 或者raw 都是自动启动的。 如果他们没有启动,RAC 肯定是启动不了的。
如果使用ocfs2的,检查ocfs2 状态
/etc/init.d/o2cb status
在挂载之前,/etc/init.d/o2cb status 显示为Checking O2CB heartbeat: Not active。
在格式化和挂载文件系统之前,应验证 O2CB 在两个节点上均联机;O2CB 心跳当前没有活动,因为文件系统还没有挂载 。挂载之后就会变成active。
mount -t ocfs2 -o datavolume /dev/sdb1 /u02/oradata/orcl
如果使用raw device.
# /etc/init.d/rawdevices status
/dev/raw/raw1: bound to major 8, minor 17
/dev/raw/raw2: bound to major 8, minor 18
检查ASM
/etc/init.d/oracleasm listdisks
RAC检查crs、css等进程是否是自动启动的:
# ls -l /etc/init.d/init.*
-r-xr-xr-x 1 root root 1951 Feb 26 22:38 /etc/init.d/init.crs
-r-xr-xr-x 1 root root 4714 Feb 26 22:38 /etc/init.d/init.crsd
-r-xr-xr-x 1 root root 35394 Feb 26 22:38 /etc/init.d/init.cssd
-r-xr-xr-x 1 root root 3190 Feb 26 22:38 /etc/init.d/init.evmd
如果css和crs不是随系统启动而启动,可手工启动命令如下,注意crsd进程的启动默认会带动所有资源启动
#/etc/init.d/init.cssd start
#./crsctl start crs
手动启、停crs资源过程如下所示
停止RAC:
emctl stop dbconsole
srvctl stop instance -d raw -i raw1
srvctl stop instance -d raw -i raw2
srvctl stop asm -n raw1
srvctl stop asm -n raw2
srvctl stop nodeapps -n raw1
srvctl stop nodeapps -n raw2
启动RAC:
srvctl start nodeapps -n raw1
srvctl start nodeapps -n raw2
srvctl start asm -n raw1
srvctl start asm -n raw2
srvctl start instance -d raw -i raw2
srvctl start instance -d orcl -i raw1
emctl start dbconsole
使用 SRVCTL 启动/停止所有实例及其启用的服务。
srvctl start database -d orcl
srvctl stop database -d orcl
注:CRS Resource 包括GSD(Global Serveice Daemon),ONS(Oracle Notification Service),VIP, Database, Instance 和 Service. 这些资源被分成2类:
GSD,ONS,VIP 和 Listener 属于Noteapps类
Database,Instance 和Service 属于 Database-Related Resource 类。
正常情况下, 进程都是online的:
# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.raw.db application ONLINE ONLINE raw1
ora.raw.raw.cs application ONLINE ONLINE raw1
ora....aw1.srv application ONLINE ONLINE raw1
ora....aw2.srv application ONLINE ONLINE raw2
ora....w1.inst application ONLINE ONLINE raw1
ora....w2.inst application ONLINE ONLINE raw2
ora....SM1.asm application ONLINE ONLINE raw1
ora....W1.lsnr application ONLINE ONLINE raw1
ora.raw1.gsd application ONLINE ONLINE raw1
ora.raw1.ons application ONLINE ONLINE raw1
ora.raw1.vip application ONLINE ONLINE raw1
ora....SM2.asm application ONLINE ONLINE raw2
ora....W2.lsnr application ONLINE ONLINE raw2
ora.raw2.gsd application ONLINE ONLINE raw2
ora.raw2.ons application ONLINE ONLINE raw2
ora.raw2.vip application ONLINE ONLINE raw2
unknown和offline
查看crs资源如果出现以下情况:
# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.rac.db application ONLINE UNKNOWN rac1
ora....orcl.cs application ONLINE UNKNOWN rac1
ora....ac1.srv application OFFLINE OFFLINE
ora....ac2.srv application OFFLINE OFFLINE
ora....c1.inst application ONLINE UNKNOWN rac1
ora....c2.inst application ONLINE UNKNOWN rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE UNKNOWN rac1
ora.rac1.gsd application ONLINE UNKNOWN rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE UNKNOWN rac2
ora.rac2.gsd application ONLINE UNKNOWN rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
可用crs_stat 查看进程全部信息:
# ./crs_stat
NAME=ora.rac.db
TYPE=application
TARGET=ONLINE
STATE=ONLINE on rac2
NAME=ora.rac1.LISTENER_RAC1.lsnr
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac1
NAME=ora.rac1.gsd
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac1
NAME=ora.rac2.LISTENER_RAC2.lsnr
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac2
... ...
对于offline 的进程,我们可以直接手动的启动它
# ./crs_start ora.rac.orcl.rac1.srv
Attempting to start `ora.rac.orcl.rac1.srv` on member `rac1`
Start of `ora.rac.orcl.rac1.srv` on member `rac1` succeeded.
对于UNKNOWN 的进程,我们可以先stop 它, 在start。
# ./crs_stop ora.rac2.gsd
Attempting to stop `ora.rac2.gsd` on member `rac2`
Stop of `ora.rac2.gsd` on member `rac2` succeeded.
# ./crs_start ora.rac2.gsd
Attempting to start `ora.rac2.gsd` on member `rac2`
Start of `ora.rac2.gsd` on member `rac2` succeeded.
如果crs_stop不能结束,crs_start 不能启动的进程,我们有2中方法来解决:
1、是用crs_stop -f 参数把crs中状态是UNKNOWN的服务关掉,然后再用crs_start -f (加一个-f的参数)启动所有的服务就可以。要分别在两个节点上执行;
$ crs_start -f ora.ora9i.ora9i2.inst
Attempting to start `ora.ora9i.ora9i2.inst` on member `rac2`
Start of `ora.ora9i.ora9i2.inst` on member `rac2` succeeded.
$ crs_stop -f ora.ora9i.db
Attempting to stop `ora.ora9i.db` on member `rac2`
Stop of `ora.ora9i.db` on member `rac2` succeeded.
2、转换到root用户下用/etc/init.d/init.crs stop先禁用crs,然后再用/etc/init.d/init.crs start去启用crs,启用crs后会自动启动crs的一系列服务,注意此种方法需要在两台节点上都执行;
可以用命令一次启动和关闭相关进程
# ./crs_stop -all
# ./crs_start -all
CRS-1028、CRS-0223
如果在启动crs资源的时候报错
$ crs_start -all
CRS-1028: Dependency analysis failed because of:
'Resource in UNKNOWN state: ora.rac1.ASM1.asm'
CRS-1028: Dependency analysis failed because of:
'Resource in UNKNOWN state: ora.rac2.ASM2.asm'
CRS-0223: Resource 'ora.devdb.devdb1.inst' has placement error.
CRS-0223: Resource 'ora.devdb.devdb2.inst' has placement error
出现placement error这个问题的原因,主要是资源占用,也就是说两个实例资源出现在同一个节点上,导致另外一个节点得不到需要得资源。
解决办法:出现这个问题,最好是手工用命令启动相关的CRS服务,然后看看具体报什么错误。
启动服务得时候一定要将所有节点服务关闭,然后先启动一个节点,接着观察crs_stat的状态。当这个节点的所有服务正常后,再启动另一个节点。最后通过crs_stat观察全局节点状态。
1、$./crs_stop -all 停掉所有应用,然后在依次按下列步骤进行查看报错信息:
2、启应用程序(虚拟 IP、GSD、TNS 监听器和 ONS)
$srvctl start nodeapps -n node1
3、启动ASM实例
$srvctl start asm -n node1
4、启动RDBMS实例
$srvctl start instance -d sjhracdb -i sjhracdb1
5、用crs_stat -t检查一下状态。
6、在所有节点重复上述步骤
CRS-0215
如果在crs_stat -all或者安装clusterware时出现CRS-0215时
CRS-0215 : Could not start resource 'ora.node2.ons'.
请确认/etc/hosts中的配置,确保存在回环地址且其中的名称解析正确
$ more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
#127.0.0.1 localhost.localdomain localhost
#::1 localhost6.localdomain6 localhost6
127.0.0.1 node2.oradb.com node2
# Public
192.168.0.11 node1.oradb.com node1
192.168.0.12 node2.oradb.com node2
#Privative
10.101.0.11 node1-priv.oradb.com node1-priv
10.101.0.12 node2-priv.oradb.com node2-priv
#Virtual
192.168.0.21 node1-vip.oradb.com node1-vip
192.168.0.22 node2-vip.oradb.com node2-vip
参考至:《大话Oracle RAC》张晓明著
http://blog.csdn.net/robinson_0612/article/details/6303583
http://blog.chinaunix.net/uid-20274021-id-1969695.html
http://blog.sina.com.cn/s/blog_6cfadffb0100m48w.html
http://blog.csdn.net/tianlesoftware/article/details/5349003
本文原创,转载请注明出处、作者
如有错误,欢迎指正
邮箱:czmcj@163.com