Friday, July 19, 2013

Do you DMV (SQL Server Dynamic Management View)? If not, check out this series... "July, the 31 Days of SQL Server DMO's"

Tamarick Hill - July, the 31 Days of SQL Server DMO’s - Intro

DMO’s burst onto the SQL Server scene in 2005 and when they did they unlocked a wealth of information. I’ve became a major fan of DMO’s as they tend to simplify my troubleshooting as well as provide me with valuable information about what is going on within the SQL Server engine. I would recommend that those of you who are not familiar with DMO’s, take the time to really learn more about them.

For those of you who may not be familiar with DMO’s, for the month of July, I will be writing about one DMO per day. Don’t get me wrong, I’m no DMO expert or anything like that, but I’ve worked with them enough to feel that I can give you some good information about DMO’s to help you get started with using them. During these blog sessions, I will not be providing you with any complicated queries to solve all of your SQL Server problems that you may or may not have. I will be simply introducing you to various DMO’s and illustrating what type of information they provide. After you learn more about these individually, then you will be able to join whatever DMO’s you need to pull back the information you are seeking.

I hope that you all benefit in some form or fashion from my next 31 DMO postings!!! Enjoy! [GD: Post Leached in Full]

Tamarick Hill - July, the 31 Days of SQL Server DMO’s – Day 18 (sys.dm_io_virtual_file_stats)

The sys.dm_io_virtual_file_stats Dynamic Management Function is used to return IO statistic information about each of your database files on your server. As input parameters, this function takes a database_id and a file_id. If you want to return IO statistic information for all files, you can simply pass in NULL values for both of these. Let’s have a look at this function  and examine its results:

SELECT db_name(database_id) DatabaseName, * FROM sys.dm_io_virtual_file_stats(NULL, NULL)

image

...

I don't DMV nearly enough [Insert "Back when I started with SQL Server..." old guy comment here] which means I'm missing out on the awesome that are DMV's. If you've been avoiding or ignoring them, check out these series. It will give you a feel for just some of the cool that can be found, or done with, DMV's.

Here's the series ToC To date (to see the latest, just check out the July archive)...

 

Related Past Post XRef:
“The SQL Server DMV Start Pack” (eBook and T-SQL) from Red Gate and more Dynamic Management Views (DMV) stuff
A Microsoft SQL Server DMV/DMF cheat-sheet with a list of DMV's every SQL DBA should know...
A Microsoft SQL Server DMV/DMF Cheat-Sheet - The Sequel

No comments: