Read + Write + Report
Home | Start a blog | About Orble | FAQ | Blogs | Writers | My Orble | Login

Identifying Windows Volumes on a Clustered SQL Server Instance with the DMVs

January 7th 2009 13:56
Identifying Windows Volumes on a Clustered SQL Server Instance with the DMVs


Problem
I have inherited a Microsoft SQL clustered server and I don't know much about it's logical structure. It is a two node, active-active cluster and I am trying to determine which of the logical volumes on the shared disk are associated with each SQL Server instance. Is there a simple method in T-SQL to determine this without having to fire up Cluster Administrator?

Solution
There most certainly is. One of the Dynamic Management Views (DMV) that released with SQL Server 2005 is sys.dm_io_cluster_shared_driv es. Let's briefly discuss what DMVs are first for those that may be new to the concept before I answer your question.


Dynamic Management Views provide insight into internal Microsoft SQL Server metrics. They function just as database views do: they act as a logical object that is really simply an aggregate of data from joined tables and views, usually allowing for a simplified method of querying disparate data sets. In the case of DMVs these tables and views are internal to the database engine, are system objects, and are even in some cases hidden from the end user. Dynamic Management Views act as a window into the inner workings of the SQL Server instance. The process by which you query the DMVs is identical to how you would query any other view:

SELECT [field1], [field2], [fieldN]
FROM [DMV]
WHERE [fieldX] = value
ORDER BY [field1], [field2], [fieldN]

Now to address your question. sys.dm_io_cluster_shared_driv es will return a listing of all logical drive volume names for every shared drive of the current server instance. If the server instance is not clustered, no results are returned. The structure of this DMV is extremely simple, just a single column, DriveName. I too have a two node, active-active cluster. This is a misnomer however. The new terminology would be multi-node, multi-instance cluster as you may have one or more instances on a give node (server) in a SQL Server cluster.


Below is the query code. Note that there are absolutely no parameters. The hardest part of constructing this query is remembering the name of the Dynamic Management View.

SELECT DriveName
FROM sys.dm_io_cluster_shared_driv es
ORDER BY DriveName

If I run this query against both nodes I get the following results in my environment:

Node1 Results

DriveName
L
M
N
O



Node2 Results

DriveName
R
S
T
U




These results in-hand I can ascertain that Node 1's instance is associated with the L, M, N, and O logical disk volumes. Node 2's instance is reliant upon the R, S, T, and U logical disk volumes. All this information was retrieved with the simplest of T-SQL queries, without the need to launch Cluster Administrator.

51
Vote
Add To: del.icio.us Digg Furl Spurl.net StumbleUpon Yahoo


   

   

   


Add A Comment

To create a fully formatted comment please click here.


CLICK HERE TO LOGIN | CLICK HERE TO REGISTER

Name or Orble Tag
Home Page (optional)
Comments
Bold Italic Underline Strikethrough Separator Left Center Right Separator Quote Insert Link Insert Email
Notify me of replies
Notify extra people about this comment
Is this a private comment?
List the Email Addresses or Orble Tags of the people you would like to be notified about this comment


One per line max of 30

List the Email Addresses or Orble Tags of the people you would like to be notified about this private comment thread. Only the people in this list will be able to see or reply to your comment.


One per line max of 30

Your Name
(for the email going out to the above list, it can be different to your Orble Tag)
Your Email Address
(optional)
(required for reply notification)
Submit
More Posts
4 Posts
11 Posts
1 Posts
77 Posts dating from May 2008
Email Subscription
Receive e-mail notifications of new posts on this blog:
0

Siddharth sood's Blogs

37 Vote(s)
0 Comment(s)
1 Post(s)
84 Vote(s)
0 Comment(s)
2 Post(s)
37 Vote(s)
0 Comment(s)
1 Post(s)
50 Vote(s)
0 Comment(s)
1 Post(s)
29 Vote(s)
0 Comment(s)
1 Post(s)
76 Vote(s)
0 Comment(s)
2 Post(s)
169 Vote(s)
0 Comment(s)
4 Post(s)
213 Vote(s)
2 Comment(s)
5 Post(s)
26 Vote(s)
0 Comment(s)
1 Post(s)
25 Vote(s)
0 Comment(s)
1 Post(s)
Moderated by Siddharth sood
Copyright © 2006 2007 2008 On Topic Media PTY LTD. All Rights Reserved. Design by Vimu.com.
On Topic Media ZPages: Sydney |  Melbourne |  Brisbane |  London |  Birmingham |  Leeds     [ Advertise ] [ Contact Us ] [ Privacy Policy ]