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.