Truncate transaction log


Job details

Name: Truncate transaction log
Platform: Sqlserver
Category: Capacity
Description: This procedure truncates the transaction log for the dbWatch database.
Long description: This procedure truncates the transaction log for the dbWatch database.
Version: 1.3
Default schedule: 10 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version = ‘2000′ & hasengine=‘YES’ & engine_edition = ‘Microsoft SQL Server’]

Parameters

Name Default value Description

Job Summary

SELECT name, filename, size * 8 / 1024 AS size FROM sysfiles;

Job Details

Description

The task named “Truncate transaction log” aims to manage the size of the transaction log by truncating it. Truncation is done when the log size exceeds a certain threshold, which helps in keeping the database healthy and preventing log files from using up too much disk space.

Implementation Logic

The procedure creates and uses several variables to ascertain the log’s size and perform truncation if necessary. Here is the summarized procedure:

Dependencies

The procedure depends on several system databases and tables:

All dependent objects are crucial for fetching the required information to perform and validate the truncation process.

Reporting & Monitoring

Report Template

A report template named “dbWatch transaction Log size” exists as part of this job to display the before and after states of the transaction log:

Default Schedule

Summary tables and charts are made available within the dbWatch Control Center interface allowing users to monitor and review the size changes in the transaction logs over time actively.