1. 確認是否安裝unixODBC:python
[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;在安裝過程當中所有儘可能選默認配置linux
[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]#
[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導入帶中文字符入表後不是亂碼。sql
5. 添加/etc/odbcinst.iniapp
[Trafodion] Description = Trafodion ODBC Stand Alone Driver Driver = /usr/lib64/libtrafodbc_drvr64.so FileUsage = 1 UsageCount = 1 AppUnicodeType = utf16 Threading = 1
注:若是你驅動安裝的位置不是默認的/usr/lib64,請修改Driver到你安裝的驅動庫位置less
[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]$