SAP HANA Academy’s Tahir Hussain “Bob” Babar walks through how to install Unix ODBC on the SAP HANA One System. Installing ODBC is a vital part of the SAP HANA Live2! course. Note that SAP HANA SPS7 is required for the HANA Live2! course. To view all of the content and links for the course please visit the HANA Live2! Project Overview.

Installing ODBC:

  • First, enter either the Java ssh client or putty to connect to SAP HANA One. Users can configure the terminal to set the format they desire. (5:38 – 6:15)
  • Next, type in isql –-version after hanaserver:~# to verify that the ODBC has not been installed. Bob currently doesn’t have ODBC installed. (6:30 – 6:39)
  • Then, create a folder by entering hanaserver:~# pwd, then hanaserver:~ cd.. , then hahaserver:/#mkdir _drivers, and then hanaserver:/#ls to create a folder named drivers for the ODBC installation. (6:45 – 6:59)
  • Next, enter hanaserver:/ cd_drivers and then hanaserver:/_drivers # ls to verify that the folder is empty. (7:00-7:13)
  • Then, copy the syntax from the file linked at the bottom of the video (and this blog) and paste it after hanaservers:/_drivers # to download Unix ODBC. It should look like this:   hanaservers:/_drivers # wget http://sourceforge.net/projects/unixodbc/files/unixODBC/2.2.14/unixODBC-2.2.14-linux-x86-64.tar.gz/download to download Unix ODBC. (7:20 – 8:15)
  • After the file has downloaded enter hanaserver:/_drivers # gunzip unixODBC-2.2.14-linux-x86-64.tar.gz to gunzip the file. (9:10 – 9:20)
  • Next, enters hanaserver:/_drivers# tar xvf unixODBC-2.2.14-linux-x86-64.tar to un-tar the file. (9:20 – 9:28)
  • Enter ls to see the user folder and then drill down a few levels into the user folder by entering cd user, then ls, then cd local/, then ls to see the various file folders for Unix ODBC. (9:40 – 10:00)
  • Finally, drill into the bin folder by entering cd bin to see that iSQL has been installed. (10:01 – 10:20)

Configuring the connection to ODBC:

  • First, enters su – hdbadm to connect as the SAP HANA administrator user. (10:34 – 10:43)
  • Next, add command executable paths to the HDBADM user by entering vi ~/.bashrc. (11:30 – 11:56)
  • Modify the resultant file by entering the path of :/_drivers/usr/local/bin after export PATH=$PATH:$JAVA_HOME/bin. (12:06 – 12:24)
  • Now that the path has been created type in :wq to quit vi. (12:30-12:36)
  • Next, a user needs to modify the customer .sh file by entering vi ~/customer.sh when logged in as HDBADM. (14:50 – 15:07)
  • Above the resultant file paste in the below code that is found in number 6 in the attached file: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/_drivers/usr/local/lib/. (15:17 -15:30)
  • Next, create an ODBC.ini file in the home directory of the HDBADM user by pasting in export ODBCINI=$HOME/.odbc.ini. (15:52 – 16:06)
  • Then, return to hanaserver:/usr/sap/HDB/HDB 00 and enters cd/user/sap/hdbclient followed by entering ls to see all of the files. (17:28 – 17:49)
  • Next, put it in path by creating a new file by entering vi ~/.odbc.ini and then after pressing I to do an insert paste in this code from number 7 of the attached file:  [HDB] Driver=/usr/sap/hdbclient/libodbcHDB.so ServerNode=localhost:30015. (17:57 – 18:29)
  • Enter :wq to write and quit and then reenter vi ~/.odbc.ini to verify that the file has been installed. (19:10 – 19:15)

Testing that ODBC Works:

  • Now after entering hanaserver:/usr/sap/hdbclient> isql –version an error is generated. (19:30 – 19:37)
  • To solve the error the user has to log out and then log back as HDBADM to refresh the connection with the updated variables to see that Unix.ODBC 2.2.14 is installed. (19:45 – 20:07)
  • Next, enter the command isql – v HDB live2user SHALive1 to return a messaged that you are connected. The Live2 username and password were created in an earlier video in the series. (20:33 – 21:09)
  • Next, after SQL> enter select * from dummy to verify the connection to SAP HANA One. (21:11 – 21:31)
  • Then, after SQL> enter select * from “LIVE2”.”Members” to return the Members table. (21:32 – 21:50)

Connecting to another HANA Box

  • Reenter the ODBC driver by typing in vi ~/.odbc.ini. (22:17 – 22:25)
  • Check to make SAP HANA Boxes have the same revision and then copy the current command and then paste it below. (23:16 – 23:45)
  • Next re-name the DSNs. Bob renames [HBD] to [REMOTEHDB] in the copied command and in the original command he renames [HDB] to [MYHDB]. (23:45 – 24:06)
  • Then change localhost:30015 to the correct IP host and instance name for the [REMOTEHDB] HANA box. In this example Bob changes it to 54.83.15.89:30115. (24:07 – 24:32)
  • After entering a quit command, enter isql –v REMOTEHDB to connect to the REMOTE HDB and then enters select * from dummy to verify the new connection. (24:33 – 25:07)

Bob’s tutorial video details how to configure Unix ODBC on a SAP HANA One instance on a Linux server and how to test the connection.

Screen Shot 2014-04-01 at 2.21.31 PM.png

View other tutorials on the HANA Live2! Project at the SAP HANA Academy.


SAP HANA Academy – over 500 free tutorial technical videos on using SAP HANA.


-Tom Flanagan

SAP HANA Academy

Follow @saphanaacademy

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply