Cannot connect to the td server in TDExpress14.0.3_Sles10_4GB with Linux odbc driver v14/5/6

Connectivity
Enthusiast

Cannot connect to the td server in TDExpress14.0.3_Sles10_4GB with Linux odbc driver v14/5/6

I cannnot connect to the td server in TDExpress14.0.3_Sles10_4GB using td odbc drivers for linux, I can access the db with bteq and the jdbc driver: terajdbc4.jar tdgssconfig.jar I tested to connect to the server with *isql* of unixodbc, *tdxodbc64* and *adhoc* carried by the odbc driver package, all failed with the same reason: ------------------------------------------------------------------------------ Enter Data Source Name: tdsn16 Enter UserID: dbc Enter Password: [__handles.c][460] Exit:[SQL_SUCCESS] Environment = 0x60dc10 [SQLSetEnvAttr.c][189] Entry: Environment = 0x60dc10 Attribute = SQL_ATTR_ODBC_VERSION Value = 0x3 StrLen = 0 [SQLSetEnvAttr.c][364] Exit:[SQL_SUCCESS] [SQLAllocHandle.c][375] Entry: Handle Type = 2 Input Handle = 0x60dc10 [SQLAllocHandle.c][493] Exit:[SQL_SUCCESS] Output Handle = 0x60e510 Connecting with SQLConnect(DSN=tdsn16,UID=dbc,PWD=*)... [SQLConnect.c][3731] Entry: Connection = 0x60e510 Server Name = [tdsn16][length = 6 (SQL_NTS)] User Name = [dbc][length = 3 (SQL_NTS)] Authentication = [***][length = 3 (SQL_NTS)] UNICODE Using encoding ASCII 'UTF8' and UNICODE 'UTF16LE' [SQLConnect.c][4103] Exit:[SQL_ERROR] [SQLError.c][434] Entry: Connection = 0x60e510 SQLState = 0x60d280 Native = 0x7ffeac7a1268 Message Text = 0x6555a0 Buffer Length = 1024 Text Len Ptr = 0x7ffeac7a1266 [SQLError.c][471] Exit:[SQL_NO_DATA] adhoc: SQLError() couldn't find text, RC=100 [SQLFreeHandle.c][284] Entry: Handle Type = 2 Input Handle = 0x60e510 [SQLFreeHandle.c][333] Exit:[SQL_SUCCESS] [SQLFreeHandle.c][219] Entry: Handle Type = 1 Input Handle = 0x60dc10 ODBC connection closed. ------------------------------------------------------------------------------ I printed the trace log info of unixodbc to the stderr. The trace setting in the odbc.ini of td odbc is for DataDirect DriverManager learning from the user guide, so there's no trace log under unixodbc. >>>>>> TCPDUMP <<<<<< Found that the odbc driver didn't send anything to the db server, seemed it didn't open the socket. As I got no output from tcpdump on the db server. >>>>>> STRACE <<<<<< Seems there's nothing wrong in the log file, just stat() the ~/.odbc.ini, getuid() and getgid() many times and then exits with code 1: 600 22567 close(3) = 0 601 22567 brk(0x232d000) = 0x232d000 602 22567 stat("/home/szc/.odbc.ini", {st_mode=S_IFREG|0777, st_size=1257, ...}) = 0 603 22567 getuid() = 1001 604 22567 getgid() = 1001 .... 889 22567 stat("/home/szc/.odbc.ini", {st_mode=S_IFREG|0777, st_size=1257, ...}) = 0 890 22567 stat("/home/szc/.odbc.ini", {st_mode=S_IFREG|0777, st_size=1257, ...}) = 0 891 22567 getuid() = 1001 892 22567 getgid() = 1001 893 22567 stat("/home/szc/.odbc.ini", {st_mode=S_IFREG|0777, st_size=1257, ...}) = 0 894 22567 write(2, "[SQLConnect.c][4103]\n\t\tExit:[SQL_ERROR]\n", 40) = 40 The first column is the line number, the second is the pid. It failed at here, unixodbc source code, DriverManager/SQLConnect.c: 4005 ret_from_connect = SQLCONNECT( connection, 4006 connection -> driver_dbc, 4007 dsn, SQL_NTS, 4008 user_name, name_length2, 4009 authentication, name_length3 ); But I don't know how to solve this problem. I've tested the odbc driver v14/15/16 x64 on debian 8.2 with unixodbc 2.3.4, and x64 v16 on centos 6.8 with unixodbc 2.2.14-14. I have worked with the odbc driver of mysql, sqlserver, oracle, db2 and postgresql before long, so I was familiar with the usage of the unixodbc and the odbc drivers. unixodbc's odbc.ini: [ODBC] InstallDir=/opt/teradata/client/15.10/odbc_64 Trace=1 TraceDll=/opt/teradata/client/15.10/odbc_64/lib/odbctrac.so TraceFile=/tmp/tdtrace.log TraceAutoStop=0 [testdsn] Driver=/opt/teradata/client/15.10/odbc_64/lib/tdata.so Description=Teradata database DBCName=172.22.47.47 LastUser=dbc Username=dbc Password=dbc Database=vmunic DefaultDatabase=vmunic [tdsn16] Driver=/opt/teradata/client/16.00/odbc_64/lib/tdata.so Description=Teradata database DBCName=172.22.47.47 LastUser=dbc Username=dbc Password=dbc Database=vmunic DefaultDatabase=vmunic unixodbc's odbcinst.ini (as I use the absolute path of the driver so, this is not used in fact): [Teradata] Driver=/opt/teradata/client/15.10/odbc_64/lib/tdata.so APILevel=CORE ConnectFunctions=YYY DriverODBCVer=3.51 SQLLevel=1 Any help and guidance is appreciated.
Tags (1)

