is there any way to set alert my sql sever service has stopped

  • please advice

  • You would need something to be running outside of the SQL instance, for example a powershell or WMI script which checks the service at regular intervals and emails you if its in a stopped state.

    You could also purchase monitoring software like SQL Monitor, Spotlight, Diagnostic Manager which will do the job also.

  • configure below mentions in a bat file and regularly run it through task scheduler of windows to check , this will check if services is stopped and if stopped will start it .

    for /F "tokens=3 delims=: " %%H in ('sc query MSSQLSERVER^| findstr " ESTADO"') do (

    if /I "%%H" NEQ "RUNNING" (

    REM Put your code you want to execute here

    REM For example, the following line

    net start MSSQLSERVER

    )

    )

  • Another way is to use Linked Servers, set up 2 servers, one is sql monitor which has linked server to all other server and another one is to monitor the monitor.

    Set up job to run say every 15 minutes, just try to query each servers (dynamic sql) in master databases and if found the problem log it in temp table for email to DBA.

    It work fine for big number of servers, max I use to see and help support the system is 312 servers.

    All answers above are correct depend on your situation.

    JJ

  • Use a monitoring software like MOM/SCOM/SQLSentry....

    Cheers

Viewing 5 posts - 1 through 4 (of 4 total)

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