How much memory is used by each database in SQL Server?
SELECT CASE WHEN database_id = 32767 THEN 'Resource DB' ELSE DB_NAME (database_id) END AS 'DBName', COUNT (1) AS 'Page Count', (COUNT (1) * 8)/1024 AS 'Memory Used in MB' , CASE WHEN is_modified = 1 THEN 'Dirty Page' ELSE 'Clean Page' END AS 'Page State' FROM sys.dm_os_buffer_descriptors GROUP BY [database_id], [is_modified] ORDER BY db_name(database_id) GO
No comments:
Post a Comment