March 28, 2013 at 3:39 am
Hi everybody , I need your help please :
I want to create a graph to show the progression of the "buffer cache hit ratio" for last 7 days (a week).
Until now I use this script (actual moment ) :
SELECT CAST(
(
SELECT CAST (cntr_value AS BIGINT)
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Buffer cache hit ratio'
)* 100.00
/
(
SELECT CAST (cntr_value AS BIGINT)
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Buffer cache hit ratio base'
) AS NUMERIC(6,3)
)
March 28, 2013 at 4:38 am
Just turn that same query into an INSERT ... SELECT... statement and save the data into a table along with the date and time that you collected the information. Then you can generate a report. There's no way just from the DMO you're querying to see what's happening over the week. You have to store that information in some manner.
----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply