In this short article i will share a simple query that i wrote to find the number of pages of a database in the buffer pool and there usage of the buffer pool
1
2
3
4
5
6
7
| SELECT CASE database_id WHEN 32767 THEN 'ResourceDb'ELSE DB_NAME(database_id)END AS [Database],COUNT(*) AS PageCount ,( COUNT(*) * 8.0 ) / 1024 AS [SpaceOccupiedInBuffer-Mb]FROM sys.dm_os_buffer_descriptorsGROUP BY database_idORDER BY 3 DESC |

No comments:
Post a Comment