Introduction
Have you ever wondered about what keeps your database running smoothly? We all hope the database
keeps running as well as it did as when it was first installed, but what really is happening under the covers?
More importantly, can we control what is happening? As it turns out, we certainly can control these events,
and they are extremely powerful tools that we can use to make sure that our databases stay in good shape.
This book will introduce you to the core concepts of creating a maintenance plan that will handle all
of the tasks necessary to keep your database functioning at 100%. There are exercises that you can run in
your own installation of SQL Server to ensure heightened data security and integrity by harnessing the
power of SQL Server Agent. With the proper amount of foresight and planning, database administrators of
any experience level will be confidently using the tools available in SQL Server to create extremely versatile
maintenance plans in a short amount of time.
What Is the Scope of this Book?
In the scope of this book, I am going to concentrate on using the SQL Server 2012 Management Studio
interface as much as possible. I am not going to get into a lot of scripting by hand; it will be point-and-click
as much as possible. There will be some areas where we will venture into the void, but I’ll keep that to a
minimum. To be clear, I will be working with the Maintenance Plan Wizard, and not from the Maintenance
Plan Design Surface. There will be times when I will focus directly on the design surface, but for the most
part, we will work with the wizard. Most of what I detail and outline here is transferable between the two
interfaces anyway, as you will soon see.
We are going to make a single maintenance plan that will automatically execute every day on a
set schedule. I am going to show you how we can manipulate the database engine into performing the
maintenance activities we choose on the schedule we choose. I am also going to show you how to expand
on the concept of reporting and logging, from the database point of view, to keep us aware of any possible
issues. In the end, we are going to have a maintenance plan that does everything we need it to do, period.
This will give us an assistant, so to speak, that runs these menial although important tasks without our
supervision. When I think of maintenance plans, I immediately think of the old Ron Popeil commercials
with “set it… aaaaaaand forget it!” That’s exactly what we do here. We are going to take the time to set it up
correctly, and examine the why and not just the how. We are then going to ensure that our reporting and
logging is set up correctly, so that we are aware of any issues. After that, it will be smooth sailing and you can
enjoy your newly augmented rock star DBA status.
Who Is this Book Written For?
This book was written for you, of course! It should be a refresher course for the majority of readers.
My hope is that this book will augment what you already know, and perhaps shed some light on some concepts
that you didn’t know. At a minimum, you should come away from this book with a clear understanding of
what a maintenance plan is, how it benefits a database, how to structure it correctly, how it runs, and how
to possibly make it run more efficiently. I would like to think that this isn’t the first you have read about
xix