You can connect to an SAP HANA from ArcGIS clients. To do so, install and configure the SAP HANA ODBC driver on the ArcGIS client machines.
SAP HANA ODBC drivers are available to existing SAP HANA users as part of the HTTP client access package, or from the SAP Service Marketplace under Support Packages and Patches.
Once the client is configured, create a connection file. When connecting from ArcGIS Server, register the database connection file with ArcGIS Server.
Connect from ArcMap
To connect from ArcMap to SAP HANA, install and configure the SAP HANA ODBC driver on the ArcMap machine and create a connection from ArcMap to the database.
Install and configure SAP HANA ODBC driver
Follow these steps to configure the SAP HANA ODBC driver used by ArcMap:
- Download a supported 32-bit SAP HANA clientfrom the SAP Service Marketplace, and install it on the ArcMap machine.
- Specify the following key value in the Special property settings section of the ODBC Advanced Setup when creating the ODBC data source entry: SPATIALTYPES=1.
This key value enables spatial type support through the ODBC connection.
- After the ODBC driver is installed, set up an ODBC data source name. Use this 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 machine as you use when you configure the data source name for the ODBC driver on your ArcGIS for Server machine. If you do not use the same name, you will encounter problems when publishing to ArcGIS Server, because ArcGIS compares the connection strings of the data being published and the database that is registered.
- Set the PATH environment variable to the directory where the SAP HANA client is installed.
Connect to the database
Add a database connection using the Database Connection dialog box or Create Database Connection 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.
- Uncheck Save user name and password if you prefer not to save your login information as part of the connection; 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 Preparing resources for publishing as services for more information about sharing a connection file.
Connect from ArcGIS for Server
If you will be publishing data from SAP HANA to ArcGIS Server and want the resultant services to use the data in SAP HANA, install and configure a 64-bit SAP HANA ODBC driver on the ArcGIS Server machine and register the data warehouse with the GIS server.
Install and configure SAP HANA ODBC driver
Follow these steps to configure the SAP HANA ODBC driver used by ArcGIS Server:
- Download a supported 64-bit SAP HANA clientfrom the SAP Service Marketplace, and install it on the ArcGIS Server machine.
- If connecting from ArcGIS Server on Windows, do the following:
- Sspecify the following key value in the Special property settings section of the ODBC Advanced Setup when creating the ODBC data source entry: SPATIALTYPES=1.
This key value enables spatial type support through the ODBC connection.
- Set the PATH environment variable to the directory where the SAP HANA client is installed.
- Sspecify the following key value in the Special property settings section of the ODBC Advanced Setup when creating the ODBC data source entry: SPATIALTYPES=1.
- If connecting from ArcGIS Server on Linux, do the following:
- Install a Linux ODBC driver manager on the 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: Driver=HDBODBC Description=SAP Hana ODBC ServerNode=10.20.30.400:50115 UID=myuser Password=Mein00sr SPATIALTYPES=1 [ODBC] IANAAppCodePage=4 InstallDir=/usr/sap/hdbclient Trace=0 TraceDll=/opt/odbc64v51/lib/odbctrac.so TraceFile=/tmp/odbctrace.out UseCursorLib=0.
- Set up an ODBC data source name. Use this name when you connect from ArcGIS to the database.
If you set an ODBC data source name for the database, use the same name when configuring all SAP HANA ODBC clients to that same database. For example, configure the data source name on your ArcMap machine to be the same as the data source name for the SAP HANA ODBC driver on your ArcGIS for Server machine. If you do not use the same name, you will encounter problems when publishing to ArcGIS Server, 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 to reference them. You can access this script by browsing to the <ArcGIS Server installation directory>/arcgis/server/usr directory.
- Ensure that the ArcGIS Server installation owner 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 this line:
export LIB_ODBC_DRIVER_MANAGER=<Location_to_libodbc.so>/libodbc.so
- Replace <Location_to_libodbc.so> with the location of the Linux ODBC driver manager.
- Save and close the script.
- Restart each GIS server in your ArcGIS Server deployment by running the startserver.sh script.
./startserver.sh
Register the database
If you want your GIS web services to use the data in SAP HANA, register the database with ArcGIS Server. See Register an SAP HANA data warehouse with ArcGIS Server in the ArcGIS Server help for instructions.