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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s