IBM Books

Replication Guide and Reference


The Journal

DPROPR/400 uses the information that it receives from the journals about changes to the data to populate the DPROPR/400 CD and UOW tables for replication.

DPROPR/400 runs under commitment control for most operations and therefore requires journaling on the control tables. (The QSQJRN journal is created when the CRTDPRTBL command creates a collection.)

Administrators must manually create the QSQJRN journal in the library that contains the replication source control tables and the library that contains the target tables. It is also the administrator's responsibility to ensure that all the source tables are journaled correctly.

Remote journal function

In previous versions of DPROPR/400, replication source definitions (including the control tables associated with a source) and the Capture program always resided on the same system. The remote journal function makes it possible to move the replication source definitions and the Capture program and its control tables away from the system on which the source tables reside, leaving more resources available on that system. With the remote journal function, processor usage can be lowered, DASD can be saved, and performance can be improved significantly.

Important: The intention of this type of setup is to have the replication source definitions on the same AS/400 system as the replication target.

A replication source definition that refers to a remote source table cannot be subscribed to by other platforms such as the Apply program for OS/390 or the Apply program for UNIX.

For more information about the remote journal function, see AS/400 Remote Journal Function for High Availability and Data Replication, SG24-5189.

Creating journals for source tables

To set up the source table journals, you must have the authority to create journals and journal receivers for the source tables to be defined.

Important: Use a different journal for the source tables than one of those created by DPROPR/400 (QSQJRN journals) in the ASN library, the source library, the control library, or the target library.

To create a source table journal:

  1. Create a journal receiver in a library of your choice using the Create Journal Receiver (CRTJRNRCV) command. The following example uses a library named JRNLIB for journal receivers.
    CRTJRNRCV  JRNRCV(JRNLIB/RCV0001)
               THRESHOLD(50000)
               TEXT('DataPropagator Relational Journal Receiver')
     
    

    Be sure to:

  2. Create the journal by using the Create Journal (CRTJRN) command:
    CRTJRN  JRN(JRNLIB/DJRN1)
            JRNRCV(JRNLIB/RCV0001)
            MNGRCV(*SYSTEM) DLTRCV(*YES)
            TEXT('DataPropagator Relational Journal')
     
    

    Be sure to:

    You can use two values on the RCVSIZOPT parameter of the CRTJRN command (*RMVINTENT and *MINFIXLEN) to optimize your storage availability and system performance. See the AS/400 Programming: Performance Tools Guide for more information.

  3. Start journaling the source table using the Start Journal Physical File (STRJRNPF) command, as in the following example:
    STRJRNPF FILE(library/file)
             JRN(JRNLIB/DJRN1)
             OMTJRNE(*OPNCLO)
             IMAGES(*BOTH)
     
    
    Specify the name of the journal that you created in step 2. The Capture program requires a value of *BOTH for the IMAGES parameter.

Managing journals and journal receivers

The Capture program uses the Receive Journal Entry (RCVJRNE) command to receive journals.

Specifying system management of journal receivers

It is recommended that you let the AS/400 system manage the changing of journal receivers. This is called system change journal management. Specify MNGRCV(*SYSTEM) when you create the journal, or change the journal to that value. If you use system change journal management support, you must create a journal receiver that specifies the threshold at which you want the system to change journal receivers. The threshold must be at least 5000 KB, and should be based on the number of transactions on your system. The system automatically detaches the receiver when it reaches the threshold size and creates and attaches a new journal receiver, if it can.

Specifying user management of journal receivers

If you specify MNGRCV(*USER) when you create the journal (meaning you want to manage changing your own journal receivers), a message is sent to the journal's message queue when the journal receiver reaches a storage threshold, if one was specified for the receiver.

Use the CHGJRN command to detach the old journal receiver and attach a new one. This command prevents Entry not journaled error conditions and limits the amount of storage space that the journal uses. To avoid affecting performance, do this at a time when the system is not at maximum use.

You can switch journal receiver management back to the system by specifying CHGJRN MNGRCV(*SYSTEM).

You should regularly detach the current journal receiver and attach a new one for two reasons:

The default message queue for a journal is QSYSOPR. If you have a large volume of messages in the QSYSOPR message queue, you might want to associate a different message queue, such as DPRUSRMSG, with the journal. You can use a message handling program to monitor the DPRUSRMSG message queue. For an explanation of messages that can be sent to the journal message queue, see OS/400 Backup and Recovery.

The delete journal receiver exit routine

