Skip To Content

Connect to SAP HANA from ArcGIS

To connect to an SAP HANA database from ArcGIS clients, install and configure the SAP HANA client ODBC driver on the ArcGIS client machines.

SAP HANA client ODBC drivers are available to existing SAP users from the SAP Support Portal under Software Downloads.

Note:

ArcGIS currently does not support the SAP HANA 2.0 SPS04 ODBC driver.

Once the ODBC driver is configured on all your ArcGIS client machines, create a database connection file in ArcGIS Pro or ArcMap. To publish ArcGIS Server web services that reference the data in your SAP HANA database, register the database connection file with your ArcGIS Server sites.

Note:

Install 32- and 64-bit applications and ODBC drivers on separate machines to avoid issues that arise when different versions of the same drivers are installed on the same machine.

Connect from ArcGIS Pro

To connect from an ArcGIS Pro project to SAP HANA, install the SAP HANA client ODBC driver on the ArcGIS Pro machine and create a database connection.

Install the SAP HANA client

Follow these steps to download the SAP HANA client ODBC driver and configure the path variable on your client machine:

  1. Download a supported 64-bit SAP HANA client from the SAP Support Portal under Software Downloads, and install it on all ArcGIS Pro machines.
  2. Add the SAP HANA client installation directory to the Windows system PATH environment variable.

    For example, if you installed the SAP HANA client ODBC driver to C:\Program Files\sap\hdbclient, add that to the PATH environment variable.

Connect to the database

You can use the SAP HANA server name and the SQL port number to connect to the database if all of the following are true for your site:

  • Your SAP HANA database is a supported release, 2.0 SPS2 or later.
  • You're connecting from ArcGIS Pro 2.2 or a later release.
  • The number of characters in the SAP HANA server name and SQL port number of your SAP HANA server is fewer than 31.

If any of the above conditions are not met, you must configure a system data source name (DSN) for the SAP HANA client ODBC driver before you complete the following steps to connect from ArcGIS Pro.

Add a database connection using the Database Connection dialog box or the Create Database Connection geoprocessing tool. The following steps describe using the Database Connection dialog box.

  1. Right-click Databases in the Catalog pane and click New Database Connection.
  2. Choose SAP HANA from the Database Platform drop-down list.
  3. In the Data source text box, type one of the following:
    • The SAP HANA server name and the SQL port number used to communicate with the database separated by a colon (:). For example, if the fully qualified name of your SAP HANA server is myserver.network.com and SAP HANA communicates through port 98765, type myserver.network.com:98765.
    • The data source name you configured for the ODBC driver.
  4. Choose Database authentication for the Authentication Type.
  5. Provide a valid database user name and password in the User name and Password text boxes, respectively.
  6. If you prefer not to save your login information as part of the connection, uncheck Save user name and password; doing this can help maintain the security of the database. However, if you do this, you will be prompted to provide a user name and password every time you connect from desktop clients.

    Note:

    Save user name and password must be checked for connection files that you register with an ArcGIS Server site or if you want to search to locate data accessed through this connection file.

  7. Click OK to connect.

Configure a data source name (optional in most cases)

If any of the following conditions are true, you must configure a system data source name (DSN) for the SAP HANA client ODBC driver to connect to the database:

  • You're using SAP HANA 1.0 (any supported service pack release).
  • You're using ArcGIS Pro 2.1 or earlier.
  • The number of characters in the SAP HANA server name and SQL port number of your SAP HANA server exceeds 31.

If these conditions do not exist at your site, you can still configure a data source name to connect to SAP HANA, but it is not required.

