473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

detecting that a SQL db is running

Hi

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
started?

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

Bill

Nov 30 '06 #1
5 1138
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

bill

Nov 30 '06 #2
Dennis

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
it.

kind regards

bill
Dec 1 '06 #3
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 = "127.0.0.1"
port = 1433 ## replace with msde_port, if it differs

s = socket.socket(socket.AF_INET)
try:
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 ~ http://paulmcnett.com
Dec 1 '06 #4
thank you paul, much appreciated
Dec 1 '06 #5
On Sat, 02 Dec 2006 07:39:51 GMT, Dennis Lee Bieber
<wl*****@ix.netcom.comwrote:
>On Sat, 02 Dec 2006 09:02:43 +1300, bill ramsay <blah@blahdeblah>
declaimed the following in comp.lang.python:
>Dennis

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...

dennis

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
consequences.

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

Kind regards

Bill
Dec 2 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: RootShell | last post by:
Hello I need to have a way to check if the user as refreshed the current page. Is there any way in PHP to do this? Here's the full facts, I have a JavaScript running that is merely a 30...
2
by: Frank | last post by:
Hello, I'm a total newbie on Javascript, and with a lot of help and some copy and paste managed to get things running. On my site: http://home.wanadoo.nl/homepage I use a form from Bravenet....
7
by: Joecx | last post by:
Hi Does anyone have the code or maybe give me a start on how to detect if my program is already running if someone tries to run it again while it's already running? I know I could do this with a...
3
by: Sandeep Arya | last post by:
Thanks linuxfreak and sybren for positive comments My application will be running on Linux. How to send ICMP ECHO as broadcast packets. I do not know this. Please tell me how to? Sybren.....
2
by: Deano | last post by:
In my app I have lots of forms with data presented in various ways using all kinds of controls. Is there a simple way of detecting if the user has changed any data? I would like to do this so I...
7
by: fox | last post by:
Maybe this is not the best group to ask this question, but I don't know a better one. I'm looking for a *portable* program in C (I mean source code) to detect whether unaligned word access is:...
2
by: pmclinn | last post by:
I have a couple spyware bots I loaded on a test machine. While I was watching the spyware infect the system I noticed that it was launching a process but it was not listed in my task Managaer...
0
by: David Eales | last post by:
Hi All, I am having some difficulty when some application hang detection code, I have read the detecting hangs document on msdn but this only works for 1 monitored running app, what I would like...
8
by: dwelch91 | last post by:
I need to detect whether the operating system I am running on (not the Python version) is 64bit or 32bit. One requirement is that I need to include support for non-Intel/AMD architectures. The 2...
9
by: timor.super | last post by:
Hi group, I've written a client/server application, using the dotnet sockets. In my server, I have a thread waiting for messages with : ret = currSocket.Receive(buffer, 1024,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.