EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB484313: How to connect to SAP HANA 1 and SAP HANA 2 from the same Intelligence Server


Community Admin

• Strategy


This article provides instructions for configuring SAP HANA 1 and SAP HANA 2. This article also explains how to add a DSN-less connection to SAP HANA 1 and SAP HANA 2.

Note: The below configuration is only needed if you wish to use both SAP HANA 1.0 and SAP HANA 2.0 drivers to connect to SAP HANA servers respectively. According to SAP Note "1906576 - SAP HANA client and server cross-version compatibility" SAP HANA 1.0 drivers can be used to connect to both SAP HANA 1.0 and SAP HANA 2.0 servers, please refer to the SAP Note for more details. 
If you wish to use only one driver to connect to both SAP HANA 1.0 and SAP HANA 2.0 servers, the below configuration is not needed. Only creating two different DSN pointing to the SAP HANA 1.0 and SAP HANA 2.0 server using the same SAP HANA client would be enough. 
Configuring odbcinst.ini and ODBC.sh is only needed for DSN-less connection to work.
For Strategy Workstation local mode on a Windows machine, it will use the system DSN of the SAP HANA driver, no extra configuration is needed on Strategy side.
All driver path used in this article are subject to change as per your machine configuration. 

SAP HANA 1 Configuration 

  • Download the driver and install it in the I-Server machine. Make sure to change the default installation directory to
    /home/mstr/sap/hdbclient1
    - here we added “1” at the end for easier identification.
ka04W000001IwoKQAS_0EM2R000000foWl.jpeg
  • The installation can be done with the GUI or the terminal.
  • Go to
     /opt/mstr/MicroStrategy/odbc.ini
    and add a DSN for SAP HANA 1.
    
    [ODBC Data Sources]
    SAP_HANA1=SAP HANA ODBC DRIVER
    
    [SAP_HANA1]
    Driver=/home/mstr/sap/hdbclient1/libodbcHDB.so
    Servernode=<ip-address-of-your-hana-instance>:<port>
    USER=SYSTEM
    PASSWORD= <your-hana-DB-user-password>
    DriverUnicodeType=1

  • For DSN-less connection to SAP HANA 1 to work, we need to configure
    /opt/mstr/MicroStrategy/odbcinst.ini
    and
    /opt/mstr/MicroStrategy/env/ODBC.sh.
  • In
    odbcinst.ini
    , find the line
    HDBODBC=Installed
    and edit it to be
    HDBODBC1=Installed. 
    Here we are giving a name to our ODBC driver. SAP HANA ODBC driver uses
    HDBODBC
    by default, but we are going to make it
    HDBODBC1
    for easier identification when determining which driver it is associated to.
  • In
    odbcinst.ini
    , find the following section
    
    [HDBODBC]
    Driver=/home/mstr/sap/hdbclient1/libodbcHDB.so
    Description=HANA Driver
    Setup=/home/mstr/sap/hdbclient1/libodbcHDB.so
    CPTimeout=0

    and edit
     [HDBODBC]
    to
    [HDBODBC1] 
    and add the path to the driver to the one from the previous steps,
    /home/mstr/sap/hdbclient1/.

  • In
    ODBC.sh
    , find the following section
    
    #
    #ODBC Driver for SAP HANA
    #
    SAPHANA_PATH='<SAPHANA_PATH>'
    
    if [ "${SAPHANA_PATH}" != '<SAPHANA_PATH>' ]; then
    	export SAPHANA_PATH
    	
    	mstr_append_path LD_LIBRARY_PATH "${SAPHANA_PATH:?}"
    	export LD_LIBRARY_PATH
    fi

    and edit it to
    
    #
    #ODBC Driver for SAP HANA 1
    #
    SAPHANA1_PATH=/home/mstr/sap/hdbclient1/
    
    if [ "${SAPHANA1_PATH}" != '<SAPHANA1_PATH>' ]; then
    	export SAPHANA1_PATH
    	
    	mstr_append_path LD_LIBRARY_PATH "${SAPHANA1_PATH:?}"
    	export LD_LIBRARY_PATH
    fi<
    	

  • Restart the I-Server.

SAP HANA 2 Configuration

  • Download the driver and install it in the I-Server machine. Make sure to change the default installation directory to
     /home/mstr/sap/hdbclient2 
    - here we added “2” at the end for easier identification.
  • While installing, the system will prompt you that an SAP HANA driver already exists and if you want to upgrade it or install in the same directory. We DO NOT want that. We want to install SAP HANA 2 driver in a different directory.
