Setting up a database maintenance plan

You should set up a database maintenance plan. For detailed information on setting up a plan for Microsoft SQL Server or a Microsoft Azure SQL solution, see docs.microsoft.com.

The table below illustrates a sample database maintenance plan for a Microsoft SQL Server install.

Task

Hourly

Nightly

Weekly

Monthly

Database consistency check

 

 

X

 

Shrink database

 

 

 

X*

Reorganize indexes

 

X

 

 

Rebuild indexes

 

 

X

 

Update statistics

 

X

 

 

Database backup – Full

 

 

X

 

Database backup – Differential

 

X**

 

 

Database backup – Transaction log

X

 

 

 

Maintenance clean-up

 

 

X

 

* Or longer – Regularly shrinking a database fragments the drive on which it is running, which reduces performance. If the database and transactional log file backups are carried out, the Shrink Database task may not be required.

** Except the night on which the full database is backed up.