为使用ODBC连接trafodion软件,安装ODBC和配置

1. 确认是否安装unixODBC:

[trafodion@esgyn-01 testtxt]$ rpm -qa|grep unixODBC
unixODBC-2.2.14-14.el6.x86_64
[trafodion@esgyn-01 testtxt]$
2. 如果没有安装,可以执行:

yum install unixODBC.x86_64

3. 安装Trafodion ODBC驱动;驱动安装包在esgynDB_clients-2.2.1-RH6-x86_64.tar.gz;在安装过程中全部尽量选默认配置

[root@n09 chenqilin]# ls
esgynDB_clients-2.2.1-RH6-x86_64.tar.gz  esgyn-tpcds-kit  python
[root@n09 chenqilin]#
[root@n09 chenqilin]# tar xzf esgynDB_clients-2.2.1-RH6-x86_64.tar.gz
[root@n09 chenqilin]# ls
clients  esgynDB_clients-2.2.1-RH6-x86_64.tar.gz  esgyn-tpcds-kit  python
[root@n09 chenqilin]#
[root@n09 chenqilin]# cd clients/
[root@n09 clients]# ls
DISCLAIMER                 jdbcT4-2.2.1.zip  LICENSE_Esgyn  odb64_linux.tar.gz  trafci.zip
EsgynDB-ADO.NET-2.2.0.exe  LICENSE           NOTICE         TFODBC64-2.2.0.exe  TRAF_ODBC_Linux_Driver_64.tar.gz
[root@n09 clients]#
[root@n09 clients]#
[root@n09 clients]# tar xzf TRAF_ODBC_Linux_Driver_64.tar.gz
[root@n09 clients]#
[root@n09 clients]#
[root@n09 clients]# ls
DISCLAIMER                 jdbcT4-2.2.1.zip  LICENSE_Esgyn  odb64_linux.tar.gz  TFODBC64-2.2.0.exe  TRAF_ODBC_Linux_Driver_64.tar.gz
EsgynDB-ADO.NET-2.2.0.exe  LICENSE           NOTICE         PkgTmp              trafci.zip
[root@n09 clients]#
[root@n09 clients]#
[root@n09 clients]# cd PkgTmp/
[root@n09 PkgTmp]# ls
connect_test.cpp  install.sh  libicudata.so.44  libicuuc.so.44  libtrafodbc_l64_drvr.so  libtrafodbc_l64.so  license.txt  MD5SUM  runconnect_test.sh  TRAFDSN
[root@n09 PkgTmp]#
[root@n09 PkgTmp]#
[root@n09 PkgTmp]# sh install.sh
\nBeginning Install of TRAFODBC Libraries\n
Verifying OS version
Architecture verified
Esgyn ODBC LICENSE AGREEMENT

NOTICE: You are not authorized to install or use this product unless you first
        read, agree to, and confirm that the use of such product is subject to
        a valid license agreement with Esgyn Corporation as stated below.
        You confirm such license by installing this software. If you do not
        have an existing license for the use of this product, you may not
        access or use the product until you obtain the appropriate license
        from Esgyn Corporation.

This ODBC driver software is provided subject to the terms of your existing
license agreement with Esgyn Corporation or its reseller, integrator,
distributor or other authorized sub-licensor for the use of Esgyn Corporation
software.
Do you accept the terms of the license (YES/NO): yes
Thank You....
Proceeding with install

ENTER a directory for library files
OR hit Enter to use the default [/usr/lib64] :

ENTER a directory for datasource template file
OR hit Enter to use the default [/etc/odbc] :

ENTER a directory for sample
OR hit Enter to use the default [/etc/odbc] :

TRAFODBC driver has successfully been installed.
  * Library libtrafodbc_l64_drvr.so is installed on /usr/lib64
  * data source template file TRAFDSN has been copied onto /etc/odbc
  * sample file has been copied onto /etc/odbc

[root@n09 PkgTmp]#

4. 添加 /etc/odbc.ini

[ODBC]
traceFlags = ERROR
TraceStart = 0
TraceFile = tracefile.log
MaxTraceFileSize = 1024
AppUnicodeType=utf16

[traf]
Description = traf instance in IDC vm 10.10.11.3
Driver = Trafodion
Catalog = TRAFODION
Schema = QA
DataLang = 0
FetchBufferSize = SYSTEM_DEFAULT
Server = TCP:10.10.11.252:23400
SQL_ATTR_CONNECTION_TIMEOUT = SYSTEM_DEFAULT
SQL_LOGIN_TIMEOUT = SYSTEM_DEFAULT
SQL_QUERY_TIMEOUT = NO_TIMEOUT
ServiceName = HP_DEFAULT_SERVICE
ClientCharSet = UTF8


注:配置了一个名为traf的ODBC连接,Server为需要连接的DCS Master,ClientCharSet = UTF8这个是为了避免用odb导入带中文字符入表后不是乱码。

5. 添加/etc/odbcinst.ini

[Trafodion]
Description = Trafodion ODBC Stand Alone Driver
Driver = /usr/lib64/libtrafodbc_drvr64.so
FileUsage = 1
UsageCount = 1
AppUnicodeType = utf16
Threading = 1

注:如果你驱动安装的位置不是默认的/usr/lib64,请修改Driver到你安装的驱动库位置


6. 在解压抱中执行./runconnect_test.sh脚本来查看是否配置正确:

[trafodion@esgyn-01 PkgTmp]$ ./runconnect_test.sh
In file included from sqlext.h:2071,
                 from connect_test.cpp:27:
sqlucode.h:20:20: error: sqlext.h: No such file or directory
Using Connect String: DSN=Default_DataSource;UID=ss;PWD=ss;

Connect Test Passed...
[trafodion@esgyn-01 PkgTmp]$












  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值