Display dirty pages per database

— DISPLAY EACH DATABASE’S DIRTY PAGE UTILIZATION IN SQL SERVER
SELECT db_name(database_id) AS ‘DATABASE’,
count(page_id) AS ‘DIRTY PAGES’
FROM sys.dm_os_buffer_descriptors
WHERE is_modified = 1
GROUP BY db_name(database_id)
ORDER BY count(page_id) DESC

Advertisements

Determine each database's internal Data Cache usage in SQL Server

— IN SQL SERVERS INTERNAL DATA CACHE, DISPLAY EACH DATABASE’S DATA CACHE USAGE
select count(*)*8/1024 as ‘Cached Size(MB)’, CASE database_id
when 32767 then ‘ResourceDb’
else db_name(database_id)
end as ‘Database’
From sys.dm_os_buffer_descriptors
group by db_name(database_id), database_id
order by ‘Cached Size(MB)’ DESCīœŠ