AIX服务器上设置IIB连接oracle

7 篇文章 0 订阅
1.将<install_dir>/ODBC64/unixodbc/odbc.ini
    <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


  必须将这三条语句写入$HOME/.profile里面,这样每次登陆进入用户的时候就会先自动编译。
  /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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值