When you install DPROPR/400 on a V4R2 (or later) system, a delete journal receiver exit routine (DLTJRNRCV) is registered automatically. This exit routine is called any time a journal receiver is deleted, whether or not it is used for journaling the source tables. This exit routine determines whether or not a journal receiver can be deleted. (You no longer need to do this manually. Nor do you need to use the ANZDPRJRN command to delete old receivers.)

To take advantage of the delete journal receiver exit routine and leave journal management to the system, specify DLTRCV(*YES) and MNGRCV(*SYSTEM) on the CHGJRN or CRTJRN command.

If the journal that the receiver is associated with has no association with any of the source tables, this exit routine approves the deletion of the receiver.

If the journal receiver is used by one or more source tables, this exit routine makes sure that the receiver being deleted does not contain entries that have not been processed by the Capture program. The exit routine disapproves the deletion of the receiver if the Capture program still needs to process entries on that receiver.

If you must delete a journal receiver and the delete journal receiver exit routine does not approve the deletion, specify DLTJRNRCV DLTOPT(*IGNEXITPGM) to override the exit routine.

Removing the delete journal receiver exit routine 

If you want to handle the deletion of journal receivers manually, you can remove the delete journal receiver exit routine by issuing the following command:

RMVEXITPGM EXITPNT (QIBM_QJO_DLT_JRNRCV)
           FORMAT(DRVC0100)
           PGMNBR(value)
 

To determine the PGMNBR value for the RMVEXITPGM command:

  1. Issue the WRKREGINF command.

  2. On the Work with Registration Information window, find the entry for exit point QIBM_QJO_DLT_JRNRCV. Enter 8 in the Opt field.

  3. On the Work with Exit Programs window, find the entry for Exit Program QZSNDREP in library QDPR. The number that you need is under the Exit Program Number heading.

Registering the delete journal receiver exit routine for upgraded systems 

If the 5769DP2 version of DPROPR/400 was installed on V4R1 and the operating system was upgraded to V4R2 or V4R3 without reinstalling the product, you must register the exit routine with this command:

ADDEXITPGM EXITPNT(QIBM_QJO_DLT_JRNRCV)
           FORMAT(DRCV0100)
           PGMNBR(value *LOW)
           CRTEXITPNT(*NO)
           PGM(QDPR/QZSNDREP)
 

Determining the progress of the Capture program

To determine the progress of the Capture program, you must either determine how much work remains between the last Capture process that was performed and the last Apply process, or use the DJRA Replication Monitor.

If the Capture program has ended, you can determine its progress by inspecting the warm start table. There is one row for each journal used by the source tables. The LOGMARKER column provides the timestamp of the last journal entry processed successfully. The SEQNBR column provides the journal entry sequence number of that entry.

If the Capture program is still running, you can determine its progress by completing the following tasks:

  1. For each source table being captured, find its CD table.

  2. In the last row of the CD table, note the hex value in the IBMSNAP_UOWID column.

  3. Look in the UOW table for a row with the same IBMSNAP_UOWID value. If no matching IBMSNAP_UOWID exists in the UOW table, repeat the same process with the second-to-last row in the CD table. Proceed backward through the CD table until you find a match.

  4. When you find a matching IBMSNAP_UOWID, note the value in the IBMSNAP_LOGMARKER column of the UOW row. This is the timestamp of the processed journal entry. All changes to the source table up to that time are ready to be applied.

  5. Use the Display Journal (DSPJRN) command to determine how many journal entries remain to be processed by the Capture program. Direct the output to an output file (or to a printer for a printed report), as shown in the following example:
    DSPJRN FILE(JRNLIB/DJRN1)
           RCVRNG(*CURCHAIN)
           FROMTIME(timestamp)
           TOTIME(*LAST)
           JRNCDE(J F R C)
           OUTPUT(*OUTFILE)
           ENTDTALEN(1) OUTFILE(library/outfile)
     
    

    In the example, timestamp is the timestamp that you identified in step 4.

    The number of records in the output file is the approximate number of journal entries that remain to be processed by the Capture program.

Defining replication sources and subscription sets

Before you define source tables as replication sources with DPROPR/400, you must be authorized to the DPROPR/400 control tables.

There are no DPROPR/400 commands for defining replication sources and subscription sets. Use the DB2 DataJoiner Replication Administration tool (DJRA) to define replication sources and subscription sets. Before you define a table as a replication source, the source table must be journaled for both before-images and after-images, and the library where the CD table is created must have a QSQJRN journal.

When you define tables as replication sources, the CCSID attributes of CHAR, VARCHAR, GRAPHIC, and VARGRAPHIC columns in the CD table must be the same as the CCSID column attributes of the source table.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]