Watchdoc - Watchdocstats database maintenance plan
Introduction
In Watchdoc, the tool usage statistics are saved in an SQL database named Watchdocstats by default.
As the database evolves and data varies, query processing may slow down over time due to index fragmentation. To avoid this issue, we recommend that you regularly clean up your database by following the maintenance plan provided.
This SQL database has no default maintenance plan. It is therefore necessary to design a maintenance plan using a SQL query that can be executed by a script (cf. script model to download).
It is recommended to execute this script every week.
Procedure
-
on the server (on which Watchdoc is installed or on the MS SQL® server), open a text editor (like MS Notepad®) ;
-
enter the following script:
Sqlcmd –e -i C:\BackupDATA\WDmaintenance.sql -o C:\BackupDATA\logs.txtIn the code :
-
the path of the -i argument specifies the location of the maintenance script;
-
the path of the -o argument specifies the location where the logs will be recorded.
-
-
Save the file in ‘.bat’ format.
-
Click on the .bat file to start maintenance.
Detail of the WDmaintenance.sql script
The maintenance script performs:
-
a backup of the database ;
-
a purge of data older than 2 years;
-
a reorganization of the indexes;
-
possibly a defragmentation of the database.

Download the .txt script