Pete Freitag Pete Freitag

SQL Server Transaction Log Space Usage

Published on August 31, 2007
By Pete Freitag

Need to find out the amount of free space in your transaction log file on Microsoft SQL Server? Run the following command:

DBCC SQLPERF ( LOGSPACE )

It will tell you the percentage of transaction log space used, and the size of the transaction log file, which you then use to calculate the amount of free space in the transaction log or the amount of space in use.

The Result of the DBCC SQLPERF (LOGSPACE) query is the following columns Database Name, Log Size (MB), Log Space Used, Status. If there is a lot of FREE space in the transaction log, and you the file is too big you can shrink the size of the transaction log by running:

DBCC SHRINKFILE ( DBFILENAME_Log )

SQL Server Transaction Log Space Usage was first published on August 31, 2007.

Discuss / Follow me on Twitter ↯

Post a Comment