Prepare Db2 z/OS Transaction Logs for Oracle GoldenGate
Learn to configure the Db2 transaction logging to support data capture by Oracle GoldenGate Extract.
Oracle GoldenGate can capture Db2 transaction data from the active and archived logs. Follow these guidelines to configure the logs so that Extract can capture data.
To enable change capture for Oracle GoldenGate for Db2 z/OS, see Enable TRANDATA for Non-Oracle Databases
Enable Access to Log Records
Activate Db2 Monitor Trace Class 1 ("TRACE(MONITOR) CLASS(1)
") so
that Db2 allows Extract to read the active log. The default destination of
OPX
is sufficient, because Oracle GoldenGate does not use a
destination.
To Start the Trace Manually
-
Log on to Db2 as a Db2 user with the
TRACE
privilege or at leastSYSOPR
authority. -
Issue the following command:
start trace(monitor) class(1) scope(group)
To Start the Trace Automatically When Db2 is Started
Do either of the following:
-
Set
MONITOR TRACE
to "YES
" on theDSNTIPN
installation tracing panel. -
Set '
DSN6SYSP MON=YES
' in theDSNTIJUZ
installation job, as described in the Db2 UDB Installation Guide.
Note:
The primary authorization ID, or one of the secondary authorization IDs, of the ODBC
plan executor must also have the MONITOR2
privilege.
Size and Retain Logs
More data gets logged when tables are defined with DATA CAPTURE CHANGES
than when they are defined with DATA CAPTURE NONE
. If any of the
following is true, you might need to increase the number and size of the active and
archived logs.
-
Your applications generate large amounts of Db2 data.
-
Your applications have infrequent commits.
-
You expect to stop the Extract for long periods.
-
Your network is unreliable or slow.
Use the DSN6LOGP MAXARCH
system parameter in the
DSNTIJUZ
installation job to control log retention.
Retain enough log data so that Extract can start again from its checkpoints after you stop it or after an unplanned outage. Extract must have access to the log that contains the start of the oldest uncommitted unit of work and all logs after that.
If data that Extract needs during processing was not retained, either in online or archived logs, one of the following corrective actions might be required:
-
Alter Extract to capture from a later point in time for which log data is available (and accept possible data loss on the target).
-
Resynchronize the source and target tables, and then start the Oracle GoldenGate environment again.
Note:
The IBM documentation makes recommendations to improve the performance of log reads. In particular, you can use large log output buffers, large active logs, and make archives to disk.
Use Archive Logs on Tape
Oracle GoldenGate can read Db2 archive logs on tape, which will degrade performance. For example, Db2 reserves taped archives for a single recovery task. Therefore, Extract would not be able to read an archive tape that is being used to recover a table until the recovery completes. You could use DFHSM or an equivalent tool to move the archive logs seamlessly between online DASD storage and tape, but Extract will have to wait until the transfer completes. Delays in Extract processing increase the latency between source and target data.
Control Log Flushes
When reading the transaction log, Extract does not process a transaction until it captures the commit record. If the commit record is on a data block that is not full, it cannot be captured until more log activity is generated to complete the block. The API that Extract uses to read the logs only retrieves full physical data blocks.
A delay in receiving blocks that contain commits can cause latency between the source and
target data. If the applications are not generating enough log records to fill a block,
Extract generates log records by issuing SAVEPOINT
and
COMMIT
statements until the block fills up one way or the other and
is released.
In a data sharing group, each API call causes Db2 to flush the data blocks of all active members, eliminating the need for Extract to perform flushes.
To prevent Extract from performing flushes, use the Extract parameter TRANLOGOPTIONS
with the NOFLUSH
option.