Follow these steps to configure a data source name for your SAP HANA database:

  1. Open the ODBC Data Source Administrator (64 bit) on your client machine.

    Note:

    Use the same name when configuring all SAP HANA ODBC clients to that same database. For example, use the same data source name when you configure the SAP HANA client ODBC driver on your ArcGIS Pro machines as you use when you configure the data source name for the ODBC driver on your ArcGIS Server machines. If you do not use the same name, you will encounter problems when publishing, because ArcGIS compares the connection strings of the data being published and the database that is registered.

  2. Click the System DSN tab in the ODBC Data Source Administrator (64 bit) and click Add.
  3. Choose the SAP HANA ODBC client and click Finish.
  4. Provide a name, description, and SQL port number for the data source.
  5. Open the advanced settings for the ODBC client and add the property SPATIALTYPES and set its value to 1.

    Note:

    You can skip this step if you are using ArcGIS Pro 2.2 or a later release with a supported version of SAP HANA 2.0.

  6. Click OK on the ODBC client setup and ODBC Data Source Administrator to close them.

Connect from ArcMap

To connect from ArcMap to SAP HANA, install and configure the SAP HANA client ODBC driver on all ArcMap machines and create a connection from ArcMap to the database.

Install the SAP HANA client ODBC driver

Follow these steps to download the SAP HANA client ODBC driver and configure the path variable on your client machine:

  1. Download a supported 32-bit SAP HANA client from the SAP Support Portal, and install it on each ArcMap machine.
  2. Add the SAP HANA client installation directory to the Microsoft Windows system PATH environment variable.

    For example, if you installed the SAP HANA client ODBC driver to C:\Program Files\sap\hdbclient, add that to the PATH environment variable.

Connect to the database

You can use the SAP HANA server name and the SQL port number to connect to the database if all of the following are true for your site:

  • Your SAP HANA database is a supported release, 2.0 SPS2 or later.
  • You're connecting from ArcGIS Desktop 10.6.1 or a later release.
  • The number of characters in the SAP HANA server name and SQL port number of your SAP HANA server is fewer than 31.

If any of the above conditions are not met, you must configure a system data source name (DSN) for the SAP HANA client ODBC driver before you can proceed with the following steps to connect from ArcMap.

Add a database connection using the Database Connection dialog box or the Create Database Connection geoprocessing tool. The following steps describe using the Database Connection dialog box:

  1. Expand Database Connections in the Catalog tree in ArcMap or ArcCatalog and double-click Add Database Connection.
  2. Choose SAP HANA from the Database Platform drop-down list.
  3. In the Data source text box, type one of the following:
    • The SAP HANA server name and the SQL port number used to communicate with the database separated by a colon (:). For example, if the fully qualified name of your SAP HANA server is myserver.network.com and SAP HANA communicates through port 98765, type myserver.network.com:98765.
    • The data source name you configured for the ODBC driver.
  4. Choose Database authentication for the Authentication Type.
  5. Provide a valid user name and password in the User name and Password text boxes, respectively.
  6. If you prefer not to save your login information as part of the connection, uncheck Save user name and password; doing this can help maintain the security of the database. However, if you do this, you will be prompted to provide a user name and password every time you connect from desktop clients.

    Note:

    Save user name and password must be checked for connection files that you register with an ArcGIS Server site or if you want to use the Catalog search to locate data accessed through this connection file.

  7. Click OK to connect.

A file is created in \\<computer_name>\Users\<user_name>\AppData\Roaming\ESRI\Desktop<release#>\ArcCatalog.

You can move the connection to another location; just be sure users and applications that need to make a connection have read access to the directory where you place the connection file.

If you use the data from this connection as the source for a service, such as a geoprocessing or geocoding service, you may need to place the connection file in a shared location on your network. See Make your data accessible to ArcGIS Server for more information about sharing a connection file.

Configure a data source name (optional in most cases)

If any of the following conditions are true, you must configure a system data source name (DSN) for the SAP HANA client ODBC driver to connect to the database:

  • You're using SAP HANA 1.0 (any supported service pack release).
  • You're connecting from ArcGIS Desktop 10.6 or an earlier release.
  • The number of characters in the SAP HANA server name and SQL port number of your SAP HANA server exceeds 31.

If these conditions do not exist at your site, you can still configure a data source name to connect to SAP HANA, but it is not required.

