Automating tasks with the Administrative Task Scheduler (ATS) for the Db2 service

You can use the Db2 Administrative Task Scheduler (ATS) command-line interface to manage diagnostic log files.

You can manage the following tasks by using the ATS command-line interface.

Task Parameter Description
Clean up log files DIAGPATH_CLEANUP Cleans up log files in the log file directory DIAGPATH, by archiving FODC and dump.bin files and folders that are older than two weeks, and deleting the archives that are older than two weeks. This task is scheduled by default.

Before you begin

Set up the properties for each task in the appropriate configmap. If you want to change the default values, run the oc edit cm db2u-ats -n cpd-operators command to edit the configmap. You can edit the parameters of the task by editing its configmap.

The configmap has the following structure:
SCHEDULE <cron schedule> 
PROCEDURE_SCHEMA  <task schedule>  -- default 'DB2INST1'
PROCEDURE_NAME <task stored procedure name>
REMARKS <short description of the task> -- optional

Adding or scheduling a task

To add or schedule a task, run the following command.

db2_ats task add --name <TASK_NAME> --dbname <DB_NAME>

Removing a scheduled task

To remove a task, run the following command.

db2_ats task remove --name <TASK_NAME> --dbname <DB_NAME>

Updating a task

To update a task, run the following command.

db2_ats task update --name <TASK_NAME> --dbname <DB_NAME>

Listing tasks

To list the currently scheduled tasks, run the following command.

db2_ats task list --dbname=<DB_NAME>

To list a specific task, run the following command.

db2_ats task list --name=<TASK_NAME> --dbname=<DB_NAME>