Check for database instance?
Posted in 1999
Topics: General Discussion
Using informix online 7, what is the best way to check within a script if a particular database instance is up and available? (some of the databases are only available via informix-net). * Note class: you have 2 minutes to answer the question, no cheating! Please and thanks :-) (in the meantime, I'll be looking through manuals -- but your real-world experience will still be appreciated). - Randy Galbraith Spammers please note: UCE/Spam is not welcome at my inbox.
For my unix/aix cron jobs I include the following in my scripts: ====================================================== # check if online is up if [ -n "`$INFORMIXDIR/bin/onstat - | grep -i on-line`" ] then : else mail $LOGNAME <<-!EOF! On-Line Engine is OFF-LINE - statistics could not be run !EOF! exit ======================================================
FProse wrote:
>
> For my unix/aix cron jobs I include the following in my scripts:
> ======================================================
>
> # check if online is up
> if [ -n "`$INFORMIXDIR/bin/onstat - | grep -i on-line`" ]
Does this work ?
All my online's (7.1x - 7.3x and the good old 5.x tbstat)
tells me "-- On-Line --".
The other way is to check the onstat/tbstat return-code.
tbstat returns 0, and the 7.x versions return 5.
Markus
> then
> :
> else
> mail $LOGNAME <<-!EOF!
> On-Line Engine is OFF-LINE - statistics could not be run
> !EOF!
> exit
>
> ======================================================
Markus
FProse wrote:
>
> For my unix/aix cron jobs I include the following in my scripts:
> ======================================================
>
> # check if online is up
> if [ -n "`$INFORMIXDIR/bin/onstat - | grep -i on-line`" ]
Does this work ?
All my online's (7.1x - 7.3x and the good old 5.x tbstat)
tells me "-- On-Line --".
The other way is to check the onstat/tbstat return-code.
tbstat returns 0, and the 7.x versions return 5.
Markus
> then
> :
> else
> mail $LOGNAME <<-!EOF!
> On-Line Engine is OFF-LINE - statistics could not be run
> !EOF!
> exit
>
> ======================================================
Markus
Markus Holzbauer wrote in message <36C416FD.E8384589@mch.siemens.de>...
>
>
>FProse wrote:
>>
>> For my unix/aix cron jobs I include the following in my scripts:
>> ======================================================
>>
>> # check if online is up
>> if [ -n "`$INFORMIXDIR/bin/onstat - | grep -i on-line`" ]
>
>Does this work ?
>All my online's (7.1x - 7.3x and the good old 5.x tbstat)
>tells me "-- On-Line --".
>The other way is to check the onstat/tbstat return-code.
>tbstat returns 0, and the 7.x versions return 5.
Hi Markus,
That's brilliant! Now why didn't I ever notice that!!! :-)
Richard