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: Determining Oracle status

RE: Determining Oracle status

From: JOE TESTA <JTESTA_at_longaberger.com>
Date: Tue, 18 Sep 2001 12:28:16 -0700
Message-ID: <F001.00391DA9.20010918123518@fatcity.com>

tnsping does not check for database up, its nothing more than a ping to a listener, they only sure way to see if the database is up is to connect to it.
 
and its still that way in 9i.
 
joe
 
>>> Andreas.Haunschmidt_at_voest.co.at 09/18/01 02:40PM >>>Hi Barry!We use the Oracle supplied program tnsping as in the following shell script snippet

:---------------------------------------------------------#!/bin/shPATH=/bin:/usr/bin:/$ORACLE_HOME/binexport 
PATH# get SQL*NET alias from first argument or use ORCL as defaultoradb=${1:ORCL}if $ORACLE_HOME/bin/tnsping $oradb
>/dev/null 2>&1 then     echo "database $oradb
is up"else          echo
"database $oradb is down ( tnsping returned
$?)"fi---------------------------------------------------------Hope 
this helps,    Andreas> ----------> Von:
    Barry Deevey[SMTP:Barry.Deevey_at_sefas.co.uk]> Gesendet: 
    Dienstag, 18. September 2001 17:45> An: 
    Multiple recipients of list ORACLE-L> Betreff: 
    Determining Oracle status> > Hi all, > 
> I am trying to write a script in unix that determines if a specific oracle> instance is available. I'm trying to avoid using the 'ps' command, so I> thought the easiest method would be to connect via sqlplus - If it> connects> its up, if it doesn't then its unavailable. However, the problem is that> when it isn't up, the script hangs and does not return anything - I think> that this is because sqlplus by default gives you 3 attempts to logon, so> even though the logon attempt failed, it is waiting for you to try again,> so> unfortunately I'm not getting a failed return code. > If anybody could tell me how to change this so that it only allows 1 login> attempt before 'kicking you out' or whether there is a better method to> finding out the status of an instance, I would be extremely grateful to> hear> from you. > > TIA for any responses. > > Best Regards, > Barry. > > > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.com>
-- > Author: Barry Deevey>   INET:
Barry.Deevey_at_sefas.co.uk> > Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051> San Diego, California        -- Public
Internet access / Mailing Lists>
--------------------------------------------------------------------> To 
REMOVE yourself from this mailing list, send an E-Mail message> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in> the message BODY, include a line containing: UNSUB ORACLE-L> (or the name of mailing list you want to be removed from).  You may> also send the HELP command for other information (like subscribing).> -- Please see the official ORACLE-L FAQ: <A
href="http://www.orafaq.com">http://www.orafaq.com-- Author: Haunschmidt Andreas VASL/FAS  INET:
Andreas.Haunschmidt_at_voest.co.atFat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051San Diego, California        -- Public Internet access / Mailing
Lists--------------------------------------------------------------------To 
REMOVE yourself from this mailing list, send an E-Mail messageto: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and inthe message BODY, include a line containing: UNSUB ORACLE-L(or the name of mailing list you want to be removed from).  You mayalso send the HELP command for other information (like subscribing). Received on Tue Sep 18 2001 - 14:28:16 CDT

Original text of this message

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