数据库:oracle11.2.0.4 系统:CentOS7.9 环境:ASM单实例 问题描述:集群服务不随系统的启动而自动开启,告警日志报错如下: 2022-07-2410:21:20.779: [ohasd(2107)]CRS-0715:OracleHigh Availability Service has timed out waiting for init.ohasd to be started. 临时解决方案: Clear all sockets under /var/tmp/.oracle or /tmp/.oracle if any and thenopen two terminals of the same node, where stack is not coming up. 会话1: [root@leo~]# /u01/app/grid/product/11.2.0/grid/bin/crsctl start has CRS-4123:Oracle High Availability Services has been started. 会话1执行starthas后,马上在会话2执行以下语句,待has启动成功后,按CTRL+C终止dd命令. [root@leo.oracle]# dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1 问题:如何实现集群服务随系统的启动而自动开启呢? 以下解决此问题: [root@leo~]# vi /etc/init.d/ohasd 红颜色高亮为新增部分 if [ -r $AUTOSTARTFILE ] then case `$CAT $AUTOSTARTFILE` in enable*) $LOGERR "Oracle HA daemon isenabled for autostart." /bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024count=1 & my_crsctl start has -nowait sleep 600 ps -ef | grep dd| grephasd|awk '{print $2}'|xargs kill -9 ;; disable*) $LOGERR "Oracle HA daemon isdisabled for autostart." 重启系统后集群也自动开启. [root@leo~]# reboot [grid@leo~]$ crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- LocalResources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE leo ora.LISTENER.lsnr ONLINE ONLINE leo ora.asm ONLINE ONLINE leo Started ora.ons OFFLINE OFFLINE leo -------------------------------------------------------------------------------- ClusterResources -------------------------------------------------------------------------------- ora.cssd 1 ONLINE ONLINE leo ora.diskmon 1 OFFLINE OFFLINE ora.evmd 1 ONLINE ONLINE leo ora.orcl.db 1 ONLINE ONLINE leo Open
|