This article is half-done without your Comment! *** Please share your thoughts via Comment ***
This is one of the most important script for SQL Server Database Administrator.
In this post, I am sharing TSQL script to find memory utilization for each SQL Server database.
Generally, The majority percentage of the memory is utilized by the SQL Server buffer pool.
As a Database Administrator, this is our responsibility to find which database is consuming the most buffer pool memory.
We can use sys.dm_os_buffer_descriptors DMV to find information on every cached page of the Buffer pool.
WHEN database_id = 32767
THEN 'Resource DB'
ELSE DB_NAME (database_id)
END AS DatabaseName
,COUNT (1) AS Buffer_PageCount
,(COUNT (1) * 8)/1024 AS Used_MemoryInMB
GROUP BY database_id
ORDER BY db_name(database_id)