CICS + Linux + Oracle 环境搭建
oracle1pc.c:521: warning: incompatible implicit declaration of built-in function 钬荣trncpy钬 oracle1pc.c:550: warning: incompatible implicit declaration of built-in function 钬荣trncpy钬 oracle1pc.c:600: warning: incompatible implicit declaration of built-in function 钬荣trncpy钬 ld -shared -eCICS_XA_Init -m elf_i386 -L/usr/local/oracle -lclntsh -R/usr/local/oracle/lib -o oracle1pc oracle1pc.o \\
/opt/ibm/cics/lib/regxa_swxa.o rm -f oracle1pc.c oracle1pc.o [root@ceshi Oracle]# ls -lrt total 188
-rwxrwxr-x 1 cics cics 3529 Oct 21 13:03 uxa1.sql -rwxrwxr-x 1 cics cics 9805 Oct 21 13:03 uxa1.pco -rwxrwxr-x 1 cics cics 7240 Oct 21 13:03 uxa1.pc
-rwxrwxr-x 1 cics cics 2605 Oct 21 13:03 uxa1_ora.mk -rwxrwxr-x 1 cics cics 2751 Oct 21 13:03 uxa1_oracob.mk -rwxrwxr-x 1 cics cics 5069 Oct 21 13:03 uxa1cob.bms -rwxrwxr-x 1 cics cics 5066 Oct 21 13:03 uxa1.bms
-rwxrwxr-x 1 cics cics 2668 Oct 21 13:03 oraclexa_sta.mk -rwxrwxr-x 1 cics cics 2743 Oct 21 13:03 oraclexa_sta.c -rwxrwxr-x 1 cics cics 2873 Oct 21 13:03 oraclexa_dyn.mk -rwxrwxr-x 1 cics cics 2772 Oct 21 13:03 oraclexa_dyn.c -rwxrwxr-x 1 cics cics 15899 Oct 21 13:03 oracle1pc.pc -rwxrwxr-x 1 cics cics 3530 Oct 21 13:03 nxa1.sql -rwxrwxr-x 1 cics cics 12060 Oct 21 13:03 nxa1.pco -rwxrwxr-x 1 cics cics 10128 Oct 21 13:03 nxa1.pc
-rwxrwxr-x 1 cics cics 2611 Oct 21 13:03 nxa1_ora.mk -rwxrwxr-x 1 cics cics 2759 Oct 21 13:03 nxa1_oracob.mk -rwxrwxr-x 1 cics cics 5069 Oct 21 13:03 nxa1cob.bms -rwxrwxr-x 1 cics cics 5066 Oct 21 13:03 nxa1.bms
-rwxr-xr-x 1 root root 2915 Oct 21 15:08 oralce1pc.mk.bak -rwxr-xr-x 1 root root 250 Oct 21 16:41 export.sh -rwxrwxr-x 1 cics cics 2952 Oct 21 17:39 oracle1pc.mk -rw-r–r– 1 root root 0 Oct 21 17:40 oracle1pc.lis
-rwxr-xr-x 1 root root 43300 Oct 21 17:40 oracle1pc (驱动程序)
20. 配置XAD到CICS region
[root@ceshi Oracle]#
cp /opt/ibm/cics/examples/RM_support/Oracle/oracle1pc /var/cics_regions/test/bin
[root@ceshi XAD]# cicsadd -c xad -r test Oracle_XA \\
> ResourceDescription=\>
XAOpen=\> XAClose=\
> SwitchLoadFile=\
拷贝下面文字到记事本编辑 cicsadd -c xad -r test Oracle_XA \\
ResourceDescription=\
XAOpen=\\\
XAClose=\
SwitchLoadFile=\
其中 SQLNET是数据库名 qmcb/qmcb是用户名和密码
上述命令会修改 /var/cics_regions/test/database/XAD/XAD.stanza配置文件
console日志中有下列信息,说明连接成功
ERZ080088I/0801 10/22/14 15:35:07.592623000 test 17071/0001 : XA OPEN submitted for Server 101 connected to ‘Oracle Single Phase’ using XA_OPEN string ‘Oracle_XA+SQLNET=IBMCICS+Acc=P/qmcb/######+SesTm=35+LogDir=/tmp+DbgFl=1’
ERZ080006I/0801 10/22/14 15:35:07.724733000 test 17071/0001 : XA_OPEN succeeded: Application Server 101 connected to ‘Oracle Single Phase’ using XA_OPEN string ‘Oracle_XA+SQLNET=IBMCICS+Acc=P/qmcb/######+SesTm=35+LogDir=/tmp+DbgFl=1’
ERZ080089I/0801 10/22/14 15:35:07.724801000 test 17071/0001 : XA OPEN completed for Server 101 connected to ‘Oracle Single Phase’ using XA_OPEN string ‘Oracle_XA+SQLNET=IBMCICS+Acc=P/qmcb/######+SesTm=35+LogDir=/tmp+DbgFl=1’
ERZ080090I/0801 10/22/14 15:35:07.724910000 test 17071/0001 : XA RECOVER submitted for Server 101 connected to ‘Oracle Single Phase’
ERZ080091I/0801 10/22/14 15:35:07.724955000 test 17071/0001 : XA RECOVER completed for Server 101 connected to ‘Oracle Single Phase’
21. 修改region相关的oracle定义
[root@ceshi test]# pwd /var/cics_regions/test
[root@ceshi test]# cat env* #
# NAME: environment – Environment file for CICS #
# VERSION: 1.3
#
# # (C) COPYRIGHT International Business Machines Corp.
# 1993, 2013 # All Rights Reserved # Licensed Materials – Property of IBM
# 5724-B44 # # US Government Users Restricted Rights – # Use, duplication or disclosure restricted by
# GSA ADP Schedule Contract with IBM Corp.
# # #
# DESCRIPTION:
# CICS environment file. This file should only contain
# 1. comment lines which have a # in the first column, # 2. blank lines, and
# 3. Lines in the form name=value. #
# For example, if you wanted to alter the value of the LANG # environment variable so that the region runs with LANG set # to Ja_JP, you would add the line :- #
# LANG=Ja_JP #
# CAVEATS/WARNINGS:
# This file is only for establishing environment variables. # Execution of commands from this file or any lines other # than specified above may cause failure of the initialization # process. #
ORACLE_HOME=/usr/local/oracle ORACLE_SID=IBMCICS LIBPATH=/usr/local/oracle [root@ceshi test]#
22. 编译数据库相关的samp
[root@ceshi cics_app]# pwd /root/cics_app
[root@ceshi cics_app]# ls -lrt
total 28
-rwxrwxr-x 1 root root 2394 Oct 21 13:16 HELLOWLD -rw-r–r– 1 root root 1063 Oct 21 16:28 db.sql
-rw-r–r– 1 root root 564 Oct 21 18:32 db_samp.mk -rw-r–r– 1 root root 1400 Oct 22 15:03 PROFGETP.pc -rw-r–r– 1 root root 617 Oct 22 15:04 common.h -rw-r–r– 1 root root 0 Oct 22 15:08 PROFGETP.lis -rwxrwxr-x 1 root root 6725 Oct 22 15:08 PROFGETP [root@ceshi cics_app]# make -f db_samp.mk rm -rf *.ccs rm -rf *.c rm -rf *.o
/usr/local/oracle/sdk/proc parse=none release_cursor=no sqlcheck=syntax \\ ireclen=512 iname=PROFGETP.pc
Pro*C/C++: Release 11.2.0.3.0 – Production on Wed Oct 22 15:49:55 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
System default option values taken from: /usr/local/oracle/precomp/admin/pcscfg.cfg
mv PROFGETP.c PROFGETP.ccs LDFLAGS=\
cicstcl -e -d -lC PROFGETP.ccs
ERZ004047I/9005: Running the translation step: ‘cicstran -e -d -lC PROFGETP.ccs’ ERZ004060I/5015: cicstran translation ended: 0 error(s), 0 warning(s).
ERZ004049I/0096: Running the compile and link step: ‘gcc -I/opt/ibm/cics/include -m32 -fPIC -c PROFGETP.c’
ld -G -e main -o PROFGETP PROFGETP.o -L/opt/ibm/cics/lib -m elf_i386 cicsdelete -c pd -r test -B PROFGETP
cicsadd -c pd -r test -B PROFGETP PathName=/root/cics_app/PROFGETP RSLKey=public rm -rf *.ccs rm -rf *.c rm -rf *.o
[root@ceshi cics_app]#
23. 备份region
[root@ceshi test]# cicsexport -r test -o test.region.bak ERZ046338I/0420: Successfully exported region ‘test’ test.region.bak已经提供
可以使用cicsimport导入
-ansi
[root@ceshi database]# cicsimport
ERZ046099I/0208: Usage: cicsimport {-?| -r regionName [-g groupName] [-i inFile] [-l m|o] [-v] [-F] [-o] [-B]}
[root@ceshi database]#
cicsimport -r test -i test.region.bak
该目录下包含所有test region配置文件的文本形式,已经压缩提供 [root@ceshi database]# pwd /var/cics_regions/test/database
24. JAVA客户端调用CICS服务端程序
Main.java
具体工程参照:java_client.zip
ECIRequest eciRequestObject = new ECIRequest(ECIRequest.ECI_SYNC, // ECI call type
\, // CICS server 配置在CICS TG中的名字 \, // CICS userid,可以默认为CICSUSER \, // CICS password
programName,//上面定义的PD名称 null, // CICS transid to be run
commarea, // Byte array containing the COMMAREA iCommareaSize, // COMMAREA length
ECIRequest.ECI_NO_EXTEND, // ECI extend mode 0); // ECI LUW token
调用输出:
以下文章点击率最高
Loading…