Using TNS with Oracle database collections

Background

This article describes how to configure Funnelback to connect to distributed Oracle databases configured with TNS names.

Oracle distributed databases

Oracle databases have support for distributed databases using their proprietary TNS names configuration.

Funnelback can be configured to use the tnsnames.ora file when crawling.

Configuration steps

The following steps configure Funnelback to use a tnsnames.ora file:

  1. Download the Oracle JDBC drivers (note you must use the Oracle JDBC driver v10.2.0.1.0 or newer)

  2. Create a database collection as per normal

  3. Copy the tnsnames.ora file to the collection’s configuration folder

  4. Add the following to the collection.cfg for the database collection:

    java_options= -Doracle.net.tns_admin=$SEARCH_HOME/conf/$COLLECTION_NAME
  5. Update the db.jdbc_url to be the following format: jdbc:oracle:thin:@<TNSNAME> (replace <TNSNAME> with the identifier from the tnsnames.ora file).

If using Funnelback 12.4 or earlier you also need to patch the database.pm (approx line 243) to ensure that java_options are applied to the database command:

$SEARCH_HOME/lib/perl/Funnelback/Collection/Database.pm
    # build our dbgather command
    my @dbgather_command = ( $java_binary,
                             '-Xms' . $max_heap . 'm', # min / initial heap size
                             '-Xmx' . $max_heap . 'm', # max heap size
                             '-Dfile.encoding=UTF-8',
                 "-cp",
                 "$classpath_string");

    if ($java_options ne "") {
        my @java_opts = split(' ', $java_options);
        push @dbgather_command, @java_opts;
    }

    push @dbgather_command, "com.funnelback.dbgather.Main";
    if (wantarray()) {