Ola Hallengren’s Scripts Keep Getting Better

SQL Server

You Know Him, You Love Him

You trust your database backups and integrity checks to him, and he has been KILLING IT on new features lately.

A while back, Ola decided to Open Source his scripts on GitHub (Soon to be known as Microsoft LiveHub for Business Essentials). As more and more people embrace GitHub and are getting used to how it works, the feature suggestions have been rolling in.

And Ola has been hard at work making your Maintenance Dreams come true.

Eye Spotting

Here are a few things that he’s done lately that have caught my eye — if you’re not constantly paying attention to the GitHub repo, or checking in on his website, you may not be aware of them.
Tokenized Directory Structure
Don’t like the default directory structure? Don’t want your AG Replicas or FCI nodes writing to different places? Use the parameters @DirectoryStructure and @AvailabilityGroupDirectoryStructure to fix that! You choose which elements to base the path on.
There are other examples over on his site that show you more configuration options.

More Stats Update Control & Incremental Statistics Support

One issue I always ran into was with @OnlyModifiedStatistics: it was just yes or no.

Which isn’t bad, but it meant that if there was a single modification, stats got updated. Most people would wanna wait until a good chunk of modifications happened, and now you can. Just set @StatisticsModificationLevel to a comfy percentage and skip over all those low-modification statistics. This can be a real time saver in large environments.

Incremental Stats Updates let you update statistics at the partition level, if you have @PartitionLevel = ‘Y’. That’s the default, so if you’ve got partitioned tables, you can just let the script do its thing.
Ordering for Backups and CHECKDB

Got databases you want to backup in a certain order? Now you can! For backups, you can order by database name or size, and for CHECKDB you can also order by the last good check locally or on a replica..

Just like with the stats updates, this is badass for people with limited maintenance windows — which means — you guessed it! They work alongside the @TimeLimit parameter. Let’s say you’ve got 5-10 really big databases on your server, and you can only get a couple of them in. You used to have to jump through some hoops to set up different schedules, or build your own dynamic list. Now you have your jobs pick up where the left off the night before.

This Stuff Is All Free

Remember folks, Ola doesn’t charge a dime for any of this. You can put it on as many servers as you want, for free.

Lord knows I have.

Head over to his site and check out his GitHub repo to get new versions of the scripts, file bug reports (as if Ola has those!), request features, and most importantly — SAY THANK YOU!
Thanks for reading!
Previous Post
10 SQL Server Feature Requests I’ve Upvoted Recently
Next Post
Why SQL Developers Keep Making The Same Mistakes

6 Comments. Leave new

  • Charlie Arehart
    July 5, 2018 12:01 pm

    Erik, thanks for the post (and to Ola for all his work), but as for your saying that Githib is “Soon to be known as Microsoft LiveHub for Business Essentials”, can you offer any reference that indicates that? I find none in googling for it various ways. If this were April 1 I might think that was a prank comment. 🙂

    If the name really is going to be that, I would think there would be an uproar in the wider IT community, not least of which for the fear that its including the term “business essentials” would imply there may be commercial editions, which would seem to fly in the face of the github ethos. Or am I way off base here, everyone? 🙂 I haven’t been following the whole acquisition drama, and I’m sure some have read every word on it.

    Sorry to derail the discussion. If you guys might want to tell us not to have the discussion here, I would understand. But if you could offer any answer to my question I (and perhaps others) would appreciate it. Thanks so much for all that you folks do.

  • Charlie Arehart
    July 5, 2018 12:23 pm

    Ah, ok. Phew. (And glad I acknowledged that it might be.) If you wanted to maybe add a “just kidding” to the statement, it may help avoid others getting exercised. 🙂 In that case, feel free to delete our comments. But if you are leaving it vague for the fun of it, I’ll say “you cheeky monkey” and leave it at that. 🙂

  • Ola is nothing short of a legend. Earlier this year I found an issue where his scripts would not allow backup to Azure blob using BLOCKSIZE and MAXTRANSFERSIZE. I informed him and within a month and a half he had tweaked his scripts to allow this. Top man.

  • Hugo Shebbeare
    July 23, 2018 9:37 am

    Yes, hear, hear to Ola! Been pushing the use of this scripts to ease our DBA workload for years, but unfortunately, I often get resistance from modern day Luddites who prefer to just leave stats and indexes maint to a monthly patching night :/ It is highly doubtful there exists in-house cooked up code that is better than this, so please DBAs adopt this awesome standard, so you can may have the time to do all those lovely BI, Security, et al. projects you’re salivating to do anyway!


Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.