Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Oracle monitoring script ideas

Re: Oracle monitoring script ideas

From: GovindanK <gkatteri_at_gmail.com>
Date: Wed, 22 Aug 2007 11:54:58 -0700
Message-ID: <46CC8682.6060509@inbox.lv>


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-l
Received on Wed Aug 22 2007 - 13:54:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US