Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Dell 2900 Server with 16 GB of memory running SQL Server 2005.

All 3 of the databases I have configured on the Server all have the maximum memory allocated to each Database. The primary database runs my production environment of our BAAN application, the other two databases run a development environment.

Besides reducing the amount of memory used in the other 2 Databases, is there a command I can issue to show the memory used by each database?

share|improve this question
Are you maybe confusing memory with storage? – JNK Jan 16 '12 at 19:57
or databases with instances? – gbn Jan 16 '12 at 21:12

Try the query below:

SELECT (count(*)*0.0078125) AS 'Pages in Buffer pool'
    ,CASE database_id
        WHEN 32767 THEN 'ResourceDb'
        ELSE db_name(database_id)
        END AS Database_name
FROM sys.dm_os_buffer_descriptors
GROUP BY db_name(database_id) ,database_id

This will show you the amount of space each DB has occupied in the buffer pool. Note that there are other factors in SQL that also use up the memory apart from the buffer pool.

share|improve this answer

I don't think there's a way to limit or show the amount of memory used by individual DBs in SQL Server. If you are having memory issues, I think what you're probably better off doing is to install a second instance of SQL on that server, use it to host the dev environments and limit it to a certain amount of memory (like a GB or two) in the server options.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.