Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 monitoring DB

Author  Topic 

saps
Starting Member

2 Posts

Posted - 2013-02-01 : 03:03:52
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)

NEW SQL DBA

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-01 : 03:37:15
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/

Go to Top of Page

saps
Starting Member

2 Posts

Posted - 2013-02-01 : 03:51:48
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/





NEW SQL DBA
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-01 : 04:20:37
try this

xp_servicecontrol 'querystate', 'MSSQLSERVER'
go

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2013-02-01 : 13:10:58
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'

--Restart the service

Restart-Service 'MSSQL$MyInst1'

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -