Share

Query to Find Buffer Cache Hit Ratio

Open SSMS ( SQL SERVER MANAGEMENT STUDIO ) ==> Right click on the instance ==> New Query and paste the below code to find the Auto Shrink status


SELECT (a.cntr_value * 1.0 / b.cntr_value) * 100.0 as BufferCacheHitRatio
FROM sys.dm_os_performance_counters  a
JOIN  (SELECT cntr_value,OBJECT_NAME
    FROM sys.dm_os_performance_counters 
    WHERE counter_name = 'Buffer cache hit ratio base'
        AND OBJECT_NAME = 'SQLServer:Buffer Manager') b ON  a.OBJECT_NAME = b.OBJECT_NAME
WHERE a.counter_name = 'Buffer cache hit ratio'
AND a.OBJECT_NAME = 'SQLServer:Buffer Manager'

Share

Fixing a database with a high VLF count

Fixing a database with a high VLF count is a simple process: 1. Check the current size of the transaction log. 2. Backup the transacti...