Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Data Management

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

Search

XML Feeds

Google Ads

« SQL Server Fabric and DATAllegro demo at PASS, SQL Data Services Public CTP AvailableProactive Deadlock Notifications »
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

In a previous entry I talked about how you should pressure management to purchase SQL Server monitoring tools. This in my eyes is important for more than just the fact you can see quickly when you have problems on your instances but also because we as any associate working for the company that was kind enough to employ us is a business entity. That means we need the business to run with minimal costs associated with it. What that boils down to with having something like Idera SQLdm or Quests monitoring and the lot is we as DBAs spend a fraction of the time troubleshooting and putting in preventative structures to our database designs.

So now reality sets in. I know there are companies out there that one either do not have the funds to spend the cost that comes with monitors tools or two they just say no to them because they aren’t all the smart and sense a DBA is salary in most cases the DBA spending 20 hours getting indexes in vs. an hour makes no difference. Does it? Yes it does business majors. If I spend 20 hours figuring out my bottle necks and indexing to prevent them vs. spending an hour on that task then I just missed out on 19 hours I could have spent working on the next project. It really is a simple equation and in the long run the business always loses out when they do not provide the tools to make our jobs more productive. Where was I? Oh yea, reality!

Something I’m commonly surprised is not installed on every SQL Server landscape is a primary SSRS database server. Don’t get me going on that cause we’ll be here all day. On that primary SSRS instance there should be a SQL Server DBA folder and in there all your favorite commonly run reports but most of all the SQL Server 2005 Dashboard. What’s that? This is where I love to talk to people that think Microsoft does nothing to make our lives easy and they hate us all. Sorry but they do a pretty damn good job along with make our lives easy. Well, if you can follow simple directions ;)

The SQL Server 2005 Performance Dashboard Reports is something that has been out there sense SP2. Basically all these reports do is expose the dynamic management objects we have now with 2005+ versions but they put it in a package in SSRS that makes it very easy for us to see historic data and real-time views of our performance. Some of the nicest features are the missing index views, expensive query reports, IO and Wait statistics and of course the CPU statistics. Now I know this can all be had by executing the DMV/DMF’s in SSMS but why not show me a graph? I like graphs. Easy to tell when I have a big bar surrounded around little ones and wow, I can click it and see the SPID that did it and the showplan of the query that was killing it. No that doesn’t mean your lazy if you like the same things I do. It means your efficient and when you’re in a Sr. level position you know this is more important than knowing how to weed out lock statistics from sp_lock and narrow it back to some sessions.

So let’s install the dashboard the way I did it and also point out what I needed to do in order to make it work. There are a few catches in it.

First go here and download the msi to install the rdl’s

http://www.microsoft.com/downloads/details.aspx?FamilyId=1d3a4a0d-7e0c-4730-8204-e419218c1efc&displaylang=en

I’m assuming you at least have SSRS installed on your PC but preferably you’ve talked your management into a designated SSRS server by now.

When you run the msi all it does is decompress some rdl’s and a .sql script to the typical folder location of “C:\Program Files\Microsoft SQL Server\90\Tools\PerformanceDashboard\”

First thing is you need to put the procedures in the msdb on the instance you want to monitor. Microsoft has the scrip tin the folder you just added name, “setup.sql". creative huh? Open ths script on the instance and run it. Don’t worry because if you are a smart DBA you have a backup of the sys databases ;). Really though all this does is install some MS_PerfDashboard… procedures to the msdb. Yes make your sys backups if you haven’t first though.

Now open up VS.NET or BIDS and create a new Report Server Project named “SQL Server DBA". In the fresh project right click the Reports folder and go to Add, Existing Item.

In the dialog browse to the location the rdl files are and select them all and click Add. Now right click the Shared Data Sources folder and click Add New Data Source. leave DataSource1 name as is unless you want to change all the datasets in the rdl files. Personally I do that because I control my data sources critically but it’s up to you. My job is to get it running for you and then you make your own choices. So now click Edit and enter your server name, leave windows authentication and the then any db.

Now double click the “performace_dashbaord_main.rdl” and hit preview. You were probably shown either permissions errors or a nasty datatime overflow error like this, “Difference of two datetime columns caused overflow at runtime". First, permissions you can handle. You need server view state and access to sys views. The overflow is a bit different. There is an easy fix for it. Basically it’s from sessions over 24 hours in time. To fix this go into the msdb and modify the procedure MS_PerfDashboard.usp_Main_GetSessionInfo to this

  1. USE [msdb]
  2. GO
  3. ALTER PROCEDURE [MS_PerfDashboard].[usp_Main_GetSessionInfo]
  4. AS
  5. BEGIN
  6.  SELECT COUNT(*) AS num_sessions,
  7.   SUM(CONVERT(BIGINT, s.total_elapsed_time)) AS total_elapsed_time,
  8.   SUM(CONVERT(BIGINT, s.cpu_time)) AS cpu_time,
  9.   SUM(CONVERT(BIGINT, s.total_elapsed_time)) - SUM(CONVERT(BIGINT, s.cpu_time)) AS wait_time,
  10.   SUM(CONVERT(BIGINT, CAST ( DATEDIFF ( MINUTE, login_time, GETDATE()) AS BIGINT)*60000 + DATEDIFF ( millisecond, DATEADD ( MINUTE,
  11.     DATEDIFF ( MINUTE, login_time, GETDATE() ), login_time ),GETDATE() ))) - SUM(CONVERT(BIGINT, s.total_elapsed_time)) AS idle_connection_time,
  12.   CASE WHEN SUM(s.logical_reads) > 0 THEN (SUM(s.logical_reads) - isnull(SUM(s.READS), 0)) / CONVERT(FLOAT, SUM(s.logical_reads))
  13.    ELSE NULL
  14.    END AS cache_hit_ratio
  15.  FROM sys.dm_exec_sessions s
  16.  WHERE s.is_user_process = 0x1
  17. END

Important to note this is not my fix but from here

http://blogs.msdn.com/sqlrem/archive/2007/03/07/Performance-Dashboard-Reports-Now-Available.aspx

Give credit where credit is due!

Now go back to the report and refresh it if you already did not see the report generated.
You should see something like this for the overview

Nice isn’t it? This is about as far as I’m going to go with it sense the links in the reports are pretty self explaining and when you click and export the statistics to formats and start on your performance increasing quest you’ll learn more of this Microsoft provided monitoring tool than I. I just wanted to get you off your feet and flying. Hope I did just that with saving a little money.

About the Author

Ted Krueger has been working in development and database administration for 13+ years. Specialties range from High Availability and Disaster / Recovery setup and testing methods down to custom assembly development for SQL Server Reporting Services. Ted blogs and is also one of the founders of LessThanDot.com technology community. Some of the articles focused on are Backup / Recovery, Security, SSIS and working on SQL Server and using all of the SQL Server features available to create stable and scalable database services. Recent community contributions have been to organize SQL Saturday events in the Chicago-land to Milwaukee-land area for 2010 where he will also be speaking about various SQL Server topics. @onpnt
Social SitingsTwitterLinkedInLTD RSS Feed
1211 views
submit to reddit Digg!FacebookDotnetkicks

Comments and Feedback

2 comments

Comment from: SQLDenis [Member] Email
*****
Nice info man

Temped to install the dashboard myself
18/11/08 @ 17:58
Comment from: onpnt [Member] Email
Thanks Denis :) It really is nice. When I'm traveling also it's nice not to overload my laptop running some of the third party monitors
20/11/08 @ 11:12

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)