CDCRTVJRN Program Details Setting up Log-Based CDC

7 a. Native journal reading using the QJoRetrieveJournalEntries API. b. Conversion of the raw data to native SQL data and capture into the J table. c. Update of the changes count. This program accepts the parameters listed in Table 14–3 .

14.6.2.3 Installing the CDC Components on iSeries

There are two major components installed on the iSeries system to enable native journal reading: ■ The CDCRTVJRN Program. This program is provided in an archive that should installed in the iSeries system. The installation process is described below. ■ The CDC Infrastructure. It includes the standard CDC objects J tables, views, ... and the CDCRTVJRN Stored Procedure created by the JKM and used by the LKM to read journals. This stored procedure executes the CDCRTVJRN program. Installing the CDCRTVJRN Program To install the CDCRTVJRN program:

1. Identify the location the program SAVF file. It is located in the ODI_

HOMEsetupmanualcdc-iseries directory, and is also available on the Oracle Data Integrator Companion CD.

2. Connect to the iSeries system.

3. Create the default work library if it does not exist yet. You can use, for example,

the following command to create an ODILIB library: CRTLIB LIBODILIB

4. Create in this library an empty save file that has the same name as the SAVF file

mandatory. For example: CRTSAVF FILEODILIBSAVPGM0110 Table 14–3 CDCRTVJRN Program Parameters Parameter RPG Type SQL Type Description SbsTName A138 Char138 Full name of the subscribers table in the following format: Lib.Table. Example: ODILIB.SNP_SUBSCRIBERS JrnTName A138 Char138 Full name of the table for which the extract is done from the journal. Example: FINANCE.MY_COMPANY_ORDERS JrnSubscriber A50 Char50 Name of the current subscriber. It must previously have been added to the list of subscribers. LogMessages A1 Char1 Flag activating logging in a spool file. Possible values are: Y enable logging, and N to disable logging. Note: The program must be set up in a library defined in the Topology as the default work library for this iSeries data server. In the examples below, this library is called ODILIB. 8 Product TitleBookTitle as a Variable 5. Upload the local SAVF file on the iSeries system in the library and on top of the file you have just created. Make sure that the upload process is performed in binary mode. An FTP command sequence performing the upload is given below as an example. FTP 192.168.0.13 LCD oracleodisetupmanualcdc-iseries BI CD ODILIB PUT SAVPGM0110 BYE ■ Restore the objects from the save file, using the RSTOBJ command. For example: RSTOBJ OBJALL SAVLIBCDCODIRELE DEVSAVF OBJTYPEALL SAVFODILIBSAVPGM0110 RSTLIBODILIB ■ Check that the objects are correctly restored. The target library should contain a program object called CDCRTVJRN. Use the following command below to view it: WRKOBJ OBJODILIBCDCRTVJRN The CDCRTVJRN Stored Procedure This procedure is used to call the CDCRTVJRN program. It is automatically created by the JKM DB2400 Journal Simple KM when journalizing is started. Journalizing startup is described in the Change Data Capture topic. The syntax for the stored procedure is provided below for reference: create procedure ODILIB.CDCRTVJRN SbsTName char138, Qualified Subscriber Table Name JrnTName char138, Qualified Table Name Subscriber char50 , Subscriber Name LogMessages char1 Create a Log Y - Yes, N - No language rpgle external name ODILIBCDCRTVJRN

14.6.2.4 Using the CDC with the Native Journals

Once the program is installed and the CDC is setup, using the native journals consists in using the LKM DB2400 Journal to SQL to extract journalized data from the iSeries system. The retrieval process is triggered if the RETRIEVE_JOURNAL_ENTRIES option is set to true for the LKM.

14.6.2.5 Problems While Reading Journals

This section list the possibly issues when using this changed data capture method. CDCRTVJRN Program Limits The following limits exist for the CDCRTVJRN program: Note: The stored procedure and the program are installed in a library defined in the Topology as the default work library for this iSeries data server