Log of LOAD RESUME LOG YES and LOAD REPLACE LOG YES actions
A LOAD RESUME YES LOG YES action causes your Db2 Load utility to add new rows to an existing Db2 table.
Under normal circumstances, the Db2 log contains a log record for each row that is added to the table. For a LOAD RESUME LOG YES action, the Db2 log contains a log record for each page of rows that are added to the table.
The log record for at least one page might contain both rows that were loaded in the LOAD RESUME action, and rows that existed in the table before the LOAD RESUME action (if the pre-existing rows were on the same page as the rows that were loaded).
The Db2 log does not distinguish the loaded rows from the pre-existing rows. If you generate SQL based on the LOAD RESUME log records, Log Master processes both the loaded rows and the pre-existing rows.
This scenario can also occur with log records that represent a LOAD REPLACE LOG YES action. In some cases, when a load action includes a very large number of rows, Db2 internally divides the load action into separate units of recovery. If the log record for a page of rows is not complete in one unit of recovery, the next unit of recovery includes the complete page, starting from the beginning. Any rows that were written in the previous unit of recovery are duplicated in the next unit.
For both LOAD RESUME LOG YES and LOAD REPLACE LOG YES actions, the following results can occur:
- For UNDO SQL, the generated SQL can contain extra DELETE statements.
- For REDO or MIGRATE SQL, the generated SQL can contain extra INSERT statements. When you execute the extra INSERT statements against a table with a unique key, they fail with SQL code -803.
To resolve this situation, edit the generated SQL to remove the extra INSERT or DELETE statements.
Related topic