cancel
Showing results for 
Search instead for 
Did you mean: 

unixodbc to HANA - DSN configuration

Former Member
0 Kudos

I am trying to connect to HANA on the same system using unixodbc on SUSE 11. Everytime I execute isql -v hanacloud SYSTEM passwd I get following error:


isql -v hanacloud SYSTEM passwd

[08S01][unixODBC][SAP AG][LIBODBCHDB SO][HDB] Communication link failure;-10709 Connect failed (no reachable host left)

[ISQL]ERROR: Could not SQLConnect

I can successfully connect using hdbsql:


./hdbsql -n hanabox:30015 -u SYSTEM -p secret

Welcome to the SAP HANA Database interactive terminal.

Type:  \h for help with commands

       \q to quit

hdbsql=> \s

host          : hanabox:30015

database      : HDB

user          : SYSTEM

kernel version: 1.00.39.369298

autocommit    : ON

The DSN configuration is this:


[hanacloud]

Description="SmartCloudPT HANA"

Driver=HDBODBC

ServerNode=hanabox:30015

User:SYSTEM

Password:secret

The drivers file (/etc/unixODBC/odbcinst.ini) is this:

[HDBODBC]

Description = "SmartCloudPT HANA"

Driver=/usr/sap/hdbclient/libodbcHDB.so


The problem is, anything I put into ServerNode line in odbc.ini file (also when I delete this line at all), the returned error is 'no reachable host left'. What does it exactly mean and how can I configure my DSN to connect to this database?

The driver version is SAP HANA Database Client 1.00.38.368649


Interestingly, I can sucessfully connect with unixodbc/isql to the same database from another (Ubuntu) box, so I'm sure that database is running and all required ports are open. The DSN and drivers files on this Ubuntu box are the same as on my SUSE box.

I'm fighting with that for second day and I have no ideas left.

regards,

Marcin

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

ODBC different versions put the configured odbc.ini and odbcinst.ini in different locations.

When you first installed odbc 2.3.2 you can defined location like this: ./configure --sysconfdir=/etc .Otherwise it will be install in /usr/local/etc

To troubleshoot, pls use strace with isql to see where the command refers to (/etc/odbc.ini or /user/.odbc.ini ..) then you can create a link from the actual odbc.ini location to that location.

Former Member
0 Kudos

I ran into this exact error. The solution? Upgrade the unix-odbc driver. 2.2.12 seems to throw this error. 2.2.14 seems to work like a charm.

-Kyle

Former Member
0 Kudos

Hi,

I'm working with Marcin on this project. Here's a connection log:

SQLAllocHandle 2013-01-14 11:06:42.367640

HandleType       [in]    : SQL_HANDLE_DBC

InputHandle      [in]    : 0x000000000062fb70

OutputHandlePtr  [out]   : 0x000000000060a640

SQLRETURN                : SQL_SUCCESS

SQLConnect 2013-01-14 11:06:42.367766

ConnectionHandle [in]    : 0x0000000000630ff2

ServerName       [in]    : hanacloud

NameLength1      [in]    : SQL_NTS

UserName         [in]    : SYSTEM

NameLength2      [in]    : SQL_NTS

enc                      : ASCII

ODBC connect properties:

SQLRETURN                : SQL_ERROR

SQLGetDiagRec 2013-01-14 11:06:42.367964

HandleType       [in]    : SQL_HANDLE_DBC

Handle           [in]    : 0x0000000000630ff2

RecNumber        [in]    : 1

BufferLength     [in]    : 513

enc                      : ASCII

SQLState         [out]   : 08S01

NativeErrorPtr   [out]   : -10709

MessageText      [out]   : [SAP AG][LIBODBCHDB SO][HDB] Communication link failure;-10709 Connect failed (no reachable host left)

TextLengthPtr    [out]   : 102

SQLRETURN 


Hope it helps,

Thanks in advance,

Tom

lbreddemann
Active Contributor
0 Kudos

Tom,

although the hdbsql connection seems to work, this looks like a network issue to me.

Could you please check if the connection works via the JDBC driver:

java -jar "c:\Program Files\sap\hdbclient\ngdbc.jar" -n hanabox:30015 -u System,secret

Does this work?

- Lars

Former Member
0 Kudos

Hi Lars,

thanks for your help; the command you gave me works ok from my windows box.

regards,

Marcin

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos

Marcin, while trying on the same box have you tried changing host name in DSN to 'localhost', or IP address?

Former Member
0 Kudos

Vitaliy, yes, I've tried everything come in my mind. Also localhost, 127.0.0.1, external IP and all aliases from /etc/hosts file.

Former Member
0 Kudos

Hi Marcin,

This guy here seems to have successfully connected via unixodbc.


Rocky

Former Member
0 Kudos

Hi Rocky,

I've started from that... The same error: 'no reachable host left'.

Anyway, his solution works flawlessly on my other (Ubuntu) box.

regards

Marcin

0 Kudos

login to the unix system as the <sid>adm user and try to source the hdbenv.sh or hdbenv.csh file from the /usr/sap/HD9/HDBxx folder and then run the isql cmd

Former Member
0 Kudos

Thanks, Balaji, but nope, it doesn't work