一、引言
前几天安装了Oracle 11gR的ASM,但是今天想要启动ASM的时候遇到下面的情况:
1 [grid@yft ~]$ sqlplus /nolog 2 3 SQL*Plus: Release 11.2.0.1.0 Production on Sun Mar 24 08:37:57 2013 4 5 Copyright (c) 1982, 2009, Oracle. All rights reserved. 6 7 SQL> conn / as sysasm 8 Connected to an idle instance. 9 SQL> startup 10 ORA-01078: failure in processing system parameters 11 ORA-29701: unable to connect to Cluster Synchronization Service
二、解决问题
无法连接到CSS服务上,到操作系统上检查一下:
1 [grid@yft ~]$ crsctl check css 2 CRS-4530: Communications failure contacting Cluster Synchronization Services daemon 3 [grid@yft ~]$ ps -ef |grep cssd 4 grid 5327 4963 0 08:33 pts/0 00:00:00 grep cssd
果然没有CSS的服务daemon进程,再看一下HAS(High Availability Service)的状态:
1 [grid@yft ~]$ crsctl check has 2 CRS-4638: Oracle High Availability Services is online 3 [grid@yft ~]$ ps -ef |grep d.bin 4 grid 4704 1 0 08:22 ? 00:00:02 /u01/app/grid/product/11.2.0/grid/bin/ohasd.bin reboot 5 grid 5334 4963 0 08:34 pts/0 00:00:00 grep d.bin
发现HAS的服务确实启动了的,而ora.cssd和ora.diskmon这2个服务是依赖于HAS维护的,进一步查看各资源的状态:
1 [grid@yft ~]$ crsctl status resource -t 2 -------------------------------------------------------------------------------- 3 NAME TARGET STATE SERVER STATE_DETAILS 4 -------------------------------------------------------------------------------- 5 Local Resources 6 -------------------------------------------------------------------------------- 7 ora.DATA.dg 8 OFFLINE OFFLINE yft 9 ora.DATA1.dg 10 OFFLINE OFFLINE yft 11 ora.asm 12 OFFLINE OFFLINE yft 13 -------------------------------------------------------------------------------- 14 Cluster Resources 15 -------------------------------------------------------------------------------- 16 ora.cssd 17 1 ONLINE OFFLINE 18 ora.diskmon 19 1 ONLINE OFFLINE 20 ora.orcl.db 21 1 OFFLINE OFFLINE
再看一下ora.cssd和ora.diskmon的属性:
1 [grid@yft ~]$ crs_stat -p ora.cssd 2 NAME=ora.cssd 3 TYPE=ora.cssd.type 4 ACTION_SCRIPT= 5 ACTIVE_PLACEMENT=0 6 AUTO_START=never 7 CHECK_INTERVAL=30 8 DESCRIPTION="Resource type for CSSD" 9 FAILOVER_DELAY=0 10 FAILURE_INTERVAL=3 11 FAILURE_THRESHOLD=5 12 HOSTING_MEMBERS= 13 PLACEMENT=balanced 14 RESTART_ATTEMPTS=5 15 SCRIPT_TIMEOUT=600 16 START_TIMEOUT=600 17 STOP_TIMEOUT=900 18 UPTIME_THRESHOLD=1m 19 20 [grid@yft ~]$ crs_stat -p ora.diskmon 21 NAME=ora.diskmon 22 TYPE=ora.diskmon.type 23 ACTION_SCRIPT= 24 ACTIVE_PLACEMENT=0 25 AUTO_START=never 26 CHECK_INTERVAL=20 27 DESCRIPTION="Resource type for Diskmon" 28 FAILOVER_DELAY=0 29 FAILURE_INTERVAL=3 30 FAILURE_THRESHOLD=5 31 HOSTING_MEMBERS= 32 PLACEMENT=balanced 33 RESTART_ATTEMPTS=10 34 SCRIPT_TIMEOUT=60 35 START_TIMEOUT=60 36 STOP_TIMEOUT=60 37 UPTIME_THRESHOLD=5s
到这里基本就找到了原因了,可以看到这两个资源的AUTO_START属性默认都设置为never,也就是说他们不会随着HAS服务的启动而自动启动的,尽管默认情况下HAS服务是开机自动启动的,现在手动启动一下:
1 [grid@yft ~]$ crsctl start resource ora.cssd 2 CRS-2672: Attempting to start 'ora.cssd' on 'yft' 3 CRS-2679: Attempting to clean 'ora.diskmon' on 'yft' 4 CRS-2681: Clean of 'ora.diskmon' on 'yft' succeeded 5 CRS-2672: Attempting to start 'ora.diskmon' on 'yft' 6 CRS-2676: Start of 'ora.diskmon' on 'yft' succeeded 7 CRS-2676: Start of 'ora.cssd' on 'yft' succeeded 8 9 注:ora.cssd和ora.diskmon这两个服务是有依赖关系的,启动哪个都会把两个都起来。 10 11 [grid@yft ~]$ crs_stat -t 12 Name Type Target State Host 13 ------------------------------------------------------------ 14 ora.DATA.dg ora....up.type OFFLINE OFFLINE 15 ora.DATA1.dg ora....up.type OFFLINE OFFLINE 16 ora.asm ora.asm.type OFFLINE OFFLINE 17 ora.cssd ora.cssd.type ONLINE ONLINE yft 18 ora.diskmon ora....on.type ONLINE ONLINE yft 19 ora.orcl.db ora....se.type OFFLINE OFFLINE
CSS服务起来了,重启动asm instnace
1 [grid@yft ~]$ crs_stat -t 2 Name Type Target State Host 3 ------------------------------------------------------------ 4 ora.DATA.dg ora....up.type ONLINE ONLINE yft 5 ora.DATA1.dg ora....up.type ONLINE ONLINE yft 6 ora.asm ora.asm.type ONLINE ONLINE yft 7 ora.cssd ora.cssd.type ONLINE ONLINE yft 8 ora.diskmon ora....on.type ONLINE ONLINE yft 9 ora.orcl.db ora....se.type OFFLINE OFFLINE
tips:
1)、默认情况下HAS(High Availability Service)是自动启动的,通过如下命令可以取消和启动自动启动
crsctl disable has
crsctl enable has
2)、HAS手动启动和停止
crsctl start has
crsctl stop has
3)、查看HAS的状态
crsctl check has
4)、如果想让ora.cssd和ora.diskmon服务随着HAS的启动而自动启动,那么你可以把这两个服务的AUTO_START属性:
crsctl modify resource "ora.cssd" -attr "AUTO_START=1"
crsctl modify resource "ora.diskmon" -attr "AUTO_START=1"
5)、如果想取消ora.cssd和ora.diskmon的Auto start
crsctl modify resource "ora.cssd" -attr "AUTO_START=never"
crsctl modify resource "ora.diskmon" -attr "AUTO_START=never"