Configuring the iWay Log Event Adapter for Informix

This section provides a roadmap that describes how to configure the iWay Log Event Adapter for Informix.

Configuring an Environment File

The first step that is required when configuring the iWay Log Event Adapter for Informix, is to create an environment file (.env), which sets and exports the properties of the Informix database. This is the database that will be accessed by the iWay Log Event Adapter for Informix.

For each Informix database, you will need to create a new environment file based on the subscr.env file, which is found in the cdcagent/config directory. You can create a duplicate of the subscr.env file and rename it for each subscription (for example, iwaycdc.env).

The following is a sample iwaycdc.env file that can be used for reference purposes:

#!/usr/bin/ksh
# Script name: iwaycdc.env
# Version: 1.1
#Description: The environment setup shell script for iwaycdc agent.
#Located in the $CDC_HOMEDIR/config directory. 
#Sets up all global variables for general configuration of iwaycdc agent 
#Usage: The iwaycdc.env script should be executed before executing 
#iwaycdcagent program 
#########################################################################
#Set up the iWay CDC_HOMEDIR path for cdcagent directory
 
#export CDC_HOMEDIR=/home/cdcagent		
#Location of the iwaycdc home directory
export CDC_HOMEDIR=/home/iwayqa/cdcagent
#Setup the custom location for directories below or use the default
export CDC_BINDIR=${CDC_HOMEDIR}/bin            
#Location of programs and shell scripts
export CDC_CONFIGDIR=${CDC_HOMEDIR}/config	
#Location of env and config files
export CDC_OUTPUTDIR=${CDC_HOMEDIR}/output	
#Location of CDC data
export CDC_LOGDIR=${CDC_HOMEDIR}/log		
#Location of the message log files
export CDC_TRACEDIR=${CDC_HOMEDIR}/trace	
#Location of the trace files
export CDC_ARCHIVEDIR=${CDC_HOMEDIR}/archive	
#Location of the archived CDC data files 
export CDC_CONTROLDIR=${CDC_HOMEDIR}/ctr        
#Location of the control files
#Buffer size, bytes (max 2GB) - Not configurable, info only
CDC_BUFFSIZE=4096
# File names and extentions
export CDC_AGENT_PROG=iwaycdcagent
#Name of the iWay CDC Agent Program
export CDC_BASENAME="iwaycdc		"
#Used to generate the output, log and trace files
export CDC_ENV_EXT="env		"
#Environment files extention
export CDC_CONFIG_EXT="config		"
#Config files extention
export CDC_TRACE_EXT="trc
#Trace files extention
export CDC_LOG_EXT="log		"
#Log files extention
export CDC_OUT_EXT="txt		"
#CDC output data files extention
export CDC_CTRLSN_EXT="lsn"             
#Extention of subscription LSN control files
export CDC_CTRFILE_EXT="seq"            
#Extention of the control file
export CDC_MASTER_LOG=${CDC_LOGDIR}/${CDC_BASENAME}.${CDC_LOG_EXT} 
#Master log file for iway_runcdc.sh

Identifying Tables and Columns

Once you have created a new environment file, you must execute the tabconfig.sh script, which is also found in the cdcagent/config directory. The tabconfig.sh script generates a list of tables and columns which are available in the Informix database and puts them in a file that uses the following naming convention:

subscrxxx.config

By default, every table and column is subscribed. The assumption prior to executing this file is that all of the environmental variables have been exported in the .profile or in the terminal. For more information on configuring and using the tabconfig.sh script, see Using the Tabconfig.sh Script.

Running the iWay Informix CDC Agent Application

Once the tabconfig.sh script is executed, you can execute the iWay Informix CDC Agent application by running the iway_runcdc.sh startup script from the /cdcagent/bin directory. This script will access the environment file (.env), which was previously configured with the Informix variables. For more information on how to execute the iway_runcdc.sh script, see Running the iWay Informix CDC Agent Application.

When the Informix database is updated (for example, by new transactions), the iWay Informix CDC Agent generates an output file in a specified output directory, which identifies the transactions that occurred in the database. For each transaction, the output file is updated with XML data, a transaction ID, and the type of transaction. Each subscription will also have its own directory. For each subscription you have created, you must execute the iway_runcdc.sh startup script to access the proper files.

Configuring the iWay Log Event Listener

When the iWay Informix CDC Agent is running, it listens for changes in the Informix database and generates an output file (text file containing XML data) in a specified directory. You must configure the iWay Log Event Listener using iWay Service Manager to listen for this generated output file. The source directory for the iWay Log Event Listener is the one where the output file is written to.

iWay Service Manager will then read the transaction and convert it to XML format. Using the iWay CDC SQL Batch Agent (com.ibi.agents.XDCDCSQLBatchAgent) in a process flow, iWay Service Manager performs a Batch insert/update operation on the Oracle database. The sample channel and process flow that perform this operation are contained within the <iway_home>/etc/repository/manager/archive subdirectory.

Viewing Trace Files and Logs

The iWay Log Event Adapter for Informix provides two ways of checking for errors and logging the process: trace files and full logs. Trace files are located in the following directory:

$CDC_HOMEDIR/trace/subscription

The trace file is specific to a configuration and provides subscription, table, and column information. The generated trace file uses the following naming convention:

iway_subscriptionname.txt

where:

subscriptionname

Is the name of the subscription that is being used.

The location of the trace file is specified in the environment file (iwaycdc.env)

For full logs, the iwaycdc.log file is provided, which contains comprehensive information related to the entire CDC process. The iwaycdc.log file is located under the /cdcagent/log directory.

The specific location of the log file can also be specified in the environment file (iwaycdc.env).

In addition, iWay log files can also be examined and are located in the following directory:

IWAY_HOME/config/base/log

An example of an iWay log file is iway01.log.


iWay Software