Configuring a connection to a database in ArcGIS Server

To connect ArcGIS Server to a supported database platform, you'll need to do the following:

Install and configure the database client software

The following topics provide instructions on how to install and configure client software for specific databases. Keep in mind that you must install a release of the client software that is compatible with the release of the database in which you want to connect.

Follow the instructions in the topics below to set up connections to databases in ArcGIS Server:

Reference the database client libraries in the init_user_param.sh script

Once you have set up a connection to a database, you'll need to add the reference of the database client libraries with ArcGIS Server in the init_user_param.sh script. You can access this script by navigating to the <ArcGIS Server installation directory>/arcgis/server/usr directory.

NoteNote:

Before adding the reference, ensure that the ArcGIS Server installation owner has at least read and execute permissions on the database client libraries.

In the init_user_param.sh script, edit the section that is relevant to your RDBMS by referencing the database client libraries and other database variables. To enable the variables, remove # from the lines beginning with export.

For example:

DB2

#
# For Direct Connect with DB2
#
export DB2_CLIENT_HOME=<DB2_InstallDir>
export DB2INSTANCE=<set when data source name is cataloged>
export PATH=DB2_CLIENT_HOME/bin:$PATH
export LD_LIBRARY_PATH=$DB2_CLIENT_HOME/lib64:$LD_LIBRARY_PATH

Informix

# 
# For Direct Connect with Informix
#
export INFORMIXDIR=<Informix_InstallDir>
export INFORMIXSERVER=<Informix_Database_Server_Name>
export INFORMIXSQLHOSTS=<Location_to_sqlhosts>
export ODBCINI=<Location_to_.odbc.ini>
export PATH=$INFORMIXDIR/bin:$PATH
export LD_LIBRARY_PATH=$INFORMIXDIR/lib:$INFORMIXDIR/lib/cli:$INFORMIXDIR/lib/esql:$LD_LIBRARY_PATH

Netezza

# -----------------------------------------------------------------------
# Modify this section to configure a connection to Netezza.
#
# To make a connection, name the ODBC connection files as .odbcinst.ini 
# and .odbc.ini and store them in the ArcGIS Server's $HOME directory. 
#
# -----------------------------------------------------------------------
#export LIB_ODBC_DRIVER_MANAGER=<Location_to_libodbc.so.2.0.0>/libodbc.so.2.0.0

Oracle

#
# For Direct Connect with Oracle
#
export ORACLE_BASE=<Oracle_Installdir>/app
export ORACLE_HOME=$ORACLE_BASE/<Oracle_Release>/product/<Oracle_Version>/client_1
export ORACLE_SID=<set when applicable>
export TNS_ADMIN=<set when applicable. e.g.$ORACLE_HOME/network/admin>
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

NoteNote:

If you have installed multiple Oracle clients, you will see multiple Oracle client folders. Make sure the ORACLE_HOME variable is set to the folder you intend to use to directly connect to the database in ArcGIS Server.

If you download the Oracle database instant client libraries from the Esri Customer Care Portal, only the $LD_LIBRARY_PATH needs to be referenced. For example:

#
# For Direct Connect with Oracle Client from Esri Customer Care Portal
#
export LD_LIBRARY_PATH=<Location_to_instantclient_11_2>:$LD_LIBRARY_PATH

PostgreSQL

#
# For Direct Connect with PostgreSQL
#
export PGHOME=<PostgreSQL_InstallDir>
export PATH=$PGHOME/bin:$PATH
export LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATH

Restart ArcGIS Server

In order for your settings to take effect in the init_user_param.sh script, you'll need to restart ArcGIS Server. You can do this by manually restarting each GIS server in your deployment by running the startserver.sh script.

Test your connection

Once you've configured your connection to a database in ArcGIS Server, you should test the connection by:

  1. Registering the database with the server
  2. Publishing a service to the server using data residing in the database

If you encounter problems with your connection, consult the server logs for more information. To learn more about server logging, see Viewing, querying, and configuring server logs.

NoteNote:

If you've previously referenced the database client libraries in your user profile, you will still be able to connect to your databases in ArcGIS Server. However, if the reference information differs between the user profile and init_user_param.sh, you may experience problems when attempting to connect to the database. To alleviate connection issues, remove the reference information from your user profile and re-reference your database client libraries using the method described above.

12/18/2014