RAC安装时需要执行4个脚本
1) $Oracle_BASE/oraInventory/orainstRoot.sh (clusterware 结束时执行)
2) $CRS_HOME/root.sh (clusterware 结束时执行)
3) $CRS_HOME/bin/vipca.sh(该脚本是在第二个节点执行$CRS_HOME/root.sh时被自动调用)
4) $ORACLE_HOME/root.sh (安装完数据库以后执行)
Changing permissions of /oracle/oraInventory to 770.
Changing groupname of /oracle/oraInventory to oinstall.
The execution of the script is complete
#!/bin/sh
if [ ! -d "/var/opt/oracle" ]; then
mkdir -p /var/opt/oracle;
fi
if [ -d "/var/opt/oracle" ]; then
chmod 755 /var/opt/oracle;
fi
if [ -f "/oracle/oraInventory/oraInst.loc" ]; then
cp /oracle/oraInventory/oraInst.loc /var/opt/oracle/oraInst.loc;
chmod 644 /var/opt/oracle/oraInst.loc;
else
INVPTR=/var/opt/oracle/oraInst.loc
INVLOC=/oracle/oraInventory
GRP=oinstall
PTRDIR="`dirname $INVPTR`";
# Create the software inventory location pointer file
if [ ! -d "$PTRDIR" ]; then
mkdir -p $PTRDIR;
fi
echo "Creating the Oracle inventory pointer file ($INVPTR)";
echo inventory_loc=$INVLOC > $INVPTR
echo inst_group=$GRP >> $INVPTR
chmod 644 $INVPTR
# Create the inventory directory if it doesn't exist
if [ ! -d "$INVLOC" ];then
echo "Creating the Oracle inventory directory ($INVLOC)";
mkdir -p $INVLOC;
fi
fi
echo "Changing permissions of /oracle/oraInventory to 770.";
chmod -R 770 /oracle/oraInventory;
if [ $? != 0 ]; then
echo "OUI-35086:WARNING: chmod of /oracle/oraInventory to 770 failed!";
fi
echo "Changing groupname of /oracle/oraInventory to oinstall.";
chgrp oinstall /oracle/oraInventory;
if [ $? != 0 ]; then
echo "OUI-10057:WARNING: chgrp of /oracle/oraInventory to oinstall failed!";
fi
echo "The execution of the script is complete"
从脚本我们可以看出,这个脚本主要是创建/var/opt/oracle目录(如果不存在的话),再在该目录下建oraInst.loc文件(该文件记录orainventory的位置和组)。并改变orainventory的属性。
total 2
-rw-r--r-- 1 root root 55 Apr 2 14:42 oraInst.loc
inventory_loc=/oracle/oraInventory
inst_group=oinstall
Changing permissions of /oracle/oraInventory to 770.
Changing groupname of /oracle/oraInventory to oinstall.
The execution of the script is complete
WARNING: directory '/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
Checking to see if any 9i GSD is up
Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/oracle' is not owned by root
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 0: node2 node2-priv node2
node 1: node1 node1-priv node1
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /oracle/ocrcfg1
Format of 1 voting devices complete.
Startup will be queued to init within 30 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
node2
CSS is inactive on these nodes.
node1
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.
从输出我们可以看出,该脚本主要执行crs的配置,格式化ocr disk,更新/etc/inittab文件,启动css进程,在/var/opt/oracle/新建了ocr.loc文件及,scls_scr,oprocd文件夹。
oracle 18212 18211 0 14:47:28 ? 0:00 /oracle/crs/bin/ocssd.bin
oracle 18191 18180 0 14:47:28 ? 0:00 /oracle/crs/bin/oclsmon.bin
oracle 17886 1 0 14:47:27 ? 0:00 /oracle/crs/bin/evmd.bin
oracle 18180 18092 0 14:47:28 ? 0:00 /bin/sh -c cd /oracle/crs/log/node2/cssd/oclsmon; ulimit -c unlimited; /ora
root 17889 1 0 14:47:27 ? 0:00 /oracle/crs/bin/crsd.bin reboot
oracle 18211 18093 0 14:47:28 ? 0:00 /bin/sh -c ulimit -c unlimited; cd /oracle/crs/log/node2/cssd; /oracle/crs
total 8
-rw-r--r-- 1 root root 55 Apr 2 14:42 oraInst.loc
drwxrwxr-x 5 root root 512 Apr 2 14:47 oprocd
drwxr-xr-x 3 root root 512 Apr 2 14:47 scls_scr
-rw-r--r-- 1 root oinstall 48 Apr 2 14:47 ocr.loc
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# The /etc/inittab file controls the configuration of init(1M); for more
# information refer to init(1M) and inittab(4). It is no longer
# necessary to edit inittab(4) directly; administrators should use the
# Solaris Service Management Facility (SMF) to define services instead.
# Refer to smf(5) and the System Administration Guide for more
# information on SMF.
#
# For modifying parameters passed to ttymon, use svccfg(1m) to modify
# the SMF repository. For example:
#
# # svccfg
# svc:> select system/console-login
# svc:/system/console-login> setprop ttymon/terminal_type = "xterm"
# svc:/system/console-login> exit
#
#ident "@(#)inittab 1.41 04/12/14 SMI"
ap::sysinit:/sbin/autopush -f /etc/iu.ap
sp::sysinit:/sbin/soconfig -f /etc/sock2path
smf::sysinit:/lib/svc/bin/svc.startd >/dev/msglog 2/dev/msglog /dev/msglog 2/dev/msglog
h1:3:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 /dev/null 2>&1 /dev/null 2>&1