asm 單實例集群不隨系統(tǒng)啟動而自動開啟
數(shù)據(jù)庫:oracle11.2.0.4
系統(tǒng):CentOS7.9
環(huán)境:ASM單實例
問題描述:集群服務(wù)不隨系統(tǒng)的啟動而自動開啟,告警日志報錯如下:
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執(zhí)行starthas后,馬上在會話2執(zhí)行以下語句,待has啟動成功后,按CTRL+C終止dd命令.
[root@leo.oracle]# dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1
問題:如何實現(xiàn)集群服務(wù)隨系統(tǒng)的啟動而自動開啟呢?
以下解決此問題:
[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."
重啟系統(tǒng)后集群也自動開啟.
[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
