We are using SQLSERVER2008 and i have never touch this before, Now I am suppose to handle it and to start with I have to add the monitoring of this new_db monitoring checks to a monitoring tool with the help of batch scripts.
The DB resides on a Windows Box.
I am wondering how can I first 1. Test the connection to DB if it is up and running. 2. How many processes are running for SQL server (what shd be the minimum when no user is connected)
1. open SQL Server Management studio which is the client tool for connecting to db. Then click connect-> database engine and give name of server in format machinename\instancename. If its connects server is up and running. You can also check service status from SQL Server configuration manager and checking if sqlserver service is running
2. use below query for checking processes
sp_who2 'active'
run this and you would see currently active processes in the server
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
Thanks for the reply - Wondering if i can check the status through command line which will help me in integrating the same to batch.
quote:Originally posted by visakh16
1. open SQL Server Management studio which is the client tool for connecting to db. Then click connect-> database engine and give name of server in format machinename\instancename. If its connects server is up and running. You can also check service status from SQL Server configuration manager and checking if sqlserver service is running
2. use below query for checking processes
sp_who2 'active'
run this and you would see currently active processes in the server
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
You can also use Powershell , so to check the SQL Server service , it would be: --check the service status $svc = Get-Service ‘MSSQL$MyInst1’ $svc.status --You can also do things like Stop-Service 'MSSQL$MyInst1' Start-Service 'MSSQL$MyInst1'