Oracle11g RAC 启动流程梳理(二)OHASD简析和启停实验

简单说明:

11gRAC启动分为四个层次,第一个层次是OHASD和子代理进程启动:

init——>init.ohasd——>ohasd——>agent子进程启动

即:

OS启动——>/etc/rc.d/init.d/init.ohasd启动——>/etc/rc.d/init.d/ohasd启动

对应进程:

/sbin/init——>/bin/sh /etc/init.d/init.ohasd run——>/u01/11.2.0/grid/bin/ohasd.bin reboot

俩脚本模板位置:

/u01/11.2.0/grid/crs/utl/init.ohasd
/u01/11.2.0/grid/crs/init/init.ohasd
/u01/11.2.0/grid/crs/init/ohasd
/u01/11.2.0/grid/crs/utl/ohasd

关闭OHASD开机自动启动:

关闭ohasd自动启动后 init.ohasd 会启动,但是ohasd不会启动,不建议对 init.ohasd 进行更改

su -
cd "$(su - grid -c 'echo $ORACLE_HOME')/bin"
./crsctl disable crs
# CRS-4621: Oracle High Availability Services autostart is disabled.
# 关闭ohasd自动启动
./crsctl stop cluster -all
# 关闭所有节点的所有集群服务
reboot
# 重启服务器

手动启动OHASD:

su -
# 删除ohasd日志
cd "$(su - grid -c 'echo $ORACLE_HOME')/log/$(hostname)/ohasd"
rm -rf *
# 删除ohasd子进程日志
cd "$(su - grid -c 'echo $ORACLE_HOME')/log/$(hostname)/agent/ohasd"
rm -rf */*
# 手动启动ohasd
cd "$(su - grid -c 'echo $ORACLE_HOME')/bin"
./crsctl start crs
# 监控日志
cd "$(su - grid -c 'echo $ORACLE_HOME')/log/$(hostname)/ohasd"
tailf ohasd.log
cd "$(su - grid -c 'echo $ORACLE_HOME')/log/$(hostname)/agent/ohasd"
tree

手动关闭OHASD:

su -
cd "$(su - grid -c 'echo $ORACLE_HOME')/bin"
./crsctl stop crs
# 手动关闭ohasd,会将本节点的集群服务关闭,不会关闭其他节点的集群服务

[TOC]

猜你喜欢

转载自blog.csdn.net/zwjzqqb/article/details/80679840