DBCC SQLPERF 有三种用途:Provides transaction log space usage statistics for all databases. In SQL Server it can also be used to reset wait and latch statistics。
Syntax
DBCC SQLPERF ( [ LOGSPACE ] | [ "sys.dm_os_latch_stats" , CLEAR ] | [ "sys.dm_os_wait_stats" , CLEAR ] ) [WITH NO_INFOMSGS ]
Arguments
- LOGSPACE
-
Returns the current size of the transaction log and the percentage of log space used for each database. You can use this information to monitor the amount of space used in a transaction log. - "sys.dm_os_latch_stats" , CLEAR
-
Resets the latch statistics. For more information, see sys.dm_os_latch_stats (Transact-SQL). - "sys.dm_os_wait_stats" , CLEAR
-
Resets the wait statistics. For more information, see sys.dm_os_wait_stats (Transact-SQL).
当DBCC SQLPERF用于清空Wait和Latch的统计信息时,是实例级的清空,这将导致该实例上所有DB的Wait和Latch统计信息都被Reset。
Resets the wait statistics for the instance of SQL Server.
DBCC SQLPERF("sys.dm_os_wait_stats",CLEAR);
时间: 2025-01-06 05:23:37