Find Number of Pages Each Database has in BufferPool

This query shows how many pages each database has in the buffer Pool. This will show you the breakdown of memory allocation for each database.
[cc lang=”sql”]
SELECT
DB_NAME(database_id),
COUNT(page_id)as number_pages
FROM sys.dm_os_buffer_descriptors
WHERE database_id !=32767
GROUP BY database_id
ORDER BY database_id
[/cc]

2 comments
Rafael Cruz 04 Feb 2011 at 9:01 am

Worked great, but when tried to use on servers with AWE enabled i got this error:
“Msg 208, Level 16, State 1, Line 1
Invalid object name ‘sys.dm_os_buffer_descriptors'”.

Is there an way to get this information on AWE enabled servers?

Derek Dieter 17 Feb 2011 at 1:51 pm

Hi Rafael, that’s interesting.. Unfortunately I haven’t run into that.. maybe someone else will know.

Featured Articles

 Site Author

  • Thanks for visiting!