Thor Logo dbatools

WaitStats

Clear-DbaWaitStatistics

Chrissy LeMaire (@cl)

Clear-DbaWaitStatistics View Source Chrissy LeMaire (@cl) Windows, Linux, macOS Synopsis Resets SQL Server wait statistics to establish a clean monitoring baseline Description Clears all accumulated wait statistics from sys.dm_os_wait_stats by executing DBCC SQLPERF (N’sys.dm_os_wait_stats’, CLEAR). This is essential for performance troubleshooting when you need to establish a new baseline for wait analysis. DBAs commonly clear wait stats after resolving performance issues, during maintenance windows, or when beginning focused monitoring periods to isolate specific workload patterns without historical noise.

Read more

Get-DbaWaitStatistic

Chrissy LeMaire (@cl), netnerds.net

Get-DbaWaitStatistic View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves SQL Server wait statistics for performance analysis and troubleshooting Description Analyzes SQL Server wait statistics from sys.dm_os_wait_stats to identify performance bottlenecks and resource contention issues. This function categorizes wait types, calculates timing metrics and percentages, and provides diagnostic explanations based on Paul Randal’s methodology. Use this to pinpoint whether your SQL Server is waiting on disk I/O, memory pressure, locking issues, or other resource constraints that are slowing down query performance.

Read more