1.将<install_dir>/ODBC64/unixodbc/odbc.ini
<install_dir>/ODBC64/unixodbc/odbcinst.ini
odbcinst.ini内容如下:这是配置ODBC的跟踪文件,默认 Trace=no
/app/IBM/mqsi/9.0.0.2/bin/mqsiprofile这个文件也应该放在此处运行编译以运行IIB的环境,如果没先执行此文件,则以mqsi开头的命令都会找不到
3. 用命令设置连接数据源的用户名和密码:mqsisetdbparms IB9NODE -n ORACLEDB -u iib -p iib321
-n ORACLEDB:这个数据源名称就是在第一步中odbc.ini中配置的数据源,在odbc.ini里面配置有连接数据库的IP,PORT,SERVICE_NAME
-u iib:数据库的用户名
-p iib321:数据库的密码
4.用mqsicvp验证数据库的连接:mqsicvp IB9NODE -n ORACLEDB
<install_dir>/ODBC64/unixodbc/odbcinst.ini
拷贝到/var/mqm/odbc目录中,用vi进入odbc.ini和odbcinst.ini修改文件的配置,此处还需要注意这两个文件的用户和用户组得是mqm:mqbrkrs
odbc.ini的内容如下:(根据实际的数据库配置数据源的参数)我配的是ORACLE数据库的
;##########################################################################
;# ODBC database driver manager initialisation file. #
;##########################################################################
;# It is recommended that you take a copy of this file and then edit the #
;# copy. #
;# #
;# 1. For each data source, add the name of the data source into #
;# the 'List of data sources stanza' section. #
;# #
;# 2. For each data source, create a stanza in the #
;# 'Individual data source stanzas' section. #
;# #
;##########################################################################
;#######################################
;#### List of data sources stanza ######
;#######################################
[ODBC Data Sources]
ORACLEDB=DataDirect 7.0 ODBC Oracle Wire Protocol
;###########################################
;###### Individual data source stanzas #####
;###########################################
;# Oracle stanza
[ORACLEDB]
Driver=/app/IBM/mqsi/9.0.0.2/ODBC64/V7.0/lib/UKora26.so
Description=DataDirect ODBC 7.0 Oracle Wire Protocol
HostName=10.10.16.13
PortNumber=1521
ServiceName=jmpubdb
CatalogOptions=0
EnableStaticCursorsForLongData=0
ApplicationUsingThreads=1
EnableDescribeParam=1
OptimizePrepare=1
WorkArounds=536870912
ProcedureRetResults=1
ColumnSizeAsCharacter=1
LoginTimeout=0
;##########################################
;###### Mandatory information stanza ######
;##########################################
[ODBC]
InstallDir=/app/IBM/mqsi/9.0.0.2/ODBC64/V7.0
UseCursorLib=0
IANAAppCodePage=4
UNICODE=UTF-8
odbcinst.ini内容如下:这是配置ODBC的跟踪文件,默认 Trace=no
;##########################################################################
;# ODBC database driver manager system initialisation file. #
;##########################################################################
;# It is recommended that you take a copy of this file and then edit the #
;# copy. #
;# #
;# 1. Complete the 'Mandatory information stanza' section #
;# at the end of the file. #
;# #
;##########################################################################
;##########################################
;###### Mandatory information stanza ######
;##########################################
[ODBC]
;# To turn on ODBC trace set Trace=yes
Trace=yes
TraceFile=/var/mqm/odbc/odbctrace.out
Threading=2
2.设置环境变量
export ODBCINI=/var/mqm/odbc/odbc.ini
export ODBCSYSINI=/var/mqm/odbc (注意这里是odbcinst.ini所在的目录,而非odbcinst.ini文件)
export IE02_PATH=/opt/ibm/IE02/2.0.1
/app/IBM/mqsi/9.0.0.2/bin/mqsiprofile这个文件也应该放在此处运行编译以运行IIB的环境,如果没先执行此文件,则以mqsi开头的命令都会找不到
3. 用命令设置连接数据源的用户名和密码:mqsisetdbparms IB9NODE -n ORACLEDB -u iib -p iib321
-n ORACLEDB:这个数据源名称就是在第一步中odbc.ini中配置的数据源,在odbc.ini里面配置有连接数据库的IP,PORT,SERVICE_NAME
-u iib:数据库的用户名
-p iib321:数据库的密码
4.用mqsicvp验证数据库的连接:mqsicvp IB9NODE -n ORACLEDB