Session SQL event collector


Job details

Name: Session SQL event collector
Platform: Sqlserver
Category: Performance
Premium package: SQL Performance package
Description: This job collects performance statistics from the dbWatchSessionStatsXE Extended Events session. It captures long-running SQL batches and RPC calls along with relevant session and database information. Complements the ‘SQL statistics’ job by adding visibility into who is executing what.
Long description: This job collects performance statistics from the dbWatchSessionStatsXE Extended Events session. It captures long-running SQL batches and RPC calls along with relevant session and database information.
Version: 1.52
Default schedule: 3,13,23,33,43,53 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2005′ & hasengine=‘YES’ & engine_edition = ‘Microsoft SQL Server’]

Parameters

Name Default value Description
history threshold 7 The number of days before the history record will be removed from the history table.
max duration time 200 Max Duration Time specifies the threshold for capturing SQL batches and RPC calls in the Extended Events session. Only queries with execution time equal to or exceeding this value (in milliseconds) are logged, allowing flexible adjustment of monitoring sensitivity.
path Specifies the full path where event data will be stored. The name of the file is “dbWatchSessionStatsXE”. This file will receive all captured events for later analysis.
max file size 20 Defines the maximum size (in MB) that a single event file can grow to before a new file is created or the rollover policy is applied (must be 11 MB or or higher).
max rollover files 10 Specifies the maximum number of event files to retain. When this limit is reached, the oldest file is deleted to make room for new data.
return status 1 Return status value (ALARM = 2, WARNING = 1, or OK = 0) when either the maximum size of the repository history table (parameter “repository max size”) is reached or the job execution time exceeds the defined threshold (parameter “max execution time”). This value indicates the current state and can be used to trigger alerts or monitor job health.)
repository max size 1000 Defines the maximum size (in MB) of the repository history table before a warning or alarm is triggered.
max execution time 60 Specifies the maximum allowed execution time (in seconds) for the job. If the job runs longer than this threshold, a warning or alert is triggered.
database filter Specifies the list of databases to which the Extended Events session should apply. The value can be provided as a comma-separated list of database names. Wildcards () are supported to match multiple databases by pattern (e.g., %Sales to include all databases with “Sales” in their name).

Job Summary

Key Details and Logic Implemented

Database Structures and Operations

Version and Upgrade Details

Parameters and Configurations

Dependencies and External Interactions

Reporting and Visualization