Used to determine the amount of memory be used by all DataBases
Â
SELECT DB_NAME(database_id) AS [Database Name],
COUNT(*) * 8/1024.0 AS [Cached Size (MB)]
FROM sys.dm_os_buffer_descriptors
--WHERE database_id > 4 -- system databases
--AND database_id <> 32767 -- ResourceDB
GROUP BY DB_NAME(database_id)
ORDER BY [Cached Size (MB)] DESC OPTION (RECOMPILE);
Article ID: 154
Created: September 4, 2014
Last Updated: January 10, 2015
Author: Natural Networks NOC [support@naturalnetworks.com]
Online URL: https://kb.naturalnetworks.com/article.php?id=154