白天和黑夜只交替没交换无法想像对方的世界
分类: Oracle
2011-09-22 17:16:08
RAC 服务的启动出现UNKNOWN问题的处理方法
RAC环境中如果使用crs_stop -all去停rac服务时,很有可能会出现crs中的一些服务的状态是UNKNOWN,这时我们可以采用两种方法去重新启动crs服务:
1:切换到root用户下用/etc/init.d/init.crs stop先禁用crs,然后再用/etc/init.d/init.crs start去启用crs,启用crs后会自动启动crs的一系列服务,注意此种方法需要在两台节点上都执行;
2:是用crs_stop -f 参数把crs中状态是UNKNOWN的服务关掉,然后再用crs_start -f (加一个-f的参数)启动所有的服务就可以。要分别在两个节点上执行;
在启动的过程中最好检测着crs、ASM和数据库的日志:
crs日志:
[oracle@rac1 ~]$ tail -f $CRS_HOME/log/rac1/alertrac1.log
[oracle@rac2 ~]$ tail -f $CRS_HOME/log/rac2/alertrac2.log
ASM日志:
[oracle@rac1 ~]$ tail -f $ORACLE_BASE/admin/+ASM/bdump/alert_+ASM1.log
[oracle@rac2 ~]$ tail -f $ORACLE_BASE/admin/+ASM/bdump/alert_+ASM2.log
数据库日志:
[oracle@rac1 ~]$ tail -f $ORACLE_BASE/admin/RAC/bdump/alert_RAC1.log
[oracle@rac2 ~]$ tail -f $ORACLE_BASE/admin/RAC/bdump/alert_RAC2.log
以下是出现问题的一个例子的处理方法:
当用srvctl启动数据库及实例时,报错如下:
[oracle@rac2 ~] $ srvctl start instance -d RAC –i RAC1
PRKP-1001 : Error starting instance RAC1 on node rac1
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.RAC.RAC1.inst' has placement error.
检查crsd.log日志文件,文件存放路径为:$CRS_HOME/log/
2011-09-20 16:47:21.701: [ CRSRES][2751175568]0`ora.RAC.RAC1.inst` is already OFFLINE.
2011-09-22 03:25:55.115: [ CRSRES][2717805456]0CRS-1028: Dependency analysis failed because of: 'Resource in UNKNOWN state: ora.rac1.ASM1.asm'
现在检查ASM实例的状态:
[oracle@rac2 ~]$ crs_stat ora.rac1.ASM1.asm
NAME=ora.rac1.ASM1.asm
TYPE=application
TARGET=ONLINE
STATE= UNKNOWN on rac1
解决方法:
由于这个实例无法启动ASM实例的依赖。所以,只须把先停止asm实例,再重启把UNKNOWN状态变为OFFLINE到ONLINE,这样,实例也就启动起来了。
[oracle@rac2 ~] $ crs_stop -f ora.rac1.ASM1.asm
Attempting to stop `ora.rac1.ASM1.asm` on member `rac1`
Stop of `ora.rac1.ASM1.asm` on member `rac1` succeeded.
[oracle@rac2 ~]$ crs_stat ora.rac1.ASM1.asm
NAME=ora.rac1.ASM1.asm
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
[oracle@rac2 ~] $ srvctl start asm –n rac1
再检查实例状态,变为ONLINE:
[oracle@rac2 ~] $ crs_stat ora.rac1.ASM1.asm
NAME=ora.rac1.ASM1.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on rac1
[oracle@rac2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....C1.inst application ONLINE ONLINE rac1
ora....C2.inst application ONLINE ONLINE rac2
ora.RAC.db application 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 application 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 application ONLINE ONLINE rac2