Welcome to the Community Forum

It looks like you might be new around here. That's great! We're a super friendly community and can't wait to meet you. Come on in and Join Us.

Being a Data Professional is not easy. Having outstanding technology skills is not enough, there's so much more to our art. Here we talk about what it means to be a Data Professional, sharing our experiences, knowledge and ideas so that we can learn and grow together.

Make an investment in yourself and your development today by becoming a member. Join the conversation.

Author Topic: Share Your Favourite Performance Scripts  (Read 3437 times)

0 Members and 1 Guest are viewing this topic.

Offline Bigdavidjb

  • Newbie
  • *
  • Posts: 8
Share Your Favourite Performance Scripts
« on: December 13, 2012, 01:55:38 PM »
Hi All,

Typing ‘ms sql server performance scripts’ in to Google gives you 72,200,000 results in 0.82 seconds (I wish my searches ran that fast...) this result set gives you the good, the bad and the downright ugly of scripts you could run on your servers.

So the question really is which are the good ones, beneficial, quick and easy to use?

In my arsenal, I use Adam Machanic’s sp_whoisactive and Ola Hallengrens maintenance script a lot, both are exceptionally good and well worth investigating.

David
« Last Edit: December 19, 2012, 04:19:11 PM by John Sansom (@SqlBrit) »



Offline John Sansom (@SqlBrit)

  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
    • John Sansom - SQL Server DBA in the UK
Re: Performance Scripts
« Reply #1 on: December 13, 2012, 02:08:52 PM »
Excellent suggestions David! I'm also a humongous fan of Adam's sp_whoIsActive.

For index maintenance I've predominately gone with Michelle Ufford's (@SQLFool) Index Defrag Script for this. Stick to what you know and all that.

Glenn Berry has a number of great scripts on his blog too. Such as his SQL Server 2012 Diagnostic Information Queries. Also available for SQL Server 2005 and 2008.

Offline ckwmcgowan

  • Newbie
  • *
  • Posts: 4
Re: Performance Scripts
« Reply #2 on: December 13, 2012, 02:41:58 PM »
I use literally hundreds of scripts but ones that spring to mind are;

Any of the SQL Skills  scripts two in particular i've used a lot this week are;

sp_SQLskills_SQL2008_helpindex
sp_SQLskills_SQL2008_finddupes

Richard Ding's sp_SDS, the lovely people over at Brent Ozar PLF's sp_Blitz.  The accompanying scripts for the RedGate book "Performance Tuning with SQL server Dynamic Management Views" are also invaluable.

Chris
« Last Edit: December 14, 2012, 03:24:32 PM by John Sansom (@SqlBrit) »
I am the master of my fate:
I am the captain of my soul.

Offline John Sansom (@SqlBrit)

  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
    • John Sansom - SQL Server DBA in the UK
Re: Performance Scripts
« Reply #3 on: December 13, 2012, 04:40:24 PM »
Richard Ding's sp_SDS, the lovely people over at Brent Ozar PLF's sp_Blitz. 


Impeccable timing on a mention for sp_Blitz there Chris. Brent just blogged about the latest release of this stored procedure, which I'm slightly ashamed to say I've not actually toyed with yet.

I'm not familiar with sp_SDS. Will have a gander.

Offline Chris Yates

  • Full Member
  • ***
  • Posts: 159
  • Don't just fix the problem; fix the root cause
    • The SQL Corner
Re: Performance Scripts
« Reply #4 on: December 13, 2012, 06:13:24 PM »
I have a ton of scripts I've accumulated over the years but a few of the favorites I've seen, some of been mentioned already:

sp_WhoIsActive by Adam Machanic
sp_Blitz by Master Ozar
Diagnostic Queries by Glenn Berry
Red Gate Tools (toolbelt)
Database Health Check by Steve Stedman
Utility Database capture by Chris Shaw (storing metrics for trending on servers through CMS)

One I have not tried out yet much was by Kendra Little and her index blitz

Yates
Chris Yates
The SQL Corner
Blog: http://www.chrisyatessql.wordpress.com
Twitter: @YatesSQL

Offline AnupWarrier

  • Newbie
  • *
  • Posts: 2
Re: Performance Scripts
« Reply #5 on: December 13, 2012, 09:54:26 PM »
My personal fav are -

1. Whoisactive
2. SP_Blitz
3. Glenn Berry's diagnostic queries

Offline Chris Yates

  • Full Member
  • ***
  • Posts: 159
  • Don't just fix the problem; fix the root cause
    • The SQL Corner
Re: Performance Scripts
« Reply #6 on: December 14, 2012, 07:51:01 PM »
I don't see this one mentioned but it is fairly new and I sat on in one of her WebEx's; Kendra Little has a great video and download in parallel with the sp_blitz called sp_blitzindex

http://www.brentozar.com/archive/2012/12/instant-index-insight-how-to-use-sp_blitzindex-video/

Enjoy
Chris Yates
The SQL Corner
Blog: http://www.chrisyatessql.wordpress.com
Twitter: @YatesSQL

Offline John Sansom (@SqlBrit)

  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
    • John Sansom - SQL Server DBA in the UK
