SQL SERVER – 3 Different Usage of DBCC SQLPERF

DBCC SQLPERF can report log usage or reset cumulative wait and latch statistics. I separate reporting from resetting the baseline.

A glaze vessel and preserved sampling dishes sit beside a clean dish for a new sample.

DBCC SQLPERF(LOGSPACE);
-- Administrator reset examples; do not execute just to inspect statistics:
-- DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR);
-- DBCC SQLPERF('sys.dm_os_latch_stats', CLEAR);

LOGSPACE reports each visible database’s log size and percentage used. It does not report the free disk space on the volume or explain why log reuse is being held. For the current database, sys.dm_db_log_space_usage is another read-only source.

The two CLEAR commands reset cumulative instance statistics without restarting SQL Server. Save the existing sample and coordinate with other monitoring before using them, because they discard the accumulated baseline. A before/after snapshot over a defined interval often answers the question without resetting everyone’s counters.

Locks coordinate transactional access; latches protect internal structures for short periods. Wait and latch counters summarize observed waits, not a complete record of every event. The original wait-statistics series and latches-versus-locks explanation remain linked for the broader context.

Reference: DBCC SQLPERF.

Related reading

A counter reset is not a diagnosis, it is the start of a new measurement interval.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.


Discover more from SQL Authority with Pinal Dave

Subscribe to get the latest posts sent to your email.

SQL Lock, SQL Scripts, SQL Server, SQL Server DBCC, SQL Wait Stats
Previous Post
SQL Server – Configuration Manager Console Running Very Slow and Time Out
Next Post
SQL SERVER – Get Wait Stats Related to Specific Session ID With sys.dm_exec_session_wait_stats

Related Posts

2 Comments. Leave new

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.