• Adam Thurgar

Customising Ola's maintenance solution

I am a big fan of using Ola Hallengren's backup and maintenance solution.


But there may be times that you want to customise his solution to meet your own needs or to comply with a companies database standards.

I never change the underlying maintenance.sql file.

What I usually do is to have a set of additional scripts that can be run after the main maintenance script.

An example of the scripts that I run are:

- rename jobs to comply with a standard and disable all the jobs

- create one cleanup job that has the job steps for command log cleanup, output file cleanup, delete backup history, purge job history and a new job step to cycle the error log

- drop the jobs that were created for command log cleanup, output file cleanup, delete backup history and purge job history

- create schedules for all jobs

I also have separate scripts to enable/disable all the jobs.

Finally I have a script to uninstall the whole maintenance solution (tables, stored procs, functions and jobs) - required for testing or if I make a mistake and need to start all over again.

9 views0 comments

Recent Posts

See All

Cardinality estimator

Recently I was asked by a software vendor to review a particular query that ran in under a second on a SQL Server 2014 installation at a compatibility level of 110 (SQL Server 2012), but when run unde

Index fragmentation

A law firm client, occasionally has issues with their legal software, that is provided by the global leader in this field. The response from the software provider is always the same - you have index f

Deleting large amounts of data

I had a client call me about wanting to delete a large amount of data from their database. They knew what tables they wanted to delete from. They also knew that deleting large amounts of data causes t