detecting that a SQL db is running

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bill ramsay

    #1

    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

  • triode@xnet.co.nz

    #2
    Re: detecting that a SQL db is running

    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

    Comment

    • bill ramsay

      #3
      Re: detecting that a SQL db is running

      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

      Comment

      • Paul McNett

        #4
        Re: detecting that a SQL db is running

        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(s ocket.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


        Comment

        • bill ramsay

          #5
          Re: detecting that a SQL db is running

          thank you paul, much appreciated

          Comment

          • bill ramsay

            #6
            Re: detecting that a SQL db is running

            On Sat, 02 Dec 2006 07:39:51 GMT, Dennis Lee Bieber
            <wlfraed@ix.net com.comwrote:
            >On Sat, 02 Dec 2006 09:02:43 +1300, bill ramsay <blah@blahdebla h>
            >declaimed the following in comp.lang.pytho n:
            >
            >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

            Comment

            Working...