Tuesday, March 27, 2012

Check periodically if SQL server is running

Hi,

I have my SQL server installed and running on a windows 2003 server. Sometimes, the server stops unexpectedly. I want to know if there is any mechanism to alert as and when the SQL server or SQL server agent goes down.

I guess everything is a windows service. Can we have a mechanism to test this service from a script and send an alert mail when the server goes down? How can this be done from a script?

Thanks in advance

-SudhakarIf you have two servers, you could have each server send periodic commands to the other to see if they are awake.
Or you could schedule a job to e-mail you at regular intervals and when you don't get a notification you'd know something was wrong.

...or you could fix the f'ing server...|||set the services to autostart and you can use sp_procoption to send you an email everytime sql server restarts.

you ought to figure out why your server is stalling out though.|||You can also use EXECUTE xp_servicecontrol 'QueryState', 'SQLSERVERAGENT'|||I think you should kick the server, that would fix it

No comments:

Post a Comment