Database setup

Oracle

Before installing service.monitor, install and prepare Oracle database ready to use. Oracle database is not supplied with service.monitor installation.

Follow the steps using the appropriate tools (e.g. SQLPlus) or on the command line.

Create DB user and tablespace

In this example, the tablespace created is given the name monitor and the user has the username monitor and password monitor.

Creating the Tablespace and schema
CREATE TABLESPACE monitor
    DATAFILE '<PATH_TO_DATAFILE>.dbf'
    SIZE 50M
    AUTOEXTEND ON NEXT 200K
    MAXSIZE 1000M;
CREATE USER monitor identified by monitor;
ALTER USER monitor
      default tablespace monitor
      temporary tablespace TEMP;
GRANT UNLIMITED TABLESPACE TO monitor;
GRANT CONNECT, RESOURCE TO monitor;
GRANT CREATE SESSION TO monitor;
GRANT CREATE TABLE TO monitor;
GRANT CREATE SEQUENCE TO monitor;
Before running the script it is necessary to change the paths to the data file in the script to reflect your system, e.g. to: C:\oracle\oradata\instance\smdat.dbf.

Create tables

Now, as the application user being logged on execute resources\sql\sm-db\oracle\schema.sql to get tables and indices created.

PostgreSQL

Before installing service.monitor, install and prepare PostgreSQL database ready to use. The PostgreSQL database is not supplied with service.monitor installation.

Follow the steps using the appropriate tools (e.g. pgadmin or psql) or on the command line.

Create DB user and tablespace

In this example, the database created is given the name servicemonitor, and the user has the username monitor and password monitor.

Creating a new database (appropiate db rights necessary)
CREATE Database servicemonitor;
Create a new database user
CREATE USER monitor;
ALTER USER monitor WITH PASSWORD 'monitor';
GRANT ALL PRIVILEGES ON DATABASE servicemonitor TO monitor;

Create tables

Now, as the application user being logged on execute resources\sql\sm-db\postgresql\schema.sql to get tables and indices created.

MS SQL Server

Before installing service.monitor, install and prepare MS SQL Server database ready to use. The MS SQL Server database is not supplied with service.monitor installation.

Create DB user and tablespace

Please use MS SQL Server Administrator to create database schema and database user.

Create tables

Now, as the application user being logged on execute resources\sql\sm-db\mssqlserver\schema.sql to get tables and indices created.

Container managed database connection (JNDI)

If you are going for container managed database connections (JNDI), the database driver (JAR file) must be copied to the appropriate location for the servlet container. For Apache Tomcat, this directory is <Tomcat>/lib.

The files must be provided by the operator of the software:

  • ojdbc<version>.jar (Oracle)

  • postgresql-<version>.jar (PostgreSQL)

  • sqljdbc-<version>.jar (MS SQL Server)

In the event that the Tomcat is to establish the database connection and jndi will be configured rather than jdbc, two further configuration steps are necessary.

  1. Adjust server.xml
    You will find prepared XML sections under resources\tomcat-jndi-resources. Adjust the correct information about user, password and database connection URL. Copy this section into the file %TOMCAT%\conf\server.xml add the element to GlobalNamingResources.

  2. Adjust context.xml
    Replace the file %TOMCAT%\webapps\monitor.war\META-INF\context.xml by the file %TOMCAT%\webapps\monitor.war\META-INF\jndi\context.xml.

JNDI Datenbankverbindungen auf Linux-Systemen mit Tomcat

Due to a bug in the default configuration of Apache Tomcat on Linux systems, the above entry for the server.xml file must be extended by factory="org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory".

Esri Enterprise Geodatabases

For monitoring Esri Enterprise Geodatabases (EGDB) it is necessary to take further manual steps:

  1. Add an arcobjects.jar to service.monitor’s classpath. This must have the same version as the EGDB you want to monitor.

  2. Add a Java system variable to the start parameters of your servlet container that points to your ArcGIS instance, e.g.: -Djava.library.path="c:\Program Files\ArcGIS\Server\bin".

  3. Make sure that suitable JDBC drivers are available to connect to the EGDB, for Oracle the Oracle Instant Client must be installed.