Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: starting the database
This is the most elegant one I've seen. You don't need a real oracle
username/password. This has the added benefit of checking the listener. As
stated by everyone else, don't have something automatically start the
database. I don't even do it on a server reboot. Databases crash for a
reason. This reason needs to be investigated. Just have the mailx go to a
pager.
Mike
export
PATH="/bin:/usr/bin:/usr/ucb:/etc:/usr:/usr/css/bin:/usr/ccs/lib:/usr/privat e/etc:/usr/private/etc/raddb:/usr/sbin:/opt/bin:/u01/app/oracle/product/9.2/ bin:/opt/perl5/lib/5.00503:/opt/expect/expect/expect-RUN/opt/expect/lib:/opt
MAILLIST="yourmaillisthere_at_mail.com"
if [ "$1" ]
then DBNAME=$1
else echo "\nOracle SID has not been entered."
exit 16
fi
sqlplus -silent << EOF > /tmp/$$.1
whenever sqlerror exit
a/a@${DBNAME}
exit;
EOF
egrep 'ORA-121|ORA-01034' /tmp/$$.1 > /dev/null
if [[ $? = 0 ]]
then
mailx -s " ${DBNAME} is not accessible - db is down" ${MAILLIST} <
/tmp/$$.1
else
grep 'ORA-01017' /tmp/$$.1 > /dev/null
if [[ $? = 0 ]]
then
exit 16
else
mailx -s " ${DBNAME} is not accessible - db is down" ${MAILLIST} <
/tmp/$$.1
fi
fi
rm /tmp/$$.1
exit
-- http://www.freelists.org/webpage/oracle-lReceived on Mon May 01 2006 - 11:06:23 CDT
![]() |
![]() |