Accepted Solutions
Enthusiast

Re: Cannot connect to the td server in TDExpress14.0.3_Sles10_4GB with Linux odbc driver v14/5/6

Thank you very much for your reply!
1 ACCEPTED SOLUTION
2 REPLIES
Teradata Employee

Re: Cannot connect to the td server in TDExpress14.0.3_Sles10_4GB with Linux odbc driver v14/5/6

[ODBC]
InstallDir=/opt/teradata/client/15.10
Trace=1
TraceDll=/opt/teradata/client/15.10/lib64/odbctrac.so
TraceFile=odbc_trace_1510.log
TraceAutoStop=0

[ODBC Data Sources]
testdsn=tdata.so
edw=tdata.so
krb1510=tdata.so

[testdsn]
Driver=/opt/teradata/client/15.10/lib64/tdata.so
Description=Teradata database
#DBCName=sdll0000
DBCName=sdlc7030
#DBCName2=
LastUser=
Username=
Password=
Database=
DefaultDatabase=
NoScan=
SessionMode=ANSI
CharacterSet=UTF16

DSNTraceEnable=Yes

DSNTraceFilePath=/tmp/dsn_trace.log

 

The Teradata ODBC Driver is not compatible with unixODBC libraries, so your LD_LIBRARY_PATH

should be pointing to /opt/teradata/client/15.10/odbc_64/lib directory if the symbolic link in /usr/lib64

was not created during the tdodbc install and all the libraries including Driver Manager must be from

the TD ODBC Driver directory.

Also the DSN name needs to be created in the [ODBC Data Sources].

From the sample .odbc.ini posted above you can that I enabled both ODBC Driver Trace

and DSN trace. If the correct libraries were loaded, trace logs will be created, else it

will fail to create these log files.

User either the 64-bit  "adhoc" or "tdxodbc64" to test connectivity.

Enthusiast

Re: Cannot connect to the td server in TDExpress14.0.3_Sles10_4GB with Linux odbc driver v14/5/6

Thank you very much for your reply!