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: Checking if remote database is up -

Re: Checking if remote database is up -

From: Michael McMullen <ganstadba_at_hotmail.com>
Date: Tue, 26 Apr 2005 10:26:09 -0400
Message-ID: <BAY20-DAV11E0FCA3743DCC23104500A6210@phx.gbl>


I love that script. Neat and concise. You automatically get a listener check and last week it caught max sessions exceeded because of some wayward code.

Mike
----- Original Message -----
From: "Kirtikumar Deshpande" <kedeshpande_at_yahoo.com> To: <oracle-l_at_freelists.org>
Sent: Tuesday, April 26, 2005 10:00 AM
Subject: RE: Checking if remote database is up

> I have used following script for the past several years.. And has worked
well in our
> environment. The script attempts to connect to the remote database using a
non-existent
> user/pw, and deals with generated ORA errors...
>
> #!/usr/bin/ksh
> #
> # dbcheck : Script to check if database is up and accessible
> #
> # Author : Kirti Deshpande
> #
> #
>
> echo "Enter Name of the Database SID to check if it is accessible"
> read DB
>
> sqlplus -s << EOF > /tmp/$$.1
> whenever sqlerror exit
> aaa/aaa@$DB
> exit;
> EOF
> egrep 'ORA-121|ORA-01034' /tmp/$$.1 > /dev/null
> if [[ $? = 0 ]]
> then
> echo "-----> '$DB' is _NOT_ accessible\n"
> else
> grep 'ORA-01017' /tmp/$$.1 > /dev/null
> if [[ $? = 0 ]]
> then
> echo "-----> '$DB' is UP and Accessible\n"
> else
> echo "-----> '$DB' is _NOT_ accessible\n"
> fi
> fi
> #-- End of file
>
> Cheers!
>
> - Kirti

>

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Apr 26 2005 - 10:31:01 CDT

Original text of this message

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