Re: Performance Scripts
« Reply #7 on: December 15, 2012, 01:07:59 PM »
I don't see this one mentioned but it is fairly new and I sat on in one of her WebEx's; Kendra Little has a great video and download in parallel with the sp_blitz called sp_blitzindex

http://www.brentozar.com/archive/2012/12/instant-index-insight-how-to-use-sp_blitzindex-video/

Enjoy


Good catch/share.

Offline Chris Yates

  • Full Member
  • ***
  • Posts: 159
  • Don't just fix the problem; fix the root cause
    • The SQL Corner
Re: Performance Scripts
« Reply #8 on: December 18, 2012, 04:35:27 AM »
So I downloaded the SSMS Tools utility that was noted here. I must say I like it very much. I have the ability to use the SQL Search Utility but the option of having your cursor over say a udf for example right clicking and selecting locate object and it take you straight to the object is quite nice. The color toolbars dependent for each database has helped some of our newbies to know when they are on some very important servers. The tool tips suffice if they are needed. All around I'm a fan.

Thanks for noting it here.
Chris Yates
The SQL Corner
Blog: http://www.chrisyatessql.wordpress.com
Twitter: @YatesSQL

Offline John Sansom (@SqlBrit)

  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
    • John Sansom - SQL Server DBA in the UK
Re: Performance Scripts
« Reply #9 on: December 18, 2012, 08:14:31 AM »
So I downloaded the SSMS Tools utility that was noted here. I must say I like it very much. I have the ability to use the SQL Search Utility but the option of having your cursor over say a udf for example right clicking and selecting locate object and it take you straight to the object is quite nice. The color toolbars dependent for each database has helped some of our newbies to know when they are on some very important servers. The tool tips suffice if they are needed. All around I'm a fan.

Thanks for noting it here.


Stop having fun at work Chris.

Are you talking about (ssmsboost.com)?
« Last Edit: December 18, 2012, 08:23:26 AM by John Sansom (@SqlBrit) »

Offline Luke Merrett

  • Newbie
  • *
  • Posts: 21
    • ClickRex
Re: Performance Scripts
« Reply #10 on: December 18, 2012, 09:05:39 AM »
I don't see this one mentioned but it is fairly new and I sat on in one of her WebEx's; Kendra Little has a great video and download in parallel with the sp_blitz called sp_blitzindex

http://www.brentozar.com/archive/2012/12/instant-index-insight-how-to-use-sp_blitzindex-video/

Enjoy


Just run this into our development database and exclaimed "holy s***!".  The script is awesome; can't wait to get started using it.

Offline John Sansom (@SqlBrit)

  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
    • John Sansom - SQL Server DBA in the UK
Re: Performance Scripts
« Reply #11 on: December 18, 2012, 09:23:50 AM »
Nice one Luke! Be sure to let us know how you get on.

I've used similar scripts in the past (I'm keen to get my hands dirty with this one) and they almost always identify areas we can improve our database systems. The one that seems to crop up most in my experience is un-used indexes. As the workload for an environment changes over time it can be years since a given index was originally deployed, sometimes these things fall out of use and go unnoticed. All the while consuming storage and incurring write overhead. It can certainly add up.

As an aside, we're big on talking Professional Development around these parts  ;) so make sure you document all the proactive efforts you are taking and the positive effects they have for the systems/application and company. It will help you build a stronger case come review time.

Offline Chris Yates

  • Full Member
  • ***
  • Posts: 159
  • Don't just fix the problem; fix the root cause
    • The SQL Corner
Re: Performance Scripts
« Reply #12 on: December 18, 2012, 01:11:27 PM »
Indeed I am, my late night kind of ran together.

Thanks for the clarification it is ssmsboost from ssmsboost.com :)
« Last Edit: December 18, 2012, 01:12:30 PM by John Sansom (@SqlBrit) »
Chris Yates
The SQL Corner
Blog: http://www.chrisyatessql.wordpress.com
Twitter: @YatesSQL

Offline Liam G

  • Newbie
  • *
  • Posts: 2
Re: Share Your Favourite Performance Scripts
« Reply #13 on: January 09, 2013, 11:40:09 AM »
My all time favourite is aba_lockinfo by Erland Sommarskog as it shows the lead blocker, object locking chain and SQL cmds in process: http://www.sommarskog.se/sqlutil/aba_lockinfo.html
There is a beta_lockinfo version, but I still prefer aba_lockinfo

Glenn Berry's diagnostic queries are great, especially instantaneous CPU history query.
As is this query here: http://social.msdn.microsoft.com/Forums/en-GB/transactsql/thread/8af7ac39-7b09-4b84-9c1c-95573c7350d8 If I find the time to roll my own this would be the starting point.

As with any of these make sure you understand what is being returned!

Offline Chris Yates

  • Full Member
  • ***
  • Posts: 159
  • Don't just fix the problem; fix the root cause
    • The SQL Corner
Re: Share Your Favourite Performance Scripts
« Reply #14 on: January 09, 2013, 06:47:05 PM »
Liam, I'll have to check out the first one you mentioned you have sparked my interest.

I'm a huge fan of Glenn Barry's I call it my "Diagnosis on Steroids" when reviewing his scripts!
Chris Yates
The SQL Corner
Blog: http://www.chrisyatessql.wordpress.com
Twitter: @YatesSQL