Replication Agent for UDB behavior

The following Replication Agent issues are unique to Replication Agent for UDB:

Marking tables immediately after resume when LTM locator is zero

When the Replication Agent instance goes to Replicating state, the Log Reader component reads the primary database transaction log and uses the value of the origin queue ID to determine the position in the log to start reading. When the value of the LTM locator is 0 (zero), the Log Reader starts reading at the end of the log.

Because the Log Reader’s operation is asynchronous, the Replication Agent instance can return to the operating system prompt after the resume command but before the Log Reader has completed its start-up process. If you immediately invoke the pdb_setreptable command to mark a table for replication after the resume command returns, the mark object entry can be placed in the transaction log before the Log Reader finds the end of the log. In that event, the Log Reader misses the mark table entry, and table marking fails.

To avoid this problem, wait 5 to 10 seconds after invoking the resume command before invoking the pdb_setreptable command to mark a table.

Marking or unmarking all tables simultaneously

Marking or unmarking all tables at once in the primary database using pdb_setreptable all, mark or pdb_setreptable all, unmark is not supported in Replication Agent for UDB. You must mark or unmark each table individually.

Forcing applications off the database

The DB2 FORCE APPLICATION command causes the data server to drop its connections with an application. The FORCE APPLICATION ALL command causes the data server to drop its connections with all applications.

If you invoke the FORCE APPLICATION command and specify either the Replication Agent application handle or the ALL keyword, the data server drops its connections with the Replication Agent instance. In that event, the Replication Agent receives DB2 error code -30081 and cannot recover, so the Replication Agent instance shuts itself down.

To avoid this situation, invoke the Replication Agent shutdown command before using the DB2 FORCE APPLICATION command.

Determining read buffer size

The Replication Agent for UDB LogReader component uses the value of the max_ops_per_scan parameter to determine the maximum number of bytes to be read from the transaction log during each scan. Because the LogReader reads bytes, it requires a buffer to store the bytes read.

The LogReader component determines the maximum size of this buffer by multiplying the value of the max_ops_per_scan parameter by 10. For example, if the value of the max_ops_per_scan parameter is 1000 (the default), the size of the LogReader read buffer is 10,000 bytes.

It is very difficult to identify a minimum buffer size that will always work. The value range of max_ops_per_scan is 25 to 2,147,483,647, which means the smallest size of the buffer is 250 bytes.

If the read buffer size is too small to read one operation, LogReader shuts down the Replication Agent instance and reports a -30081 error. Unfortunately, this error message covers general communication errors, not just an insufficient buffer size.

Replicating LOBs

To replicate large-object columns of a marked table that also contains GRAPHIC or VARGRAPHIC columns, Replication Agent for UDB requires that the table have a primary key.