Maintenance of SQL Database

Last modified by Dennis Knudsen on 2024/04/03 11:25

It's important to maintain the IMPACT Database so it doesn't get slow over time. One way to do this is to create a maintenance plan for rebuilding the index and updating the statistics.

NOTE: It requires a Standard SQL version to be able to make maintenance plans.

1) Start by selecting the Maintenance Plan Wizard" by right-clicking on the Maintenance Plans under the Management folder.

1712131225467-450.png

2) Click Next in the first dialogue box

1712131307599-204.png

3) Start by giving the maintenance plan a name and set the schedule for when the plan should be executed.

1712131412208-294.png

4) Start by setting how frequently the maintenance plan should run (In this example - Daily at 01:00) and the first and last date for the plan (No end date) and finish with OK and thereafter next.

1712131537374-121.png

5) Check the "Rebuild Index" and "Update Statistics" for the tasks to perform and click next.

1712133936779-959.png

6) Select what order the tasks should be performed. 

1712134103935-200.png

7) Select the IMPACT database so the task only gets performed on that specific database.

1712134388917-476.png

8) And then configure the Index Stats Options for when the rebuild should happen and click next.

1712134414124-747.png

9) Select the same database for the update statistics task and keep the default values and click next.

1712134635321-658.png

10) Select if there should be a report of the tasks and where it should be saved (The default is checked) and click next.

1712134725840-479.png

11) The maintenance plan is now configured and click finish to enable it and there after close.

1712135610386-750.png

1712135622700-275.png

12) The Plan is now enabled and will run according to the configuration.

1712135674372-883.png

13) It's also possible to "test" the plan by right-clicking and click Execute. Executing might take some time depending on the server specifications and the database size.

1712135694215-632.png

14) To check if the plan has been executed should the Index be rebuilt on the tables in the IMPACT database. Check the Index of dob.IMP_ELEMENT to see the index value. The Value should be as low as possible.

1712136213564-424.png

1712136294254-283.png