April 8, 2010 at 11:34 am
Can you please let me know if we can reset the values in DMVs without restarting the instance.
M&M
April 8, 2010 at 11:37 am
There are two DMV's that can be reset without a restart of the instance.
sys.dm_os_latch_stats
sys.dm_os_wait_stats
Otherwise you will need to restart the instance.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
April 8, 2010 at 12:00 pm
Thanks Jason,
I am working on generating the Performance dashboard reports (PDR) on my server and we are looking for reseting the counters without restarting the instance.
Would clearing these counters
[ "sys.dm_os_latch_stats" , CLEAR ]
[ "sys.dm_os_wait_stats" , CLEAR ]
help on getting totally new reports from the PDR's.
I guess PDR's would be using a whole lot of other DMV's also right?
M&M
April 8, 2010 at 12:03 pm
mohammed moinudheen (4/8/2010)
Thanks Jason,I am working on generating the Performance dashboard reports (PDR) on my server and we are looking for reseting the counters without restarting the instance.
Would clearing these counters
[ "sys.dm_os_latch_stats" , CLEAR ]
[ "sys.dm_os_wait_stats" , CLEAR ]
help on getting totally new reports from the PDR's.
I guess PDR's would be using a whole lot of other DMV's also right?
Those reports should be querying numerous DMVs. The real reset for those counters and reports would only come after an Instance restart.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
April 8, 2010 at 12:07 pm
Thanks Jason, for your quick response 🙂
Really appreciate it.
M&M
April 8, 2010 at 12:12 pm
You are welcome.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
April 8, 2010 at 1:51 pm
but you can use
DBCC SQLPERF("sys.dm_os_wait_stats",CLEAR); for only those 2 DMV's. it should reset those counters.
But not for all the DMV's
June 11, 2010 at 9:59 am
I have a server used in performance testing and the test database is RESTORE'd before every test. Why does it appear that all of the DMV's have been reset if they can only be reset by restarting the instance?
Hopefully, someone is still watching this thread. 🙂
"Beliefs" get in the way of learning.
June 11, 2010 at 10:46 am
Some DMVs can only be reset by restarting the instance. Some are partially or fully cleared by restarting the database (offline/online, close/open, restore). Depends on the DMV.
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
August 25, 2015 at 4:31 pm
DBCC FreeProcCache
August 25, 2015 at 7:18 pm
joe.arias (8/25/2015)
DBCC FreeProcCache
While that works to clear the plan cache, it does nothing for the sys.dm_os_latch_stats DMV. Additionally, it's not really recommended to do on a production server, especially since it won't clear the stats in question.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
August 25, 2015 at 7:47 pm
I agree that running
DBCC FreeProcCache
is not recommended in a production server.
The original question was:
Can you please let me know if we can reset the values in DMVs without restarting the instance.
M&M
DBCC FreeProcCache does clear sys.dm_exec_query_stats
If you are testing and tuning for performance, this can be invaluable way to save time.
I know this was an old thread, the only reason I replied was for the benefit of the community.
😀
August 26, 2015 at 12:56 am
joe.arias (8/25/2015)
DBCC FreeProcCache does clear sys.dm_exec_query_statsIf you are testing and tuning for performance, this can be invaluable way to save time.
It does, but it doesn't clear any other DMVs (other than the related sys.dm_exec_procedure/function_stats).
To be honest, unless I'm testing the effects of parameter sniffing, I've never seen a need or use for clearing the entire procedure cache. Recompiling the query/procedure I'm working on, yes maybe, but an ALTER PROCEDURE does that.
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
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply