0

We have a SQL Server that is used internally for testing. We shut down the server every night to save on Azure costs. Sometimes it fails to startup due to the paths it uses not being available like the temporary D drive. When someone reports they cannot access the server I login and start the server up manually which works fine.

I have set SQL Server in Windows Services - Recovery tab to restart the server on first and second failure after 5 minutes, but this does not seem to work. Does this only kick in after it has started the first time and crashed?

I have also changed the startup type to Automatic (Delayed Start) which I am hoping will solve the issue.

But fundamentally this server is used primarily for the SQL Server and the solution I want is for Windows to attempt every 5 minutes to start the SQL Server if it has not managed to startup. Even better would be to email me if it fails after 30 minutes.

I could write something in PowerShell to achieve this, but I'm wondering is there something out of the box I could be doing?

3
  • View the properties of the service itself. You can set what happens after the first or second failure, and indicate how long between each attempt, Windows should wait before trying again. My answer would be a screenshot of the Recovery actions of a random service. I suggest a self-answer in a case like this.
    – Ramhound
    Sep 4, 2020 at 11:20
  • Ramhound I tried that but it is not attempting to restart the service, hence my question about whether that is just for crashes.
    – pholcroft
    Sep 4, 2020 at 13:15
  • It’s for anything that is preventing the service from starting. You will have to write a script to send an email.
    – Ramhound
    Sep 4, 2020 at 15:51

1 Answer 1

0

I did not tick the box "Enable actions for stops with errors" in Services. Once I ticked this it started working.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .