VERSION=undef
if[ -f $ORACLE_HOME/bin/sqldba ] ; then
SQLDBA=sqldba
VERSION=`$ORACLE_HOME/bin/sqldba command=exit | awk '
/SQL\*DBA: (Release|Version)/ {split($3, V, ".") ;
print V[1]}'`
case $VERSION in
"6") ;;
*) VERSION="internal" ;;
esac
else
if [ -f $ORACLE_HOME/bin/svrmgrl ] ; then
SQLDBA=svrmgrl
VERSION="internal"
else
SQLDBA="sqlplus /nolog"
fi
fi
STATUS=1
if[ -f $ORACLE_HOME/dbs/sgadef${ORACLE_SID}.dbf ] ; then
STATUS="-1"
fi
if[ -f $ORACLE_HOME/dbs/sgadef${ORACLE_SID}.ora ] ; then
STATUS="-1"
fi
pmon=`ps -ef | grep -w "ora_pmon_$ORACLE_SID" | grep -v grep`
if[ "$pmon" != "" ] ; then
STATUS="-1"
$LOGMSG "Warning: ${INST} \"${ORACLE_SID}\" alreadystarted."
fi
if[ $STATUS -eq -1 ] ; then
$LOGMSG "Warning: ${INST} \"${ORACLE_SID}\" possibly leftrunning when system went down (system crash )."
$LOGMSG "Action: Notify Database Administrator."
case $VERSION in
"6") sqldba"command=shutdown abort" ;;
"internal") $SQLDBA$args <
shutdown abort
EOF
;;
*) $SQLDBA $args <
shutdown abort
quit
EOF
;;
esac
if [ $ -eq 0 ] ; then
STATUS=1
else
$LOGMSG "Error: ${INST} \"${ORACLE_SID}\" NOTstarted."
fi
fi
if[ $STATUS -eq 1 ] ; then
if [ -e $SPFILE -o -e $SPFILE1 -o -e $PFILE ] ; then
case $VERSION in
"6") sqldbacommand=startup ;;
"internal") $SQLDBA<
startup
EOF
;;
*) $SQLDBA <
startup
quit
EOF
;;
esac
if [ $ -eq 0 ] ; then
echo ""
echo "$0: ${INST}\"${ORACLE_SID}\" warm started."
else
$LOGMSG ""
$LOGMSG "Error: ${INST} \"${ORACLE_SID}\" NOTstarted."
fi
else
$LOGMSG ""
$LOGMSG "No init file found for ${INST}\"${ORACLE_SID}\"."
$LOGMSG "Error: ${INST} \"${ORACLE_SID}\" NOTstarted."
fi
fi
}
# Starts an ASM Instance
startasminst() {
#Called programs use same database ID
export ORACLE_SID
ORACLE_HOME=`echo $LINE | awk -F: '{print $2}' -`
#Called scripts use same home directory
export ORACLE_HOME
#For ASM instances, we have a dependency on the CSS service.
#Wait here for it to become available before instance startup.
#Is the 10g install intact Are all necessary binaries present
if[ ! -x $ORACLE_HOME/bin/crsctl ]; then
$LOGMSG "$ORACLE_HOME/bin/crsctl not found when attempting tostart"
$LOGMSG " ASM instance$ORACLE_SID."
else
COUNT=0
$ORACLE_HOME/bin/crsctl check css
RC=$
while [ "$RC" != "0" ];
do
COUNT=`expr $COUNT + 1`
if [ $COUNT = 15 ] ; then
# 15 tries with 20 sec interval => 5 minutes timeout
$LOGMSG "Timed out waiting to start ASM instance$ORACLE_SID"
$LOGMSG " CSS service is NOTavailable."
exit $COUNT
fi
$LOGMSG "Waiting for Oracle CSS service to be available beforestarting "
$LOGMSG " ASM instance $ORACLE_SID. Wait $COUNT."
sleep 20
$ORACLE_HOME/bin/crsctl check css
RC=$
done
fi
startinst
}
# Start of dbstartupscript
#
# Loop for every entry in oratab file andand try to start
# that ORACLE.
#
# ASM instances need to be started befor