RAC 11GR2 集群启动脚本

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34556414/article/details/83537002

读书笔记:

 

11GR2版本

来看看11GR2版本集群的/etc/inittab文件。

#run xdm in runlevel 5

x:5:respawn:/etc/X11/perfdm -nodaemon

h1:35:respawn:/etc/init.d/init.ohasd run >/dev/null

 

只有脚本/etc/init.d/init.ohasd被调用,10G版本的之前三个脚本已经不存在了,下面是脚本的内容。

[root@RAC1 ~]# find / -name init.ohasd

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

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

^C

[root@RAC1 ~]# cat /u01/app/11.2.0/grid/crs/init/init.ohasd

 

######### Instantiated Variables #########

ORA_CRS_HOME=/u01/app/11.2.0/grid

export ORA_CRS_HOME

 

HAS_USER=root

SCRBASE=/etc/oracle/scls_scr

 

#limits

CRS_LIMIT_CORE=unlimited

CRS_LIMIT_MEMLOCK=unlimited

CRS_LIMIT_OPENFILE=65536

##########################################

.................................................................................

### CLI tools

BASENAME=/bin/basename

HOSTN=/bin/hostname

SU=/bin/su

CHOWN=/bin/chown

ECHO=/bin/echo

SLEEP=/bin/sleep

EXPRN=/usr/bin/expr

CUT=/usr/bin/cut

CAT=/bin/cat

GREP=/bin/grep

 

ohasd所需的环境变量和命令被定义

........................................................................

### Main ###

# Retrieve name of the platform

PLATFORM=`/bin/uname`

MY_HOST=`tolower_host`

 

# Default path for SCR control files.

AUTORUNFILE=/etc/oracle/scls_scr/$MY_HOST/root/ohasdrun

 

LOGMSG="/bin/logger -puser.err"

LOGERR="/bin/logger -puser.alert"

 

case $PLATFORM in

Linux) LOGGER="/usr/bin/logger"

       if [ ! -f "$LOGGER" ];then

       LOGGER="/bin/logger"

       fi

       LOGMSG="$LOGGER -puser.err"

       LOGERR="$LOGGER -puser.alert"

       CUT="/bin/cut"

       ;;

HP-UX)

       NAMEDPIPE=/tmp/.oracle/npohasd

       ;;

AIX)

       NAMEDPIPE=/tmp/.oracle/npohasd

       ;;

SunOS)

.....................................................................................

# enable HA by default on most unix platforms

case $PLATFORM in

  Linux)

    GIPCD_PASSTHROUGH=false

    export GIPCD_PASSTHROUGH

    ;;

  HP-UX)

    GIPCD_PASSTHROUGH=false

    export GIPCD_PASSTHROUGH

    ;;

  SunOS)

    GIPCD_PASSTHROUGH=false

    export GIPCD_PASSTHROUGH

根据不同的平台设置对应的环境变量

................................................................................

case $1 in

 

'run')

................................................................................

Esac

可以看到输入的参数只有唯一值是run,它用于启动ohasd.bin守护进程。

 

小结

根据10g和11gR2版本的集群管理软件的启动脚本之间的不同,能看到从11gR2版本开始,GI启动脚本变成了只有一个,而且脚本的长度也大大地减少,10g版本存在的问题得到了解决。换句话说,ohasd bin成为了集群启动的根(root)守护进程。下面是一个查看 ohasd.bin守护进程的ps命令:

[root@RAC1 ~]# vi  /u01/app/11.2.0/grid/crs/init/init.ohasd

[root@RAC1 ~]# ps -ef | grep has

root      1079     1  0 08:55 ?        00:00:00 /bin/sh /etc/init.d/init.ohasd run

root      1878     1  0 08:56 ?        00:00:10 /u01/app/11.2.0/grid/bin/ohasd.bin reboot

猜你喜欢

转载自blog.csdn.net/qq_34556414/article/details/83537002
今日推荐