 |
|
SQL Server Tips by Burleson |
Examining Session Waits
Unfortunately, the SQL Server does not have as robust a session wait
interface as Oracle 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 |