30.06.2013 Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

137<br />

Chapter 4: Transactions<br />

some point (<strong>SQL</strong> 11 perhaps) Microsoft makes it easier to parse the information, or normalizes<br />

the information by adding columns to sys.dm_os_waiting_tasks.<br />

The value of the script really becomes evident when one encounters a multi-session<br />

blocking situation. Figure 4.5 shows how it can reveal a real-life blocking chain (one I<br />

encountered just today on one of my servers). I've omitted all security and identifier<br />

columns for my environment, but the remaining data is real.<br />

Figure 4.5: A real-life blocking chain.<br />

Session 65 was blocking Session 63 which, in turn, blocked Session 78, which blocked<br />

70, which blocked both 111 and 87. Session 87 blocked Session 89 which, in turn, blocked<br />

about ten other sessions. My DMO script revealed that Session 65 was the root cause of<br />

the blocking, and the command text returned for this session revealed that I could safely<br />

kill that session. Having done so, and by the time I switched query windows in SSMS to<br />

re-execute the DMO query, the results were clean. All blocking had been resolved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!