Thor Logo dbatools

LogFile

Expand-DbaDbLogFile

Claudio Silva (@ClaudioESSilva)

Expand-DbaDbLogFile View Source Claudio Silva (@ClaudioESSilva) Windows, Linux, macOS Synopsis Grows transaction log files using calculated increment sizes to prevent excessive Virtual Log File (VLF) fragmentation. Description This function intelligently grows transaction log files to target sizes while minimizing Virtual Log File (VLF) fragmentation. It calculates optimal increment sizes based on your SQL Server version and target log size, then grows the log in controlled chunks instead of letting autogrowth create excessive VLFs.

Read more

Get-DbaDbVirtualLogFile

Chrissy LeMaire (@cl), netnerds.net

Get-DbaDbVirtualLogFile View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves detailed virtual log file (VLF) metadata from transaction logs for performance analysis and troubleshooting. Description This function uses DBCC LOGINFO to return detailed metadata about each virtual log file (VLF) within database transaction logs. The output includes VLF size, file offsets, sequence numbers, status, and parity information that’s essential for analyzing transaction log structure and performance. Having a transaction log file with too many virtual log files (VLFs) can hurt database performance.

Read more

Measure-DbaDbVirtualLogFile

Chrissy LeMaire (@cl), netnerds.net

Measure-DbaDbVirtualLogFile View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Measures Virtual Log File (VLF) counts in transaction logs to identify performance bottlenecks Description Analyzes Virtual Log File (VLF) fragmentation across databases by counting total, active, and inactive VLFs in transaction logs. This function helps identify databases with excessive VLF counts that can severely impact performance. High VLF counts (typically over 50-100) cause transaction log backups to slow down, extend database recovery times, and in extreme cases can affect insert/update/delete operations.

Read more

Read-DbaTransactionLog

Stuart Moore (@napalmgram), stuart-moore.com

Read-DbaTransactionLog View Source Stuart Moore (@napalmgram), stuart-moore.com Windows, Linux, macOS Synopsis Retrieves raw transaction log records from a database using fn_dblog for forensic analysis and troubleshooting Description Uses SQL Server’s built-in fn_dblog function to extract raw transaction log records from a live database, returning detailed information about every transaction in the format used by the SQL Server logging subsystem. This gives you access to the same low-level data that SQL Server uses internally to track database changes.

Read more