Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Oracle monitoring script ideas
Dennis
Here is what i used few years ago; Since this was a dev box the password was hardcoded but you can modify to use OS authentication or something like that
SQLDIR=/home/govindank/cronjobs/sync_source
export SQLDIR
MAILLIST="$1"
if test -z "$*"
then
tput smso
echo "Syntax: sync_caseown2java2003.sh e-mailid"
tput rmso
echo '.' | mailx -s 'FNGNEW:caseown2java2003 Syncing:Failed:No
MailId' $MAILLIST
exit
fi
#
reply=1 #Default is successful
export reply
echo sqlplus $owner/$pw@$tns @prepare_sync.out
sqlplus $owner/$pw@$tns @prepare_sync.out ||reply=0 #if Failure Turn Off
tput smso
if test $reply -eq 1
then
echo '.' | mailx -s 'FNGNEW:caseown2java2003 Syncing:Success' $MAILLIST
tput rmso
else
echo 'There was error while running <prepare_sync.out> script'
echo '.' | mailx -s 'FNGNEW:caseown2java2003 Syncing:Failed' $MAILLIST
tput rmso
exit
fi
#eof
For exitting upon error the statement is _whenever sqlerror exit failure rollback_ and put it at the beginning.
HTH
GovindanK
-- http://www.freelists.org/webpage/oracle-lReceived on Wed Aug 22 2007 - 13:54:58 CDT
![]() |
![]() |