When is Windows Service MSSQLSERVER in state running?

  • Hello,

    we are using a software that will connect to the database after start only once. If the database is not up and running the software failed. Because of that we put in a dependency between this software service and the SQL server service in the Windows Service Manager.

    But what is if the database use 5 minutes for recovery? Is the MSSQLSERVER service already in state "running" or is it waiting? How can i guarantee that also the database is connectable? Any experience?

    Thanks in advance

    Steffen

  • You can generally add a step to the code that attempts to connect to the database and, if it fails, it goes to a catch block and does whatever you need to handle the error.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Hi GSquared, thanks for you fast reply, but we bought this windows software only in a compiled version and can't add any code.

    Kind regards, Steffen

  • In that case, I think you're stuck with setting up the dependency and hoping they made it fault-tollerant enough to deal with it.

    I guess your best bet would be to contact the vendor about that.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Can you mention here about that software 🙂

    [font="Comic Sans MS"]+++BLADE+++[/font]:cool:

  • You could create a .NET service in Visual studio that deals with it.

    Set your dependent service to manual start

    Create new Service that starts automatic

    New service does something like this:

    Connect to SQL

    Check Database state

    IF ONLINE, Start dependant server (Issue "NET START ")

    IF not ONLINE or cannot connect, wait specified period and check again.

    Stop service when done.

  • I will do both, contact the vendor and check if we can write a small service that we insert in between these existing both.

    But apart from that, is there anybody who knows when the MSSQLSERVER service switch in the state "running"? Without any database? Or after opening master-database? Only for my know-how 😉

  • Check the creation date of tempdb database fot that.

    MJ

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply