Manage regular maintenance tasks

Periodically, a set of maintenance tasks are executed. These tasks deal with database organization and information life cycle management.

The best practice is to schedule a maintenance execution at least once a week. Maintenance tasks can be executed on demand. It is possible to execute all maintenance tasks when the parameter tasks is omitted, or specific ones such as:

dstools maintenance –timeout 60

The timeout parameter is used to limit maintenance task execution to a predefined maintenance window. When the timeout occurs, the system continues with the next maintenance execution.

Purge expired information

Most of Datastore's query results are cached using dedicated database objects.

The query results expire when the lifetime set during the query definition ends.

When a query result expires, it must be removed from the database using the maintenance task: CLEAN_CACHE_ENTRIES

To purge expired information, execute periodically the following maintenance task: dstools -maintenance -tasks CLEAN_CACHE_ENTRIES

Note   A timeout parameter can be used to fit the execution time in the maintenance window.

The maintenance task drops a query cache table after a waiting period defined by the parameter AdminGUI / Maintenance cache retention delay.

Purge wrong information

When the injection fails, injected information is stored in the database but can not be reached by queries. This wrong information must be purged to release the corresponding allocations.

To purge wrong information, execute the following maintenance task: dstools -maintenance -tasks CLEAN_COLLECTION

Note   A timeout parameter can be used to fit the execution time in the maintenance window.

Information Lifecycle

Online and Retention periods drive lifecycle processes:

After the online period is over, the maintenance task UNMOUNT backs up partitions into the BACKUP database server directory.

The unmount partition date is equal to the maximum date amongst all collection dates and object dates contained in the partition, plus the online period.

The purging partition date takes into account the collection dates and also the object dates of the records contained in the partition.

The purging partition date is equal to the maximum date among all collection dates and object dates contained in the partition, plus the retention period.

The purging partition date is not recalculated when a partition is remounted.

The database backup process must first secure the files. Then, a commitment file is created by the backing process into the COMMITMENT directory.

Note   The database backup process administrator integrates the backup of the produced file and the generation of the commitment file.

The maintenance task CARVE drops the tables and views of one partition: the partition that has the corresponding commitment file in the COMMITMENT directory. The partition is stated as OFFLINE.

Restore a partition

To restore a partition:

  • Put the backup file in the RESTORE_DIRECTORY database server folder
  • Use the service Mount partition of the Partition Management to plan the restoration of the partition:
  • dstools partition –mount --partition PARTITION --online 6M
  • Use the maintenance task MOUNT to perform the restoration.

When the retention period is over, the maintenance task PURGE purges partitions.

The backup can be mounted to make a partition available for queries.

Administration parameters define folders names. The database administrator must grant read/write permission on this folder to the Datastore Runtime Main database user.

Note   When the online period is equal to the retention period, partitions are purged without being backed-up.

Create directories and grant permissions


You can use scripts to create directories and grant permission to the Datastore Runtime Main database user (test site only).

Note   This service is reserved only for Oracle database

Create the directories

Create the following directories in Oracle:

  • BACKUP: Contains the backup files which consist of the exported partitions table.
  • TMP: Used by the maintenance process to temporarily store the backup files.
  • COMMITMENT: Contains the commitment files stating that the backup succeeded. The committed file name must be the same as the backup file name with the extension .cmt
  • RESTORE: Contains the backup used to remount the partition
  • LOG: Contains the log files of the maintenance process

Create and declare the directories

To create and declare the directories:

  • Create the directories in the file system
  • Declare and give the rights in Oracle using the following sql commands:
  • create or replace directory XXX_DIRECTORY as 'DIRECTORY_PATH'
    • XXX_DIRECTORY is the name given by the user to one of the directories.
    • DIRECTORY_PATH is the path to the directory created in the file system.
  • grant READ, WRITE on directory XXX_DIRECTORY to MAIN_USER
    • MAIN_USER is the Datastore Runtime main database user.
  • Define the following parameters in Administration. The parameters must have the value of the directory names given by the user XXX_DIRECTORY:
    • Backup directory
    • Temporary directory
    • Commitment directory
    • Restore directory
    • Log directory

Related Links