Back to Basics: Capturing Baselines on Production SQL Servers

  • Comments posted to this topic are about the item Back to Basics: Capturing Baselines on Production SQL Servers

  • Thanks a lot Erin for writing such a nice article :-). It provides much more than we could have asked!


    Sujeet Singh

  • Divine Flame (11/27/2012)


    Thanks a lot Erin for writing such a nice article :-). It provides much more than we could have asked!

    I'm very glad it was helpful for you!

  • I've seen or heard a number of times about the importance of collecting baseline information, but this is the first time I've seen some specific suggestions as to where to start. Thank you, Erin, for putting forth the effort to do this.



    Del Lee

  • Hey Erin,

    This is great - especially the idea of baselining your configuration data!

    On a related note, I log and analyze my performance counters through Performance Monitor, mainly because it's quick and easy to use it's built-in graphical tool. I'd be interested to know how you and others *quickly* graph stuff like performance counters when the data is stored in a SQL table.

    Thanks again,

    Bennett

  • Del Lee (11/27/2012)


    I've seen or heard a number of times about the importance of collecting baseline information, but this is the first time I've seen some specific suggestions as to where to start. Thank you, Erin, for putting forth the effort to do this.

    Thank you for reading Del! I hope you have success in your implementation 🙂

  • Bennett Scharf (11/27/2012)


    Hey Erin,

    This is great - especially the idea of baselining your configuration data!

    On a related note, I log and analyze my performance counters through Performance Monitor, mainly because it's quick and easy to use it's built-in graphical tool. I'd be interested to know how you and others *quickly* graph stuff like performance counters when the data is stored in a SQL table.

    Thanks again,

    Bennett

    Bennett-

    First, thanks for reading! Second, that's a great question. I don't usually (ever?) graph those counters by pulling the data from the database. I like having the data in the database so I can quickly do averages and comparisons across multiple time frames. If I want to graph the data, I would run it through PAL (Performance Analysis of Logs) which is a free tool available on CodePlex: http://pal.codeplex.com/

    Now, I would guess (completely a guess) that you could graph that data via Report Services. But I have never tried...would love to hear if anyone else has done that.

    Erin

  • Thanks, this is helpful!

    I started working today to add the collection and reporting of configuration data. I created a query that will report all changes within the last week. One nice thing is that I can run it without needing to supply parameters.

    with ranked

    as

    (

    select * , rank() over (partition by configurationid order by capturedate) as rank

    from config.ConfigData

    )

    select

    a.CaptureDate as BeforeCaptureDate

    , a.ConfigurationID

    , a.Name

    , a.Value as BeforeValue

    , a.ValueInUse as BeforeValueInUse

    , b.CaptureDate as AfterCaptureDate

    , b.Value as AfterValue

    , b.ValueInUse as AfterValueInUse

    from

    ranked a

    inner join ranked b on a.ConfigurationID = b.ConfigurationID and a.rank = b.rank - 1

    where

    a.CaptureDate >= dateadd(week, -1, getdate()) -- Look for changes in the last week

    and ((a.Value <> b.Value) or (b.ValueInUse <> b.ValueInUse)) -- A change is where one of the values doesn't match for consecutive captures

    order by

    a.ConfigurationID, a.CaptureDate

  • heb1014 (11/28/2012)


    Thanks, this is helpful!

    I started working today to add the collection and reporting of configuration data. I created a query that will report all changes within the last week. One nice thing is that I can run it without needing to supply parameters.

    with ranked

    as

    (

    select * , rank() over (partition by configurationid order by capturedate) as rank

    from config.ConfigData

    )

    select

    a.CaptureDate as BeforeCaptureDate

    , a.ConfigurationID

    , a.Name

    , a.Value as BeforeValue

    , a.ValueInUse as BeforeValueInUse

    , b.CaptureDate as AfterCaptureDate

    , b.Value as AfterValue

    , b.ValueInUse as AfterValueInUse

    from

    ranked a

    inner join ranked b on a.ConfigurationID = b.ConfigurationID and a.rank = b.rank - 1

    where

    a.CaptureDate >= dateadd(week, -1, getdate()) -- Look for changes in the last week

    and ((a.Value <> b.Value) or (b.ValueInUse <> b.ValueInUse)) -- A change is where one of the values doesn't match for consecutive captures

    order by

    a.ConfigurationID, a.CaptureDate

    This is fantastic! And a classic example of what I love about the SQL Server Community - taking something and making it better, then sharing with everyone else. Thank you for posting!

  • Bennett Scharf (11/27/2012)


    Hey Erin,

    This is great - especially the idea of baselining your configuration data!

    On a related note, I log and analyze my performance counters through Performance Monitor, mainly because it's quick and easy to use it's built-in graphical tool. I'd be interested to know how you and others *quickly* graph stuff like performance counters when the data is stored in a SQL table.

    Thanks again,

    Bennett

    If you just want to look at it yourself from time to time, maybe Excel will be enough. You can use the wizard (Data >> Get External Data >> From Other Sources >> From SQL Server) to query and import data into the sheet and use its graphing tools to present it nicely enough.

    If you need a few others to see it too, you can host the data on a central database and the Excel file on a network share. You will need to make sure that the connection details in the Excel file absolutely reference the SQL Server (e.g. SERVERNAME\INSTANCENAME not .\INSTANCENAME).

    If you need lots of other people to see it, regularly, Reporting Services might be your friend -- it is designed, after all, to present data, although it obviously more server-centric. But, if you need something a bit more custom, you might need to look at a bespoke app, in ASP.NET (or any other SQL Server/OLEDB/ODBC-capable language).

    (Of course, the name/value storage database structure might not lend itself too well to graphing -- expect to have to create complex pivoting queries and/or views)

  • Thanks for this great article, Erin. I'm looking forward the next ones.

  • Very nice article

  • Erin, I appreciated the great articles, but we are not up to SQL 2005 yet:crying:.

    Do DBA's still stuck in SQL 2000 have any way to script a baseline capture?

    Bill Beadenkopf

    Stonegate Designs

  • Good article, it will definitely point me in the right direction, I'm a very new DBA and I'm learning all the tricks and what to watch for.

    One question, how can we store the same baselines from different servers into one database? I have about 4 different sql servers that I'd like to get the same baseline information but I want to store the database and values in one system.

    Thanks.

  • Hi Bill-

    You can absolutely script baseline capture in SQL 2000 - but you're going to have to modify the scripts provided (or create new ones) and you might not be able to capture all the same data.

    Erin

    Bill Beadenkopf (1/23/2013)


    Erin, I appreciated the great articles, but we are not up to SQL 2005 yet:crying:.

    Do DBA's still stuck in SQL 2000 have any way to script a baseline capture?

    Bill Beadenkopf

    Stonegate Designs

Viewing 15 posts - 1 through 15 (of 24 total)

You must be logged in to reply to this topic. Login to reply