Follow these steps to configure a data source name for your SAP HANA database:

  1. Open the ODBC Data Source Administrator (32 bit) on your client machine.

    Note:

    Use the same name when configuring all SAP HANA ODBC clients to that same database. For example, use the same data source name when you configure the SAP HANA client ODBC driver on your ArcMap machines as you use when you configure the data source name for the ODBC driver on your ArcGIS Server machines. If you do not use the same name, you will encounter problems when publishing, because ArcGIS compares the connection strings of the data being published and the database that is registered.

  2. Click the System DSN tab in the ODBC Data Source Administrator (64 bit) and click Add.
  3. Choose the SAP HANA ODBC client and click Finish.
  4. Provide a name, description, and SQL port number for the data source.
  5. Click OK on the ODBC client setup and ODBC Data Source Administrator to close them.

Connect from ArcGIS Server

If you want to publish SAP HANA data to an ArcGIS Server site and want the resultant services to use the data in SAP HANA, install a 64-bit SAP HANA client ODBC driver on each machine in the ArcGIS Server site. Follow the instructions specific to the operating system where ArcGIS Server is installed.

Once you've configured the machines in the ArcGIS Server site, create a database connection to your database and register the connection file with your ArcGIS Server site.

Install the SAP HANA on the ArcGIS Server machines (Microsoft Windows)

Download the SAP HANA client ODBC driver and install it on each machine in the ArcGIS Server site.

Install the SAP HANA client ODBC driver on each ArcGIS Server Windows machine:

  1. Download a supported 64-bit SAP HANA client from the SAP Support Portal, and install it on each machine in the ArcGIS Server site.
  2. Add the SAP HANA client installation directory to the Windows system PATH environment variable.

    For example, if you installed the SAP HANA client ODBC driver to C:\Program Files\sap\hdbclient, add that to the PATH environment variable.

Once you have the SAP HANA client ODBC driver installed, you can proceed with registering a database connection with your ArcGIS Server site. If the following conditions exist, however, you must configure a data source name for the ODBC driver before you register a database connection.

  • You're using SAP HANA 1.0 (any supported service pack release).
  • You're connecting to the database from ArcGIS Server 10.6 or an earlier release.
  • The number of characters in the SAP HANA server name and SQL port number of your SAP HANA server exceeds 31.

Configure an ODBC data source name on Windows (optional in most cases)

If you require a data source name, follow these steps to configure a system data source name (DSN) for the SAP HANA client ODBC driver on each ArcGIS Server Windows machine:

Note:

Use the data source name when you connect from ArcGIS to the database. Use the same name when configuring all SAP HANA ODBC clients to that same database. For example, use the same data source name when you configure the SAP HANA client ODBC driver on your ArcGIS Pro and ArcMap machines as you use when you configure the data source name for the ODBC driver on your ArcGIS Server machines. If you do not use the same name, you will encounter problems when publishing, because ArcGIS compares the connection strings of the data being published and the database that is registered.

  1. Open the ODBC Data Source Administrator (64 bit).
  2. Click the System DSN tab in the ODBC Data Source Administrator (64 bit) and click Add.

    The Create New Data Source dialog box appears.

  3. Choose the SAP HANA ODBC client and click Finish.
  4. Populate the Data Source Name, Description, and Server:Port information for your database.
  5. Click Settings to open the ODBC Advanced Setup dialog box and add the following key value to the Special property settings section: SPATIALTYPES=1. Click OK to apply the changes and close the ODBC Advanced Setup dialog box.

    Note:

    You can skip this step if you are using ArcGIS Server with a supported version of SAP HANA 2.0 or later.

  6. Click OK on the ODBC client setup and ODBC Data Source Administrator to close them.

Install the SAP HANA on the ArcGIS Server machines (Linux)

