Blocking statistics


Job details

Name: Blocking statistics
Platform: Sqlserver
Category: Performance
Description: Checks whether there exists any blocked sessions.
Long description:
Version: 1.9
Default schedule: 0,5,10,15,20,25,30,35,40,45,50,55 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2000′ & hasengine=‘YES’ & (engine_edition = ‘Microsoft SQL Server’ engine_edition = ‘Azure SQL Managed Instance’)]

Parameters

Name Default value Description
warning threshold 5 The maximum number of minutes a session can be blocked before a warning is triggered.
alarm threshold 30 The maximum number of minutes a session can be blocked before an alarm is triggered.

Job Summary

Purpose

Importance

Manual Checking

SELECT * FROM master.dbo.sysprocesses WHERE blocked != 0;

Implementation Details

Table Name Description
dbw_blocked_tab Temporary storage for current blocked sessions
dbw_blocked_histr_tab History storage for blocked sessions
dbw_blocking_tab Temporary storage for sessions that are causing the blocking
dbw_blocking_histr_tab History storage for sessions that have caused blocking

Procedures Used

Dependencies and Maintenance

Upgrade Notes

Reporting Features

Example Report Query for Blocked Sessions:

SELECT t1.spid as "Session ID", t1.blocked as "Blocked by", t2.name as "Database", t1.waittime as "Wait Time" FROM master.dbo.sysprocesses t1 JOIN master.dbo.sysdatabases t2 ON t1.dbid = t2.dbid WHERE t1.blocked != 0 ORDER BY t1.waittime DESC;

Scheduling

Acknowledgements