Version store space usage (tempdb)


Job details

Name: Version store space usage (tempdb)
Platform: Sqlserver
Category: Capacity
Description: Checks total space in tempdb used by version store records for each database.
Long description: Checks total space in tempdb used by version store records for each database.
Version: 1.1
Default schedule: 15,35,55 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2016′ & hasengine=‘YES’ & (engine_edition = ‘Microsoft SQL Server’ engine_edition = ‘Azure SQL Managed Instance’)]

Parameters

Name Default value Description
min histr interval 20 The minimum number of minutes before a new history record will be collected in the history table.
max histr 240 The number of hours the statistics will be kept in the history table.
alarm threshold 95 The maximum percentage of space usage allowed in the tempdb before an alarm is triggered.
warning threshold 80 The maximum percentage of space usage allowed in the tempdb before a warning is triggered.
enable warnings and alarms NO If set to “NO” (default), the alert will only collect statistics without returning status warning or alarm.
ignore databases List of databases (separated by comma) which will be ignored. You can use % (percent sign) to represent wild card characters.

Job Summary

SELECT DB_NAME(database_id) AS 'Database Name', reserved_page_count, round(reserved_space_kb/1024.,2) AS 'Space usage (MB)' FROM sys.dm_tran_version_store_space_usage ORDER BY 'Space usage (MB)' DESC

Detailed Execution Logic

Dependency Management

These dependencies are crucial for the execution and integrity check of the task.

Alerting Criteria

SQL Implementation Details

Report Outputs

This structured approach allows database administrators to efficiently track and manage tempdb space usage specifically occupied by version store, ensuring optimal performance and system stability.