Download the SAP HANA client ODBC driver. Place the client on each machine in the ArcGIS Server site, install it, and edit the ArcGIS Server init_user_param.sh script on each ArcGIS Server Linux machine.

  1. Download a supported 64-bit SAP HANA client from the SAP Support Portal, and install it on each machine in the ArcGIS Server site.
  2. Install a Linux ODBC driver manager on each ArcGIS Server machine if one is not already installed.
  3. Once you have installed the database client files, alter the init_user_param.sh script installed with ArcGIS Server to reference the client files. You can access this script by browsing to the <ArcGIS Server installation directory>/arcgis/server/usr directory.

  4. Ensure that the ArcGIS Server installation owner on each machine has at least read and execute permissions on the database client libraries.
  5. Open the init_user_param.sh script in a text editor.
  6. Remove the comment mark (#) from these lines and replace the <SAPHANA_InstallDir> information with the path to the directory where you installed the SAP HANA client:

    export SAPHANADIR=<SAPHANA_InstallDir>/sap/hdbclient
    export LD_LIBRARY_PATH==$SAPHANADIR:$LD_LIBRARY_PATH

  7. Save and close the script.
  8. After you have configured the init_user_param.sh on each machine in your ArcGIS Server site, run the startserver.sh script on each machine to restart ArcGIS Server.

    ./startserver.sh

Once you have the SAP HANA client ODBC driver installed, you can proceed with registering a database connection with your ArcGIS Server site. If the following conditions exist, however, you must configure a data source name for the ODBC driver before you register a database connection.

  • You're using SAP HANA 1.0 (any supported service pack release).
  • You're connecting to the database from ArcGIS Server 10.6 or an earlier release.
  • The number of characters in the SAP HANA server name and SQL port number of your SAP HANA server exceeds 31.

Configure an ODBC data source name on Linux (optional in most cases)

If you require a data source name, follow these steps to configure a system data source name for the SAP HANA client ODBC driver on each ArcGIS Server Linux machine:

Note:

Use the same ODBC data source name when configuring all SAP HANA ODBC clients to that same database. For example, configure the data source name on your ArcGIS Pro and ArcMap machines to be the same as the data source name for the SAP HANA client ODBC driver on the machines in your ArcGIS Server sites. If you do not use the same name, you will encounter problems when publishing, because ArcGIS compares the connection strings of the data being published and the database that is registered.

  1. To configure an ODBC data source name, edit the SAP HANA ODBC connection files, .odbc.ini and .odbcinst.ini.

    The files must be named .odbc.ini and .odbcinst.ini.

  2. Open the .odbc.ini file in a text editor.

    Be sure there are no spaces around the equal signs (=) in the .odbc.ini file. For example, this entry does not have spaces around the equal signs:

    [<HANA_DNS>]
    Driver=/<usr>/sap/hdbclient/libodbcHDB.so
    Description=SAP Hana ODBC
    ServerNode=<HANA_Server_IP>:<SAP_HANA_port>
    UID=<user_name>
    Password=<user_password>
    SPATIALTYPES=1
    
    [ODBC]
    IANAAppCodePage=4
    InstallDir=/<usr>/sap/hdbclient
    Trace=0
    TraceDll=/opt/odbc64v51/lib/odbctrac.so
    TraceFile=/tmp/odbctrace.out
    UseCursorLib=0

    Note:

    The SPATIALTYPES=1 entry is not required if you are using ArcGIS Server with a supported version of SAP HANA 2.0 or a later release.

  3. Save and close the .odbc.ini file.
  4. Open the .odbcinst.ini file and edit it to include the ODBC driver path.

    In the .odbcinst.ini file, the same sort of spacing is not required, as shown in this example:

    Description  =SAP HANA ODBC
    Driver64         = /<usr>/sap/hdbclient/libodbcHDB.so

  5. Save and close the .odbcinst.ini file.

Register the database

If you want to publish web services using data in SAP HANA, create a database connection and register it with your ArcGIS Server sites. See Manage registered data stores in the ArcGIS Pro help, Register your data with ArcGIS Server using Server Manager, or Add items in the ArcGIS Enterprise portal user help for instructions.