Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SGADEF no longer supported in Oracle 8.1.5 .. need to find how to detect a db is open from a script !
you can do something like
count=`ps -ef |grep _<SID> |wc -l`
This will give the count of background processes.
So if the count is less than 7 (?) then we can say that the instance
did not startup.
Regards
Anil
In article <879452$a2b$1_at_kermit.esat.net>,
"Dominic Cribbin" <dominic.cribbin_at_cognotecSTOPSPAM.com> wrote:
> Hi,
>
> I am currently migrating a script that we used to take cold backups
of an
> Oracle DB on a Unix Sun Solaris machine. We are currently using
Oracle8i
> 8.1.5, my problem is that "sgadef" is no longer supported in the
version of
> Oracle. Can anyone advise my on what the equivalent or similar
variable is
> in Oracle 8.1.5 .... or what setting tells the script that the
database is
> currently open.
>
> Any advice would be great. Thanks.
>
> D.
>
> P.S - a sample of the code we used is as follows:
>
> #
> # Now check that the database is actualy up and running
> #
> if [ ! -f $ORACLE_HOME/dbs/sgadef$ORACLE_SID.dbf ]
> then
> echo "Oracle instance "$ORACLE_SID" did not appear to start"
> >>$LOGFILES/coldbackup.log
> #
> # SNMP ALERT for failure of database retstart
> #
> /usr/sbin/snmp_trapsend -h $HOST -c $COMMUNITY -e $ENTERPRISE -s
$TRAP -a
> "$OBJECT STRING (DATABASE RESTART FAILED)"
> #
> # End SNMP alert
> #
> exit
> fi
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Feb 02 2000 - 14:30:23 CST