Working with Oracle data

OpenGeo Suite can read and publish data from an Oracle Spatial database. Any table that has a valid geometry column can be published as a layer in GeoServer.

Note

Oracle format support is only available with OpenGeo Suite Enterprise. For more information on OpenGeo Suite Enterprise, please contact us.

Installing Oracle support is the same with most OpenGeo Suite Extensions but with an important additional step required at the end.

The first task is to install the OpenGeo Suite extension. But because of licensing issues, an additional file is required to be installed, and this must be done manually.

Installing Oracle support

Windows

  1. The Oracle extension can be added during the installation process. On the Components page, check the box for Oracle, in the section named GeoServer Extensions.

    ../../_images/oracle_components.png

    Oracle in the components list

    Note

    If OpenGeo Suite has already been installed, and you wish to install Oracle support at a later time, simply run the installer once more and uncheck all other items except for Oracle. This will add Oracle support to the existing OpenGeo Suite installation.

  2. Next, copy the Oracle JDBC driver from your Oracle installation to the GeoServer library directory. This file, often named ojdbc##.jar, can be found either on the installation media or by doing a search on the system that includes Oracle. To find the target, open the directory that contains your OpenGeo Suite installation (typically something like C:\Program Files\Boundless\OpenGeo\), navigate to the GeoServer Data Directory and then to jetty ‣ webapps ‣ geoserver ‣ WEB-INF ‣ lib.

    ../../_images/oracle_jar.png

    Oracle JAR file copied to the correct location

  3. After the file is copied, restart GeoServer. This can be done from the Start Menu by navigating to All Programs ‣ OpenGeo Suite and using the Stop and then Start shortcuts, or by restarting the OpenGeo Jetty service in the Windows Services dialog.

OS X

  1. The Oracle extension can be added to OpenGeo Suite by copying the contents of the oracle extension folder (not the folder itself) to the GeoServer library folder. The GeoServer library folder can be found by selecting Open Webapps Directory from the GeoServer menu and then navigating to geoserver ‣ WEB-INF ‣ lib.

    ../../_images/ext_webappsmenu2.png

    Opening the webapps directory from the GeoServer menu

  2. Next, copy the Oracle JDBC driver from your Oracle installation to the same directory. This file, often named ojdbc##.jar, can be found either on the installation media or by doing a search on the system that includes Oracle.

  3. Restart GeoServer. The easiest way to do this is to select Quit GeoServer from the GeoServer menu and then relaunch the application.

Ubuntu Linux

  1. The Oracle extension can be added to OpenGeo Suite by installing the geoserver-oracle package:

    apt-get install geoserver-oracle
    

    Note

    This command will need to be run as root or with sudo.

  2. Next, copy the Oracle JDBC driver from your Oracle installation to the GeoServer library directory. This file, often named ojdbc##.jar, can be found either on the installation media or by doing a search on the system that includes Oracle. The target in most installations will be /usr/share/opengeo/geoserver/WEB-INF/lib/.

  3. Restart the Tomcat service.

Red Hat Linux

  1. The Oracle extension can be added to OpenGeo Suite by installing the geoserver-oracle package:

    yum install geoserver-oracle
    

    Note

    This command will need to be run as root or with sudo.

  2. Next, copy the Oracle JDBC driver from your Oracle installation to the GeoServer library directory. This file, often named ojdbc##.jar, can be found either on the installation media or by doing a search on the system that includes Oracle. The target in most installations will be /usr/share/opengeo/geoserver/WEB-INF/lib/.

  3. Restart the Tomcat service.

Application servers

  1. The Oracle extension can be added to OpenGeo Suite by copying the contents of the oracle extension folder (not the folder itself) to the GeoServer library directory. If GeoServer is installed at /opt/tomcat/webapps/geoserver, the GeoServer library directory will be found at /opt/tomcat/webapps/geoserver/WEB-INF/lib.
  2. Next, copy the Oracle JDBC driver from your Oracle installation to the same directory. This file, often named ojdbc##.jar, can be found either on the installation media or by doing a search on the system that includes Oracle.
  3. Restart GeoServer or the application server.

Verifying installation

To verify that the extension has been installed properly:

  1. Log in to the GeoServer web interface.

  2. Click Stores then Add new store.

  3. In the list of Vector data stores, you should see three entries:

    • Oracle
    • Oracle (JNDI)
    • Oracle (OCI)
    ../../_images/oracle_stores.png

    Three ways to connect to an Oracle database

If you don’t see all of these entries, the extension did not install completely. In most cases, it is the plain Oracle option that is desired.

Note

If you see entries named Oracle NG, they are the correct entries. The NG part can be ignored.

Caveats

Oracle data will be assumed to be point geometries, so new layers will be styled accordingly. Data can be rendered as intended by changing the styling of the layer to use the correct geometry.