Update WatchdocStats data base

Introduction

In Watchdoc®, the tool usage statisticsles are saved in an SQL database named Watchdocstats by default.

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

  1. on the server (on which Watchdoc is installed or on the MS SQL® server), open a text editor (like MS Notepad®) ;

  1. enter the following script:

    Sqlcmd –e -i C:\BackupDATA\WDmaintenance.sql -o C:\BackupDATA\logs.txt

    In 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.

  1. Save the file in ‘.bat’ format.

  2. Click on the .bat file to start maintenance.

Detail of the WDmaintenance.sql script

The maintenance script performs:

  1. a backup of the database ;

  2. a purge of data older than 2 years;

  3. a reorganization of the indexes;

  4. possibly a defragmentation of the database.

 


 

It may be necessary to adjust the @BdName and @BackupPath values entered by default in the script if necessary by replacing them with the name assigned to the database and the path to the backup file.