You can connect to an SAP HANA database from ArcGIS clients. To do so, 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.
Once the client is configured, create a database connection file. When publishing SAP HANA data from ArcMap to an ArcGIS Server site, register the database connection file with the site.
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 and configure the SAP HANA client ODBC driver
Follow these steps to configure the SAP HANA client ODBC driver used by ArcMap:
- Download a supported 32-bit SAP HANA clientfrom the SAP Support Portal, and install it on each ArcMap machine.
- Set up a system data source name (DSN) using the ODBC Data Source Administrator (32 bit).
You will 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 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.
- Click the System DSN tab in the ODBC Data Source Administrator (32 bit) and click Add.
The Create New Data Source dialog box opens.
- Choose the SAP HANA ODBC client and click Finish.
- Populate the Data Source Name, Description, and Server:Port information for your database.
- 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 changes and close the ODBC Advanced Setup dialog box.
- Click OK on the ODBC client setup and ODBC Data Source Administrator to close them.
- Click the System DSN tab in the ODBC Data Source Administrator (32 bit) and click Add.
- 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
Add a database connection using the Database Connection dialog box or Create Database Connection geoprocessing tool. The following steps describe using the Database Connection dialog box.
- Expand Database Connections in the Catalog tree in ArcMap or ArcCatalog and double-click Add Database Connection.
- Choose SAP HANA from the Database Platform drop-down list.
- In the Data source text box, type the data source name you configured for the ODBC driver.
- Choose Database authentication for the Authentication Type.
- Provide a valid user name and password in the User name and Password text boxes, respectively.
- 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. Also note that Save user name and password must be checked for connection files that provide ArcGIS services with access to the database or if you want to use the Catalog search to locate data accessed through this connection file.
- 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.
Connect from ArcGIS Server
If you want to publish from ArcMap to an ArcGIS Server site and want the resultant services to use the data in SAP HANA, install and configure a 64-bit SAP HANA client ODBC driver on each machine in the ArcGIS Server site and register the database with the site.
Install the SAP HANA client and configure the ODBC driver
Download the SAP HANA client ODBC driver, install it, and configure a data source name. Follow the steps appropriate for your ArcGIS Server operating system, either Windows or Linux.
ArcGIS Server on Windows
Follow these steps to configure the SAP HANA client ODBC driver on each ArcGIS Server Windows machine:
- Download a supported 64-bit SAP HANA client from the SAP Support Portal, and install it on each machine in the ArcGIS Server site.
- Set up a system data source name (DSN) using the ODBC Data Source Administrator (64 bit).
You will 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 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.
- Click the System DSN tab in the ODBC Data Source Administrator (64 bit) and click Add.
The Create New Data Source dialog box opens.
- Choose the SAP HANA ODBC client and click Finish.
- Populate the Data Source Name, Description, and Server:Port information for your database.
- 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 changes and close the ODBC Advanced Setup dialog box.
- Click OK on the ODBC client setup and ODBC Data Source Administrator to close them.
- Click the System DSN tab in the ODBC Data Source Administrator (64 bit) and click Add.
- 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.
ArcGIS Server on Linux
Follow these steps to configure the SAP HANA client ODBC driver on each ArcGIS Server Linux machine:
- Download a supported 64-bit SAP HANA client from the SAP Support Portal, and install it on each machine in the ArcGIS Server site.
- Install a Linux ODBC driver manager on each ArcGIS Server machine if one is not already installed.
- Edit the SAP HANA ODBC connection files. The files must be named .odbc.ini and .odbcinst.ini.
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
In the .odbcinst.ini file, such spacing is not required as shown in this example:
Description =SAP HANA ODBC Driver64 = /<usr>/sap/hdbclient/libodbcHDB.so
- Set up an ODBC data source name. Use this name when you connect from ArcGIS to the database.
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 Desktop 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.
Alter the init_user_param.sh script (Linux only)
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.
- Ensure that the ArcGIS Server installation owner on each machine has at least read and execute permissions on the database client libraries.
- Open the init_user_param.sh script in a text editor.
- 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
- Save and close the script.
- After you have configured the init_user_param.sh on each machine in your ArcGIS Server site, run the startserver.sh script to restart ArcGIS Server.
./startserver.sh
Register the database
If you want to publish web services using data in SAP HANA, register the database with your ArcGIS Server sites. See Register SAP HANA with ArcGIS Server in the ArcGIS Server help for instructions.