8 Using Remote Journal

This chapter contains instructions for remote journal preparation and adding a remote journal. Remote Journal support in the IBM DB2 for i operating system provides the ability for a system to replicate, in its entirety, a sequence of journal entries from one DB2 for i system to another. Once setup, this replication is handled automatically and transparently by the operating system. The entries that are replicated are placed in a journal on the target system that is available to be read by an application in the same way as on the source system.

You must have an understanding of how to setup and use remote journaling on an DB2 for i system to use this feature with Oracle GoldenGate. There are no special software requirements for either Oracle GoldenGate or the DB2 for i systems to use remote journaling.

Topics:

Preparing to Use Remote Journals

Before establishing the remote journal environment, complete the following steps:

  1. Determine the extent of your remote journal network or environment.
  2. Library redirection is the ability to allow the remote journal and associated journal receivers to reside in different libraries on the target system from the corresponding source journal and its associated journal receivers.

    Determine what library redirection, if any, you will be using for the remote journals and associated journal receivers.

  3. Ensure that all selected libraries exist on the target systems. You must consider whether or not library redirection will be used when adding the remote journal.
  4. Create the appropriate local journal if it does not already exist.
  5. Configure and activate the communications protocol you have chosen to use.
  6. After you have configured the communications protocol, it must be active while you are using the remote journal function.

    For example, if you are using the OptiConnect for IBM i bus transport method, then the OptiConnect for IBM i subsystem, QSOC, must be active. QSOC must be active for both the source system and the target system, and the appropriate controllers and devices must be varied on. If you are using a SNA communications transport, vary on the appropriate line, controller, and devices and ensure subsystem QCMN is active on both systems. Start of change If you are using TCP/IP or Sockets IPv6, you must start TCP/IP by using the Start TCP/IP (STRTCP) command, including the distributed data management (DDM) servers. If you are using data port, you must configure a cluster, make sure that the cluster is active, and start the internet Daemon (inetd) server using the Start TCP/IP Server (STRTCPSVR) command.End of change

  7. If one does not already exist, create the appropriate relational database (RDB) directory entry that will be used to define the communications protocol for the remote journal environment. When TCP communications are being used to connect to an independent disk pool, the RDB entry to the independent disk pool must have the Relational database value set to the target system's local RDB entry and the relational database alias value set to the independent disk pool's name.
  8. Now you should be able to see the remote database connection by issuing the WRKRDBDIRE command.
     Work with Relational Database Directory Entries
     
     Position to . . . . . .
     
     Type options, press Enter.
       1=Add 2=Change 4=Remove 5=Display details 6=Print details
     
                                 Remote
     Option Entry Location Text
     
             SYS1 system1
             SYS2 system2
             MYSYSTEM *LOCAL Entry added by system
             
             
              
              
     
     
     
     
                                                                             Bottom
     F3=Exit F5=Refresh F6=Print list F12=Cancel F22=Display entire field
     (C) COPYRIGHT IBM CORP. 1980, 2007.

Adding a Remote Journal

Adding a remote journal creates a remote journal on a target system or independent disk pool and associates that remote journal with the journal on the source system. This occurs if this is the first time the remote journal is being established for a journal. The journal on the source system can be either a local or remote journal.

If a remote journal environment has previously been established, adding a remote journal reassociates the remote journal on the target system with the journal on the source system.

You can establish and associate a remote journal on a target system with a journal on the source system by one of the following methods:

  • System i Navigator.

  • Add the Remote Journal (QjoAddRemoteJournal) API on the source system.

  • Add the Remote Journal (ADDRMTJRN) command on the source system.

What Happens During Add Remote Journal Processing?

The processing that takes place as part of adding a remote journal includes the following:

  • A check is performed on the target system to verify that the user profile adding the remote journal exists. A user profile with the same name as the user profile which is adding a remote journal must exist on the target system. If the profile does not exist on the target system, then an exception is signaled, and the processing ends.

  • A check is performed to verify that the target system has a library by the same name as the library for the journal on the source system. If the library does not exist on the target system, then an exception is signaled, and the processing ends.

  • A check is performed on the target system to determine if a journal by the same qualified name as the journal on the source system already exists. If a journal already exists, it can be used for the remainder of the add remote journal processing if it meets the following criteria:

    1. It is a remote journal.

    2. It was previously associated with this same source journal or part of the same remote journal network.

    3. The type of the remote journal matches the specified remote journal type.

  • If a journal was found, but does not meet the preceding criteria, then an exception is signaled, and the processing ends. Otherwise, the remote journal is used for the rest of the add remote journal processing.

  • If no journal is found on the specified target system, then a remote journal is created on the target system. The new remote journal has the same configuration, authority, and audit characteristics of the source journal. The journal that is created has a journal type of *REMOTE.

When adding the remote journal, you must specify the type of remote journal to add. The remote journal type influences the library redirection rules and other operational characteristics for the journal.

Guidelines For Adding a Remote Journal

You should observe the following guidelines for adding a remote journal:

  • You can only associate a remote journal with a single source journal.

    Note: The same remote journal can then have additional remote journals that are associated with it that are located on other target systems. This is the cascade configuration that is shown in Network configurations for remote journals.

  • The remote journal will only have its attached receiver populated with journal entries that are replicated from the corresponding journal receiver on the source system. No journal entries can be directly deposited to a remote journal.

  • A maximum of 255 remote journals can be associated with a single journal on a source system. This can be any combination of asynchronously maintained or synchronously maintained remote journals.

To Add a Remote Journal

The following is an example using the physical file QGPL/TESTPF setup to have remote journaling enabled to a second system.

  1. Create the physical file.:
    > CRTPF FILE(QGPL/TESTPF) RCDLEN(10) 
      File TESTPF created in library QGPL.
      Member TESTPF added to file TESTPF in QGPL.
    
  2. Create the local journal receiver and journals, and enable the journaling of the physical file created:
    > crtjrnrcv jrnrcv(qgpl/jrcvrmt)
      Journal receiver JRCVRMT created in library QGPL
    
    > crtjrn jrn(qgpl/jrnrmt) jrnrcv(qgpl/jrcvrmt) fixlendta(*job *usr *pgm *sysseq)
      Journal JRNRMT created in library QGPL
    
    strjrnpf file(qgpl/testpf) jrn(qgpl/testpf)
      1 of 1 files have started journaling
    
  3. Add the remote journal:
    > addrmtjrn rdb(sys2) srcjrn(qgpl/JRNRMT) rmtjrntype(*TYPE2)
      Remote journal JRNRMT in QGPL was added
    
  4. Activate the remote journaling:
    > chgrmtjrn rbd(sys2) srcjrn(qgpl/jrnrmt) jrnstate(*active)
      Remote journal JRNRMT in library QGPL was activated