Call now: (800) 766-1884  



 Home


 SQL Server Tips
 SQL Server Training

 SQL Server Consulting
 SQL Server Support
 SQL Server Remote DBA



 Articles
 Services
 SQL Server Scripts
 Scripts Menu



 

 

 

   
  SQL Server Tips by Robin Schumacher

Examining Session Waits

Unfortunately, the SQL Server does not have as robust a session wait interface as SQL Server does; however, there are a few diagnostic metrics that can be utilized to get a feel for session wait activity. The master.dbo.sysprocesses table contains a row for every session connected to SQL Server. If a session is waiting for any reason, SQL Server will record the wait type and wait time in two of the columns in master.dbo.sysprocesses. While this helps diagnose an in-process wait, the drawback to this implementation is that when another wait for the session occurs, the wait information is overwritten, so in reality, there is no history from which to work.

The sesswait.sql query below will help the DBA get a handle on current session wait activity and will bubble to the top the processes with the highest percentage of overall wait time.

* sesswait.sql

-- Script is available in the Online Code Depot

In SQL Server 2005, the sys.dm_os_waiting_tasks dynamic management view can be utilized to get much of the same data; although as of this writing, it does not offer a set of information that is as complete.


The above book excerpt is from:

High-Performance SQL Server DBA
Tuning & Optimization Secrets

ISBN: 0-9761573-6-5
Robin Schumacher

 http://www.rampant-books.com/book_2005_2_sql_server_dba.htm  

 

Burleson Consulting Remote DB Administration


 

 


 

 

 

 

 
Burleson is the America's Team

Note: The pages on this site were created as a support and training reference for use by our staff of DBA consultants.  If you find it confusing, please exit this page.

Errata?  SQL Server technology is changing and we strive to update our SQL Server support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:and include the URL for the page.
 


Burleson Consulting
SQL Server database support

 

Copyright 1996 -  2013 by Vaaltech Web Services. All rights reserved.

Hit Counter