RE: How to check if an informix server is Up
Posted in 2003
This is a multi-part message in MIME format.
------_=_NextPart_001_01C3A3C6.5E8673DB
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Manuel-
What we do is have a script that runs every few minutes. It
runs a 4gl that does nothing but check the health of another server.
What it does is update a table on the remote database with the current
time and attempts to read it back. We run it as a background process,
which we kill if the program locks up. If it succeeds, it stores a
value in the local database telling us that the connection is good. If
we killed it, we fire an sql script which stores a value telling us that
the connection is down. With this running constantly, we almost never
have locked up applications, because if the connection is down, we don't
try to use it. You may be able to do something similar.
=20
-EEM
=20
-----Original Message-----
From: Ortiz Manuel [mailto:mortiz@gtireecu.com]=20
Sent: Wednesday, November 05, 2003 8:35 AM
To: informix-list@iiug.org
Subject: How to check if an informix server is Up
=20
In a 4GL program I need to do an insert in three distinct servers:
=20
...
INSERT INTO db@olserver1.table VALUES (...)
INSERT INTO db@olserver2.table VALUES (...)
INSERT INTO db@olserver3.table VALUES (...)
.....
=20
When one of this servers is down, the 4GL program wait several minutes
before I got an error message.
=20
How I can check if the server is Up before to do the insert.
=20
It is possible to trap the error setting the timeout shorter.
=20
Thanks
=20
Manuel Ortiz
=20
:-)
=20
------_=_NextPart_001_01C3A3C6.5E8673DB
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{font-family:Arial;
color:windowtext;}
span.EmailStyle19
{font-family:Arial;
color:navy;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 85.05pt 70.85pt 85.05pt;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Manuel-</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> =
What we do is have a script
that runs every few minutes. It runs a 4gl that does nothing but =
check the
health of another server. What it does is update a table on the =
remote
database with the current time and attempts to read it back. We =
run it as a
background process, which we kill if the program locks up. If it =
succeeds, it
stores a value in the local database telling us that the connection is =
good. If
we killed it, we fire an sql script which stores a value telling us that =
the
connection is down. With this running constantly, we almost never =
have locked
up applications, because if the connection is down, we don’t try =
to use
it. You may be able to do something similar.</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> =
&=
nbsp; -EEM</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=3DMsoNormal style=3D'margin-left:35.4pt'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original =
Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b> Ortiz Manuel
[mailto:mortiz@gtireecu.com] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> </span></font><font =
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'>Wednesday,
November 05, 2003</span></font><font size=3D2 face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'> </span></font><font
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'>8:35 AM</span></font><font
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'><br>
<b><span style=3D'font-weight:bold'>To:</span></b> =
informix-list@iiug.org<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> How to check if =
an
informix server is Up</span></font></p>
<p class=3DMsoNormal style=3D'margin-left:35.4pt'><font size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'> </span></font></p>
<p class=3DMsoNormal style=3D'margin-left:35.4pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>In a 4GL program I need to =
do an
insert in three distinct servers:</span></font></p>
<p class=3DMsoNormal style=3D'margin-left:35.4pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> </span></font></p>
<p class=3DMsoNormal style=3D'margin-left:35.4pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>…</span></font></p>
<p class=3DMsoNormal style=3D'margin-left:35.4pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>INSERT INTO =
db@olserver1.table
VALUES (…)</span></font></p>
<p class=3DMsoNormal style=3D'margin-left:35.4pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>INSERT INTO =
db@olserver2.table
VALUES (…)</span></font></p>
<p class=3DMsoNormal style=3D'margin-left:35.4pt'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>INSERT INTO =
db@olserver3.table
VALUES (…)</span></font></p>
<p class=3DMsoNormal styl