Transact-SQL Reference

DBCC SQLPERF

Provides statistics about the use of transaction-log space in all databases.

Syntax

DBCC SQLPERF ( LOGSPACE )

Remarks

The transaction log accumulates information about changes to data in each database. The information returned by DBCC SQLPERF(LOGSPACE) can be used to monitor the amount of space used and indicates when to back up or truncate the transaction log.

Result Sets

This table describes the columns in the result set.

Column name Definition
Database Name Name of the database for the log statistics displayed.
Log Size (MB) The actual amount of space available for the log. This amount is smaller than the amount originally allocated for log space because Microsoft® SQL Server™ reserves a small amount of disk space for internal header information.
Log Space Used (%) Percentage of the log file currently occupied with transaction log information.
Status Status of the log file (always contains 0).

Permissions

DBCC SQLPERF permissions default to any user.

Examples

This example displays LOGSPACE information for all databases currently installed.

DBCC SQLPERF(LOGSPACE)
GO

Here is the result set:

Database Name Log Size (MB) Log Space Used (%) Status      
------------- ------------- ------------------ ----------- 
pubs                1.99219            4.26471           0 
msdb                3.99219            17.0132           0 
tempdb              1.99219            1.64216           0 
model                   1.0            12.7953           0 
master              3.99219            14.3469           0 

See Also

DBCC

sp_spaceused