April 29, 2009 at 8:00 am
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
April 29, 2009 at 8:11 am
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
April 29, 2009 at 8:39 am
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
April 29, 2009 at 8:48 am
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
April 29, 2009 at 9:00 am
Can you mention here about that software 🙂
[font="Comic Sans MS"]+++BLADE+++[/font]:cool:
April 29, 2009 at 9:09 am
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.
April 29, 2009 at 9:58 am
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 😉
April 29, 2009 at 6:59 pm
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