Solved

sql2008, buffer pool usage at db level

Posted on 2012-03-14
3
322 Views
Last Modified: 2012-03-20
I know the query below will display current buffer pool usage at each db instance in SQL. But my questions is how do I drop those buffer pool let says from [DB_1] and let only those size  available in [DB_2]. The reasons why is because [DB_1] is no longer active in production but must be make available in SQL instance.

SELECT
(CASE WHEN ([is_modified] = 1) THEN 'Dirty' ELSE 'Clean' END) AS 'Page State',
(CASE WHEN ([database_id] = 32767) THEN 'Resource Database' ELSE DB_NAME (database_id) END) AS 'Database Name',
COUNT (*) AS 'Page Count'
FROM sys.dm_os_buffer_descriptors
GROUP BY [database_id], [is_modified]
ORDER BY [database_id], [is_modified];
GO
0
Comment
Question by:motioneye
  • 2
3 Comments
 
LVL 40

Assisted Solution

by:lcohan
lcohan earned 150 total points
ID: 37721857
The easyest way I can think of is to restart the SQL Server service and if that database is not used anymore the buffer pool should be low.
In SQL 2008 you have a "Resource Governor" that could help you do more detailed SQL resource management.
0
 
LVL 25

Expert Comment

by:jogos
ID: 37721879
When that cache isn't used anymore it will be replaced by new pages that are demanded on that moment ... indifferent for what db.
0
 
LVL 25

Accepted Solution

by:
jogos earned 350 total points
ID: 37722009
Don't do this on production
<<The easyest way I can think of is to restart the SQL Server service and if that database is not used anymore the buffer pool should be low.>>
DROPCLEANBUFFERS (after checkpoin) is easyer
http://msdn.microsoft.com/en-us/library/ms187762.aspx

Warning : That is for all databases and the db you want to give priority will get punished as hard as the others.

Check the "Resource Governor" suggestion from first comment to have some management.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question