By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,222 Members | 2,416 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,222 IT Pros & Developers. It's quick & easy.

detecting that a SQL db is running

P: n/a

I wonder if anyone can help me with a problem that I have with MSDE
SQL db. [I am changing to SQL server soon].

I have an app that runs on a server that communicates with remote
devices using email, this and other similar servers then sends
XML/SOAP messages to a master application.

I am in the process of intercepting these XML messages and forwarding
them on to a service managment platform for notification alerts etc.
This app reads a SQL db to get some additional information which is
also included in the XML message.

the problem is that the app on the comms server is an aggregate of
modules, that has a tendency to lock up, the server still runs, but
it causes the SQL server to stop. This is being worked on by the
developers, i expect that it will take some time to resolve.

using ASR we just reboot the server when this happens.

Using simple SQL statements, i am able to detect when SQL is up and
running, and to detect when it has stopped.

Is there a simple way to detect if the SQL server has actually

i had a look at investigating the registry, but to be honest, from
the various recipes that i have seen, i haven't a clue what I am
looking at,

any advice?

any information shall be gratefully received

kind regards


Nov 30 '06 #1
Share this Question
Share on Google+
5 Replies

P: n/a
Sorry if i did not make myself clear. let me try again.

1. I have a series of servers running windows server 2003.
2 on each server there is an application running that communicates
with remote devices using email.
3. this application is made up from a series of modules that also
extract data from a local MSDE db.
4. this application pulls emails from remote devices, interrogates a
the DB, then passes on an XML message to a central server.
5. I am intercepting these XML messages to insert additional data
that I extract from the DB, and then forward on to another
application. Call this my local app.

The problem that I have is that the original application occasionally
hangs, causing the DB to stop. I have ASR routines in place to
re-boot the server when this happens.

I can detect when the db is up and not responding, however, if the DB
does not start at all, my local application hangs. I need to find a
way to determine if the DB has started, that's all.

if any of you have any insight into how I can detect that the DB has
started as is running, that would be very useful.

any contributions, most gratefully received.

kind regards


Nov 30 '06 #2

P: n/a

none of this matters, all i am trying to find out is whether or not
the local MSDE is actually running.

I put all the other bits in there to try and put some background to

kind regards

Dec 1 '06 #3

P: n/a
bill ramsay wrote:
none of this matters, all i am trying to find out is whether or not
the local MSDE is actually running.
If it is a local MSDE then you may be able to rely on the connection
being refused if the server isn't running.

#-- begin
import socket

host = ""
port = 1433 ## replace with msde_port, if it differs

s = socket.socket(socket.AF_INET)
s.connect((host, port))
print "Server on %s is running" % port
except socket.error, e:
print "Server on %s appears to be down (%s)" % (port, e)

#-- end

Please note that this is untested and not very well thought through. But
try it and see if it gets you on the right track. If this isn't run
locally, you'll probably need to set the timeout low enough for the
connect call not to appear to hang before returning the timeout error.

pkm ~
Dec 1 '06 #4

P: n/a
thank you paul, much appreciated
Dec 1 '06 #5

P: n/a
On Sat, 02 Dec 2006 07:39:51 GMT, Dennis Lee Bieber
>On Sat, 02 Dec 2006 09:02:43 +1300, bill ramsay <blah@blahdeblah>
declaimed the following in comp.lang.python:

none of this matters, all i am trying to find out is whether or not
the local MSDE is actually running.
From my reading of your system, you have multiple "local MSDE"
server processes distributed about, and something on those distributed
systems that causes the initial problem... So I've never been clear of
just where any given application/server process actual resides...

However, all the tests I've been able to perform on my desktop
indicate that /I/ get time-outs or failure to connect messages within 15
seconds of a connection request when the server process is running.

I don't get unending lock-ups...


it doesn't matter what is causing the lockups, it's a problem with a
supposedly professionally written application package that I have no
control over. I am just at this moment trying to deal with the

I think that I haave found a way to deal with the issue that I have.

Kind regards

Dec 2 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.