DataLoader/MX Reference Manual (G06.24+)

Recovery Strategies
DataLoader/MX Reference Manual525872-002
7-6
Restarting From a Known State
RECORD_NUM, also a 32-bit integer, and having the DataLoader/MX process count
records, noting the number of the input record that the update came from:
UPDATE
SALESTABLE
SET
LOAD_ID = :CurLoadID,
RECORD_NUM = :CurRecordNum,
SALES_THIS_YEAR = SALES_THIS_YEAR + :SalesThisWeek
WHERE
LOAD_ID < :CurLoadID
AND
RECORD_NUM < :CurRecordNum
AND
PART_NUM = :PartNum
While this scenario will work, it requires space for the RECORD_NUM column.
Finally, you can create a load program that accepts a parameter that indicates whether
it is a rerun or not, and the load program executes different code each case.
Restarting From a Known State
Restarting from a known state has fewer limitations than restarting from an unknown
state and requires no specific application coding to implement. This method has two
limitations:
The table must be under TMF protection
The input data to the load must be available again in exactly the same order
TMF is crucial to restarting from a known state. If you specify the -T parameter when
you run DataLoader/MX, TMF packages changes to the table in transactions. If a
failure occurs, TMF rolls back changes made since the last committed transaction,
putting the table into a known state.
To determine the last transaction performed and at what point the restart should begin,
you can request that DataLoader/MX keep information about the last committed
transaction. That transaction is the one that defines the state of the table in a restart
file. The syntax is:
-T=num(restartfile=restart-file)
DataLoader/MX records information about the last committed transaction in restart-file.
When you start DataLoader/MX a second time, it checks for the existence of the restart
file. If it exists, DataLoader/MX reads the restart file, positions itself in the input file to
the record number of the input file that is recorded in the restart file, and starts normal
processing with the first record after the last one in the last committed transaction. If
the restart file does not exist, DataLoader/MX creates the restart file and starts
processing with the first record in the input.