Setting up TXSeries with Oracle on Windows describes how you can enable the region to connect to an Oracle database.
Setting up CICS® with Oracle on Windows describes how to enable the region to connect to an Oracle database.
Enabling XA-enabled and non-XA-enabled connections to Oracle databases
This section describes how to set up the environment to enable transactions that are to be executed from within CICS in both an XA-enabled and non-XA-enabled environment.
Before you start, verify that the Oracle software is installed as described in the relevant Oracle installation manual.
Oracle sets the environment variable TCL_LIBRARY in the system environment, which can cause errors with the cicscp command. After installing Oracle, move this environment variable from the system environment to any user environment that will be used for Oracle administration.
Grant the select privilege on the dba_pending_transactions view to all users who are specified in the XA open string. For example, if you need to connect to your database only as user scott, run the following sqlplus command:
grant select on dba_pending_transactions to scott;
Makefiles to build the two types of switch load file are supplied with CICS. Several makefiles exist:
Build the switch load file as follows:
nmake -f makefile
where makefile is one
of the makefiles that are listed at the start of step 2.The region's environment is inherited from the system environment. You can add database environment information to the region's environment file (c:\var\cics_regions\regionName\environment) to avoid connection errors that occur if the system environment does not have the required database environment variables set.
If the Oracle SQL libraries are not included in the system environment, they must be included in the region's environment file. When adding the library path to the region's environment file, ensure that all the libraries that are required by applications that run on this region are included. This is because the library path value that existed when the region was started is replaced with the library path value that is in the region's environment file. This is true for all values, such as PATH, NLSPATH, LANG, and so on.
Do not use % values in the region's environment file because these values are not expanded. Refer to the information that is in the region's environment file prolog.
Use the CICS Product Definition to define an XA-compliant Resource Manager to CICS.
The following attributes in each stanza are of particular importance:
Oracle_XA +Acc=P/userName/password
+SesTm=sessionTimeLimit
The user name and password can be null if "P//" is a valid user name-password pair.
Refer to your Oracle documentation for a detailed description of all fields that can be used in the XA open string.
An example of an XA open string for Oracle follows:
Oracle_XA+Acc=P/scott/tiger+SesTm=35+LogDir=C:\TEMP+DbgFl=1
This string causes a cicsas process to connect to the database:
Oracle_XA+Acc=P/scott/@password@+ SesTm=35+LogDir=/tmp+DbgFl=1
Run the cicsxapasswd command by passing the region name and the Product Definitions (XAD) key. For more information, see cicsxapasswd - Configures the XA password.
If your switch load file is called oraclexa_dyn.dll and it is in the region/bin directory, set the switch load file attribute to oraclexa_dyn.dll.
On Windows systems, no action is required to provide a language environment for CICS. The COBOL language method file cicsprCMFNT and the COBOL-IT language method file, cicsprCOBOLIT are provided in the $cics_install_dir\bin directory.
Before compiling an COBOL-IT ORACLE program, edit the default.conf file provided in $COBOLITDIR/config directory and add the include "oracle.symb" string. This will ensure that all the ORACLE symbols are linked at link time itself.
CICS logs XA messages in the region's console file. To determine whether the region can connect to RM, start your region and check the console.nnnnnn messages.
The CICS-supplied examples provide an easy way of exercising XA and non-XA connections. These examples are in c:\opt\cics\examples\xa and c:\opt\cics\examples\nonxa. Refer to the respective README files.