Thursday 4 October 2012

How to reset stats in sys.dm_os_wait_stats view

One of main DMV's used in SQL Server for performance tuning is sys.dm_os_wait_statsthe view returns all the waits executed by a SQL server of the main problem with the this DMV is all the data are cumulative since the last time the statistics were reset or the server was started, so whenever you want to analyse a performance issue its good to reset the counter in the DMV to 0 before you want baseline the performance.
Run the below TSQL to reset the counters in sys.dm_os_wait_stats,
DBCC SQLPERF ('sys.dm_os_wait_stats', CLEAR);

No comments:

Post a Comment