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

Home -> Community -> Usenet -> c.d.o.server -> Re: is instance up???

Re: is instance up???

From: <ennaadu_at_my-deja.com>
Date: Wed, 23 Jun 1999 18:08:16 GMT
Message-ID: <7kr7q6$e0d$1@nnrp1.deja.com>


In article <7kqu65$4tb$1_at_sloth.swcp.com>,   elufker_at_swcp.com (Ed Lufker) wrote:
> Hi All:
>
> Does anyone have a script for unix that will check to see if an
> instance is up. I need to run the script from a central location to
check
> many instances.
>
> thanks in advance for any help
> eddie lufker
>

My script goes like this..( for unix..)

cat > instances.lst << EOF
EOF
ORATAB=/var/opt/oracle/oratab
cat $ORATAB | while read LINE
do
  case $LINE in
  \#*) ;;
  *)

     if [ "`echo $LINE | awk -F: '{print $3}'`" = "Y" ] ; then
         echo $LINE | awk -F: '{print $1}'>> instances.lst
     fi
       ;;

   esac
done

for INSTANCE in `cat instances.lst`
do

        STATUS=`ps -fu oracle|grep -e ora_ -e $INSTANCE | grep -v grep `
        if [ $? != 0 ];
        then
           echo  "Oracle instance $INSTANCE is DOWN!!!"
           ;
        else
           echo  "Oracle instance $INSTANCE is UP and RUNNING!!!"
           ;
         fi

done

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Wed Jun 23 1999 - 13:08:16 CDT

Original text of this message

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