SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 monitoring DB
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

saps
Starting Member

2 Posts

Posted - 02/01/2013 :  03:03:52  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 02/01/2013 :  03:37:15  Show Profile  Reply with Quote
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 - 02/01/2013 :  03:51:48  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 02/01/2013 :  04:20:37  Show Profile  Reply with Quote
try this

xp_servicecontrol 'querystate', 'MSSQLSERVER'
go

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

Go to Top of Page

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2047 Posts

Posted - 02/01/2013 :  13:10:58  Show Profile  Visit jackv's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000