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)
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.