SELECT d.database_id,
d.name AS database_name,
COUNT(*) * 8 / 1024 AS mb_used
FROM sys.dm_os_buffer_descriptors osb
INNER JOIN sys.databases d ON d.database_id = osb.database_id
GROUP BY d.database_id, d.name
ORDER BY COUNT(*) DESC;
-- buffer cache usage for whole instance
SELECT COUNT(*) * 8 / 1024 AS mb_used
FROM sys.dm_os_buffer_descriptors osb
INNER JOIN sys.databases d ON d.database_id = osb.database_id;
No comments:
Post a Comment