ka04W000001IwoKQAS_0EM2R000000foWq.jpeg
  • The installation can be done with the GUI or the terminal.
  • Go to
    /opt/mstr/MicroStrategy/odbc.ini
    and add a DSN for SAP HANA 2
    
    [ODBC Data Sources]
    SAP_HANA2=SAP HANA ODBC DRIVER
    
    [SAP_HANA2]
    Driver=/home/mstr/sap/hdbclient2/libodbcHDB.so
    Servernode:<ip-address-of-your-hana-instance>:<port>
    USER=SYSTEM
    PASSWORD= <your-hana-DB-user-password>
    DriverUnicodeType=1

  • For DSN-less connection to SAP HANA 2 to work we need to configure
     /opt/mstr/MicroStrategy/odbcinst.ini
    and
    /opt/mstr/MicroStrategy/env/ODBC.sh.
  • In odbcinst.ini, add the line
     HDBODBC2=Installed 
    just below
    HDBODBC1=Installed
    . Here we are giving a name to our ODBC driver. SAP HANA ODBC driver uses HDBODBC by default, but we are going to make it HDBODBC2 for easier identification when determining which driver it is associated to.
  • In
    odbcinst.ini
    , append the below section
    
    [HDBODBC2]
    Driver=/home/mstr/sap/hdbclient2/libodbcHDB.so
    Description=HANA Driver
    Setup=/home/mstr/sap/hdbclient2/libodbcHDB.so
    CPTimeout=0

  • In
    ODBC.sh
    , append the below section
    
    #
    #ODBC Driver for SAP HANA 2
    #
    SAPHANA2_PATH=/home/mstr/sap/hdbclient2/
    
    if [ "${SAPHANA2_PATH}" != '<SAPHANA1_PATH>' ]; then
    	export SAPHANA2_PATH
    	
    	mstr_append_path LD_LIBRARY_PATH "${SAPHANA2_PATH:?}"
    	export LD_LIBRARY_PATH
    fi

  • Restart the I-Server.

How to add a DSN-less connection to SAP HANA 1 and SAP HANA 2

SAP HANA 1 DSN-less

  1. Go to MSTR Web.
  2. Add External Data > Databases > Build a Query > Next.
  3. Click on the + icon next to the Data Sources.
  4. In the Data Source page, select DSN-less Data Sources.
  5. From the Database dropdown, select SAP HANA.
  6. From the Version drop-down, select SAP HANA 1.x. It might say, (Certified Driver not found), since it’s trying to find the Driver “HDBODBC” but we have edited the ODBC driver name as “HDBODBC1."
  7. Enter the IP and port of the HANA in the server and the port field respectively.
  8. Click on Show connection string > Edit connection string.
  9. From the Driver drop-down, do not select anything and leave it empty.
  10. In the connection string section edit the
     Driver={}
    and make it
    DRIVER={HDBODBC1}
    to point to our SAP HANA 1 driver in 
    odbcinst.ini.
  11. Enter the username and password for the SAP HANA Database.
  12. Enter a name for the Data source.
  13. Click Save.
ka04W000001IwoKQAS_0EM2R000000foWv.jpeg

SAP HANA 2 DSN-less

  1. Go to MSTR Web.
  2. Add External Data > Databases > Build a Query > Next.
  3. Click on the + icon next to the Data Sources.
  4. In the Data Source page, select DSN-less Data Sources.
  5. From the Database dropdown, select SAP HANA.
  6. From the Version drop-down, select SAP HANA 2.x. It might say, (Certified Driver not found), since it’s trying to find the Driver “HDBODBC” but we have edited the ODBC driver name as “HDBODBC2."
  7. Enter the IP and port of the HANA in the server and the port field respectively.
  8. Click on Show connection string > Edit connection string.
  9. From the Driver drop-down, do not select anything and leave it empty.
  10. In the connection string section edit the
     Driver={}
    and make it
    DRIVER={HDBODBC2}
    to point to our SAP HANA 2 driver in 
    odbcinst.ini.
  11. Enter the username and password for the SAP HANA Database.
  12. Enter a name for the Data source.
  13. Click Save.
ka04W000001IwoKQAS_0EM2R000000foX0.jpeg

 


Comment

0 comments

Details

Knowledge Article

Published:

June 3, 2020

Last Updated:

July 14, 2020