Buffer cache hit ration ( for week )

  • 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)

    )

  • 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 Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply