DataLoader/MX Reference Manual (H06.03+, J06.03+)
Recovery Strategies
DataLoader/MX Reference Manual—543544-001
7-6
Restarting From a Known State
At successful completion of the load job, the program increments the LOAD_ID in the
parameter file or table.
The LOAD_ID field can serve another purpose. It enables you to query the database to
determine which rows were and were not altered in the latest load run.
Generally, restarting from an unknown state is not the best recovery strategy when
multiple updates to a record can occur in a single load job. The previous example
could be extended to accommodate multiple updates by adding another column called
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










