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: db up script

RE: db up script

From: <CHUCK_HAMILTON_at_qvc.com>
Date: Fri, 12 May 2000 09:49:01 -0400
Message-Id: <10495.105503@fatcity.com>


Try this shell script. It returns 0 if it connects to a database succesfully, 1 if not. Testing if you cann connect may be better than testing for the pmon or smon processes because a database may be up but inaccessible if the listener is down, or if the archive log directory is full.

#!/bin/ksh
# Tests to see if you can connect to a database or not
# Argument 1: connect string

sqlplus -s /nolog <<! > /dev/null
whenever sqlerror exit failure
connect $1
select name from v\$database;
!
--
Chuck Hamilton
QVC Inc.
Enterprise Technical Services
Oracle DBA



> ----------
> From: Lisa_Koivu_at_gelco.com[SMTP:Lisa_Koivu_at_gelco.com]
> Reply To: ORACLE-L_at_fatcity.com
> Sent: Thursday, May 11, 2000 08:28
> To: Multiple recipients of list ORACLE-L
> Subject: db up script
>
> Hello -
>
> Does anyone have a script that checks if a series of databases are up and
> available that they would be willing to share? I set out to write a ksh
> script
> to do this and found that I would have to write C to do what I needed to
> do,
> since trying to connect to a hung or down instance will result in a hung
> process. There wasn't an easy way to fire off the connect process,
sleep,
> and
> kill it if it hadn't come back yet. I really don't want to spend my day
> writing
> C code, it will exacerbate the headache my job gave me today.
>
> Any suggestions / script snippets are appreciated
> Thanks
> Lisa
>
>
>
> --
> Author:
> INET: Lisa_Koivu_at_gelco.com
>
> 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).
>
Visit us at http://www.clearstream.com IMPORTANT MESSAGE Internet communications are not secure and therefore Clearstream International does not accept legal responsibility for the contents of this message. The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Any views expressed in this e-mail are those of the individual sender, except where the sender specifically states them to be the views of Clearstream International or of any of its affiliates or subsidiaries. END OF DISCLAIMER -- Author: INET: DDORR_at_cedelglobalservices.com 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
Received on Fri May 12 2000 - 08:49:01 CDT

Original text of this message

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