solving sql server problems for millions of dbas and developers since 2006


Identify and resolve SQL Server problems BEFORE they happen with SQL diagnostic manager

SQL Server DBA Tips SQL Server Developer Tips SQL Server Business Intelligence Tips SQL Server Career Tips SQL Server Whitepapers SQL Server Tools SQL Server Webcasts SQL Server Questions and Answers SQL Server Questions and Answers






SQL Product Highlight

Idera - SQL diagnostic manager

SQL diagnostic manager is a powerful performance monitoring and diagnostics solution that proactively alerts administrators to health, performance or availability problems within their SQL Server environment via a central console or mobile device. SQL diagnostic manager minimizes costly server downtime by providing agent-less, real-time monitoring and customizable alerting for fast diagnosis and remediation of SQL Server performance and availability problems. SQL diagnostic manager also provides a 'community' environment where, using Idera's IntelliFeed(TM) technology DBAs form a community t

Learn more!




Buffer Pool Space in SQL Server 2005

By: | Read Comments | Print

Chad is an Architect, Administrator and Developer with technologies such as SQL Server, .NET, and Windows Server.

Related Tips: More

Problem
I need to determine what objects/structures are consuming the largest amount of space at a given time (or over time) within the SQL Server buffer pool. How can I achieve this in SQL Server 2005?

Solution
In SQL Server 2000, this was a bit complicated to determine to say the least, however with SQL Server 2005's new dynamic management functions/views, it's become exponentially easier to gain this type of insight; additionally, it's also become easy to aggregate this information for use/display/reporting purposes.

Procedure 1
In this scenario, the use of the sys.dm_os_buffer_descriptors DMV optionally correlated against other catalog views within a given database will provide you all the information you need to get this type of information.

Below are a couple of possible solutions to retrieving this type of data. The first and simpler of two procedures provide you with aggregated information from the DMV rolled-up on a per database, file, and page type combination (page type being things like data pages vs. index pages vs. PFS pages vs. etc., etc.). It's a simple procedure with no parameters and a single select statement with some grouping, rollup, and sorting.

Click here to get the code

Here is sample output from the first 10 rows of the result set.

Procedure 2
The second and more complex of the procedures provides more detailed information for each given database on the system - instead of providing only server-level information (like what database, file, etc. is consuming the buffer pool), it will dig into specific database(s) to provide more targeted information within the given database(s) in regards to specific indexes/tables/views/etc. that are utilizing the most space. Optional parameters are included to target to a specific database, all databases on the system, system level only information, and return only a certain number of results.

Click here to get the code

Here is sample output from the first 10 rows of the result set.

Next Steps



Related Tips: More | Become a paid author


Last Update: 2/26/2007

Share: Share 






Comments and Feedback:


Post a Comment or Question

Keep it clean and stay on the subject or we may delete your comment.
Your email address is not published. Required fields are marked with an asterisk (*)

*Name   *Email   Notify for updates
Comments
*Enter Code refresh code


 
Sponsor Information
"Amazing, Amazing, Amazing! SQL doctor is truly one of the most powerful tools I have seen."

Web-based SQL Server monitoring whenever, wherever.

You don't know, what you don't know about SQL Server... Customized Consulting and Training

Solving SQL Server problems for millions of DBAs and Devs since 2006. Join now.

Free Web Cast - What Are You Waiting For? Delivered by Jason Strate on Wednesday, March 14 @ 3:00 PM EST


Copyright (c) 2006-2012 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | about
authors | contribute | feedback | giveaways | user groups
Some names and products listed are the registered trademarks of their respective owners.


Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com