# ASM instance is identified with '+'prefix in ORACLE_SID
# Following loop brings up ASM instance[s]
cat $ORATAB | while read LINE
do
case $LINE in
\#*) ;; #comment-line in oratab
*)
ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
if[ "$ORACLE_SID" = '*' ] ; then
#same as NULL SID - ignore this entry
ORACLE_SID=""
continue
fi
#Proceed only if last field is 'Y'.
if[ "`echo $LINE | awk -F: '{print $NF}' -`" = "Y" ] ; then
#If ASM instances
if [ `echo $ORACLE_SID | cut -b 1` = '+' ]; then
INST="ASM instance"
ORACLE_HOME=`echo $LINE | awk -F: '{print $2}' -`
# Called scripts use same home directory
export ORACLE_HOME
# file for logging script's output
LOG=$ORACLE_HOME/startup.log
touch $LOG
chmod a+r $LOG
echo "Processing $INST \"$ORACLE_SID\": log file$ORACLE_HOME/startup.log"
startasminst >> $LOG 2>&1
fi
fi
;;
esac
done
# exit if there was any trouble bringing upASM instance[s]
if [ "$ " != "0" ] ;then
exit 2
fi
#
# Following loop brings up 'Database instances'
#
cat $ORATAB | while read LINE
do
case $LINE in
\#*) ;; #comment-line in oratab
*)
ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
if[ "$ORACLE_SID" = '*' ] ; then
#same as NULL SID - ignore this entry
ORACLE_SID=""
continue
fi
#Proceed only if last field is 'Y'.
if[ "`echo $LINE | awk -F: '{print $NF}' -`" = "Y" ] ; then
#If non-ASM instances
if [ `echo $ORACLE_SID | cut -b 1` != '+' ]; then
ORACLE_HOME=`echo $LINE | awk -F: '{print $2}' -`
# Called scripts use same home directory
export ORACLE_HOME
# file for logging script's output
LOG=$ORACLE_HOME/startup.log
touch $LOG
chmod a+r $LOG
echo "Processing $INST \"$ORACLE_SID\": log file$ORACLE_HOME/startup.log"
startinst >> $LOG 2>&1
fi
fi
;;
esac
done
#
# Following loop brings up 'Databaseinstances' that have wait state 'W'
#
cat $ORATAB | while read LINE
do
case $LINE in
\#*) ;; #comment-line in oratab
*)
ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
if[ "$ORACLE_SID" = '*' ] ; then
#same as NULL SID - ignore this entry
ORACLE_SID=""
continue
fi
#Proceed only if last field is 'W'.
if[ "`echo $LINE | awk -F: '{print $NF}' -`" = "W" ] ; then
W_ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
#DB instances with 'W' (wait state) have a dependency on ASM instances via CRS.
#Wait here for 'all' ASM instances to become available.
cat $ORATAB | while read LINE
do
case $LINE in
\#*) ;; #comment-line in oratab
*)
ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
if [ "$ORACLE_SID" = '*' ] ; then
# same as NULL SID - ignore this entry
ORACLE_SID=""
continue
fi
if [ `echo $ORACLE_SID | cut -b 1` = '+' ]; then
INST="ASM instance"
ORACLE_HOME=`echo $LINE | awk -F: '{print $2}' -`
if [ -x $ORACLE_HOME/bin/sr vctl ] ; then
COUNT=0
NODE=`olsnodes -l`
RNODE=`srvctl status asm -n $NODE | grep "$ORACLE_SID isrunning"`
RC=$
while [ "$RC" != "0" ]; # wait until this comes up!
do
COUNT=$((COUNT+1))
if [ $COUNT