The 'movehistorydata' cli command does not seem working

Document ID : KB000009127
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

Data are not moving to the staging tables despite a housekeeping job succeeds.

This job has the cli script with the 'movehistorydata' command to run, but after the completion, no new records appear in the staging tables, nor records are moved from the history tables.

Cause:

The cause of the problem could be seen in the DE log files, for instance, in the tracelog, similar to this:

20180103 23:55:04.426 [essential] [ERROR] asyncMoveHistoryDataToStageTable: [2018-01-03_23:55:04.426] move data olrder than Sun Dec 03 23:55:04 EST 2017 fail. 
com.ca.wa.core.engine.rdbms.DatabaseException: java.sql.SQLIntegrityConstraintViolationException: 
ORA-00001: unique constraint (CASAPP.XAK1H_APPLICATION) violated ... 

Hence, no transactions are made due to this exception.

Resolution:

Try to remove records in the staging tables manually.

For example (Oracle based):

delete from H_APPLICATION cascaded 
where APPL_ID IN 
(select h.appl_id 
from 
ESP_APPLICATION E, 
H_APPLICATION H 
where 
E.JOB_NAME = H.JOB_NAME 
AND E.APPL_NAME = H.APPL_NAME 
AND E.APPL_GEN_NO = H.APPL_GEN_NO 
);