Configuring the Transaction Logs for Oracle GoldenGate

To capture DML operations, Oracle GoldenGatereads the Db2 LUW online logs by default. However, it reads the archived logs if an online log is not available. To ensure the continuity and integrity of Oracle GoldenGateprocessing, configure the logs as follows.

Retaining the Transaction Logs

Configure the database to retain the transaction logs for roll forward recovery by enabling one of the following parameter sets, depending on the database version.

  • Db2 LUW 10.1 and later:

    Set the LOGARCHMETH parameters as follows:

    • Set LOGARCHMETH1 to LOGRETAIN.

    • Set LOGARCHMETH2 to OFF.

    Alternatively, you can use any other LOGARCHMETH options, as long as forward recovery is enabled. For example, the following is valid:

    • Set LOGARCHMETH1 to DISK.

    • Set LOGARCHMETH2 to TSM.

To determine the log retention parameters:

  1. Connect to the database.

    db2 connect to database user username using password 
    
  2. Get the database name.

    db2 list db directory 
    
  3. Get the database configuration for the database.

    db2 get db cfg for database 
    

    The fields to view are:

    Log retain for recovery status = RECOVERY 
    User exit for logging status = YES 
    

To set the log retention parameters:

  1. Issue one of the following commands.

    To enable USEREXIT:

    db2 update db cfg for database using USEREXIT ON 
    

    If not using USEREXIT, use this command:

    db2 update db cfg for database using LOGRETAIN RECOVERY 
    

    To set LOGARCHMETH:

    db2 update db cfg for database using LOGARCHMETH1 LOGRETAIN 
    db2 update db cfg for database using LOGARCHMETH2 OFF 
    
  2. Make a full backup of the database by issuing the following command.
    db2 backup db database to device
    
  3. Place the backup in a directory to which Db2 LUW has access rights. If you get the following message, contact your systems administrator:
    SQL2061N An attempt to access media "device" is denied. 
    

Specifying the Archive Path

Set the Db2 LUW OVERFLOWLOGPATH parameter to the archive log directory. The node attaches automatically to the path variable that you specify.

db2 connect to database
db2 update db cfg using overflowlogpath "path" 

Exclude the node itself from the path. For example, if the full path to the archive log directory is /sdb2logarch/oltpods1/archive/OLTPODS1/NODE0000, then the OVERFLOWLOGPATH value should be specified as /sdb2logarch/oltpods1/archive/OLTPODS1.