Deleting expired monitor data

You can delete expired monitor data from the repository database.

About this task

Db2® Data Management Console retains monitor data based on the value that is specified in the Keep data for field in the Monitoring profile page and automatically deletes the monitor data that is older than this value. If for some reason, the expired monitor data is not deleted by the console, you can do a manual cleanup by using the deleteRepoData_expired.sh script.
Note: The deleteRepoData_expired.sh script is available as of Db2 Data Management Console version 3.1.10 and later release. Users of earlier versions can either upgrade to the latest release or download the latest build, extract it, and find this script file in the following location: <download_directory>/dsutil/bin/deleteRepoData4DeletedConnection.sh

Procedure

To delete expired monitor data, do the following steps:

  1. Go to <DMC_install_directory>/dsutil/bin directory.
  2. Copy the script deleteRepoData_expired.sh to the repository database location.
  3. Edit the script and configure parameters:
    • repodb- the name of repository database.
    • schema- the name of schema that was used when you configured the repository database. IBMCONSOLE is the default schema.
    • size- the number of records to be deleted in each cycle. Default size is 512.
    • sql_size- the number of sql_dim data deleted in a batch. Default size is 1
    • conn_int- the dbconn_int value of target monitor database. It can be found in IBMCONSOLE.rtmon_map_dbconn
    • expired_time- the timestamp boundary value for expired data. The data before the expiration time is deleted.

    For example,

    repodb=repodb
    schema=ibmconsole
    size=512
    sql_size=1
    conn_int=1
    expired_time=1640966400000
  4. From the command line, run the script.
    ./deleteRepoData_expired.sh
    Note: The deleteRepoData_expired.sh script can be run by a database user.