What's the best, most-proven-by-time way of checking if a database server is
running, from a remote location, from SQL? In SQL Anywhere 9.
We've thought of batch files (.bat) that will call dbisqlg and output the
result to file, but I'm looking for a solution that will not leave the SQL
environment of a database event. Can remote servers (CREATE SERVER) be used
for this purpose?
Thanks in advance for any comments.
Pavel
Chris Keating
****************************************
Please only post to the newsgroup
SQL Anywhere Developer Community
http://www.sybase.com/developer/library/sql-anywhere-techcorner
SQL Anywhere Blog Center
http://www.sybase.com/sqlanyblogs
Maintenance releases and EBFs
http://downloads.sybase.com/swx/sdmain.stm
Use Case Express to report bugs
http://case-express.sybase.com
BEGIN
SELECT dummy_col INTO @dummy_col FROM proxy_DUMMY;
EXCEPTION WHEN OTHERS THEN
SET @connected_ok = 'N';
END;
BEGIN
IF @connected = 'N' THEN
ALTER SERVER S USING '...';
END IF;
EXCEPTION WHEN OTHERS THEN
...cannot connect!
END;
The first SELECT tests the remote server connection, which may be OK.
If the SELECT fails, the remote server may be gone, OR it may be up
and running again after the proxy connection was lost for a while. The
ALTER SERVER is an attempt to re-connect, and if that fails, it is
safe to assume the remote server is gone.
Breck
On 6 Oct 2008 10:41:15 -0700, "Pavel Karady"
<firstname.lastname@nospam_kogerusa.com> wrote:
--
Breck Carter http://sqlanywhere.blogspot.com/
RisingRoad SQL Anywhere and MobiLink Professional Services
breck....@risingroad.com
I will search up the NodeAddress method, however client and the server are
not running on the same machine, so we will probably aim for Breck's ALTER
SERVER reconnecting exception catching method.
Thanks guys, appreciated
Pavel
"Breck Carter [TeamSybase]" <NOSPAM__br...@gmail.com> wrote in
message news:o4mme4t1476j70001...@4ax.com...