O'Reilly logo

Microsoft SQL Server 2012 Bible by Aaron Nelson, Jose Chinchilla, Patrick LeBlanc, Jorge Segarra, Adam Jorgensen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing Database Maintenance

SQL Server provides a host of database maintenance commands. Fortunately, it also provides the DBA with ways to schedule maintenance tasks.

Planning Database Maintenance

Database maintenance plans include the following routine tasks:

  • Check database integrity.
  • Perform index maintenance.
  • Update database statistics.
  • Perform database backups.

These maintenance tasks can be automated and scheduled using SQL Server Agent service. Once created, the maintenance plans (and subplans) are scheduled in SQL Server Agent as jobs.

Maintenance Plan

Following are two ways to create a Maintenance Plan:

  • Maintenance Plan Wizard: Used to quickly create a basic maintenance plan. This enables you to choose one of the predefined typical maintenance tasks, such as performing database backup, rebuilding indexes, updating statistics, checking data integrity and cleaning up history and backup files.. It does not enable you to add any custom tasks.
  • Maintenance Plan Design Surface: Used to design maintenance plans with more flexibility. This enables you to create a workflow of typical maintenance tasks and create custom maintenance tasks using T-SQL scripts. It also enables extended logging, which can prove to be useful for troubleshooting purposes.

All the maintenance plans appear in the Management\Maintenance Plans folder of SQL Server Management Studio. To launch the Maintenance Plan Wizard, right-click the Maintenance Plans folder, and choose Maintenance Plan Wizard. Follow ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required