June 4, 2009 at 4:30 am
Hello
I need to clear DMV stats without restarting the SQL service. Is there a way to do this?
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Do not reinvent the wheel.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
June 4, 2009 at 5:22 am
Other than for the sys.dm_os_wait_stats and sys.dm_os_latch_stats, there's no way.
Edit: added the other DMV that can be cleared
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 4, 2009 at 5:29 am
DBCC SQLPERF("dmvname",CLEAR)
eg: DBCC SQLPERF("sys.dm_os_latch_stats" , CLEAR)
June 4, 2009 at 5:31 am
So the only way is to restart the SQL service.
Thanks for the quick reply
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Do not reinvent the wheel.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
June 4, 2009 at 5:35 am
Thanks that is a great help
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Do not reinvent the wheel.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
June 4, 2009 at 6:04 am
joeroshan (6/4/2009)
DBCC SQLPERF("dmvname",CLEAR)
That only works for 2 DMVs - sys.dm_os_latch_stats and sys.dm_os_wait_stats. No other DMV can be cleared using that.
eg
DBCC SQLPERF("dm_io_virtual_file_stats" , CLEAR)
Msg 2526, Level 16, State 12, Line 1
Incorrect DBCC statement. Check the documentation for the correct DBCC syntax and options.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 8, 2009 at 6:28 am
That only works for 2 DMVs - sys.dm_os_latch_stats and sys.dm_os_wait_stats. No other DMV can be cleared using that.
Yes. I thought that was obvious from Gail's previous post. I just meant to give the syntax. Sorry if my post was misleading
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply