Thursday, May 5, 2011

Monitor, Start, Stop SQL server services in query analyzer.


Monitor Sql Server Services:

exec xp_servicecontrol 'querystate','mssqlserver'

exec xp_servicecontrol 'querystate','sqlserveragent'

exec xp_servicecontrol 'querystate','sqlbrowser'

exec xp_servicecontrol 'querystate','msdtc'

exec xp_servicecontrol 'querystate','MSSQLserverOLAPservice'

exec xp_servicecontrol 'querystate','Reportserver'

--Output :
Current Service State
------------------------------------------------------------------------------------------------------------------------------------
Running.

(1 row(s) affected)

For non sql services:

exec xp_servicecontrol ‘querystate’,'DHCPServer'


Start and Stop Sql services:

exec xp_servicecontrol ‘START’,'mssqlserver'

exec xp_servicecontrol 'STOP','sqlserveragent'


Hope above query will be useful to check sql server services state without service console help.

No comments:

Post a Comment

MYSQL::Setting Validate_Password componet for MySQL Database to ensure password policy settings

Inadequate Password Settings for MySQL Database We observed that the `validate_password%` settings on hostname `<insert hostname>` a...