How to fix duplicate row problems when loading Insight's DB2 Application detail archive tables?
search cancel

How to fix duplicate row problems when loading Insight's DB2 Application detail archive tables?


Article ID: 50218


Updated On:


RC Compare for DB2 for z/OS Bind Analyzer for DB2 for z/OS SQL-Ease for DB2 for z/OS SYSVIEW Performance Management Option for DB2 for z/OS Plan Analyzer for DB2 for z/OS Subsystem Analyzer for DB2 for z/OS Database Analyzer for DB2 for z/OS Fast Unload for DB2 for z/OS Fast Check for DB2 for z/OS Fast Index for DB2 for z/OS Rapid Reorg for DB2 for z/OS



The DB2 load utility encounters duplicate rows loading the CA Insight Database Performance Monitor for DB2 for z/OS (IDB2) application detail archive tables when the rows are not really duplicates. The tables that can be affected by this problem are: APPLICATION_DETAIL, APPL_BP_DETAIL, APPL_DDF_DETAIL, APPL_GBP_DETAIL and APPL_PGM_DETAIL.


The thread end time store clock values for the two threads are different but when converted result in the same timestamp value. This timestamp value is used for the table's END_DATE_TIME TIMESTAMP column which is included as a key column in the table's UNIQUE INDEX. For example, the following two STCK values convert to the same timestamp value:

Accounting record QWACESC STCK          Converted to timestamp
C7FCB78E315665C9                        2011-06-27-
C7FCB78E31566A86                        2011-06-27-


There are two possible solutions that will resolve this problem for future archival executions.

  1. The simplest solution would be to Drop the UNIQUE INDEX and recreate it as non-unique. This opens up the possibility that truly duplicate data could be accidentally loaded to the DB2 table. Having in place a pretty rigid archival process is needed to avoid this possibility.

  2. A slightly more involved solution would be to add a new column to the UNIQUE INDEX key that is based on the value of Insight field IFCID-SEQ-NUM. The following will need to be done:

    1. Modify the associated archive IQL member and add field IFCID-SEQ-NUM as the last field with formatting as a fifteen digit decimal number. Insert this line prior to the OUTFILE statement. For example:

      IFCID-SEQ-NUM (OF=P15.0)

    2. Run the following ALTER TABLE DDL statement for the associated archive table.

      ALTER TABLE <creator>.<archive_table_name>

  3. Run a DROP INDEX DDL statement to drop the associated UNIQUE INDEX.

  4. Modify the CREATE INDEX DDL for the associated INDEX and add the IFCID_SEQ_NUM to the index column list. Run the CREATE UNIQUE INDEX DDL statement.

  5. Modify the associated load utility control statements. Change the closing parenthesis in the field definition list to a comma and insert the following as the next line:


  6. For future archival executions run the Insight report and DB2 load utility job using the modified IQL and DB2 load utility control statements.

Note: Adding IFCID-SEQ-NUM as the last field in the IQL and DB2 Load utility control statements saves having to update all the POSITION parameters in the DB2 load utility control statements.

Please be aware that if you chose to add the new column to the TABLE and UNIQUE INDEX you will need to modify the migration procedure(s) that will be supplied with a future release.

The solution to add the column to the table and unique index will be permanently implemented in a future release when DB2 V10 support is added to the archive tables.


Component: IDB2