Create maintenance plan for reindexing

Defragmentation of the database indices is fundamental for the performance of the database. To do this, create a maintenance plan in Microsoft SQL Management Studio using the Maintenance Planning Wizard.

Instructions:

  1. Enter a name for the maintenance plan and click Change... to create a schedule:

  2. Set the frequency to Daily and the time so that it does not clash with any other job:

  3. Click on OK and then on Next

  4. In the next dialog, select the Create new maintenance task index:

  5. Click on Next

  6. Select the databases to be defragmented. Depending on the MSSQL Server version, filters are active in this window. For example, the job is only executed from 30% fragmentation. Deactivate all filters here so that the job is always executed at the specified time.

  7. Click on Next

  8. In the last step, select a directory to which the log files are to be written

  9. Click on Finish

  10. Run the job manually once to check