Configuring a custom external database

You can configure your Operational Decision Manager instance to connect to a custom external database. A URL to download the database drivers must be specified at deployment time.

Before you begin

If you use a custom external database, you are responsible for the backup and recovery process.

About this task

Operational Decision Manager supports database connections to custom external databases. To use a custom external database, you must create a data source secret. Then, you must set the externalCustomDatabase.datasourceRef parameter in the odm_configuration section of your custom resource file.

Sample YAML files are provided in the cert-kubernetes/ODM/configuration/custom-external-database folder. For more information about downloading cert-kubernetes, see and Option 1: Preparing your cluster for an online deployment.

Procedure

  1. Create an XML file to configure the Decision Center data source.

    Name the file datasource-dc.xml.

    The following example shows a configuration file for Oracle.

    The ${server.config.dir}/resources path must not be modified. The path locates a directory in the container. To set the driver URL, refer to step 4. You must set the tag isolationLevel to TRANSACTION_READ_COMMITTED to avoid database access problems and provide a better concurrency experience.

    <server>
        <!-- Declare the jar files for Oracle access through JDBC. -->
        <library id="OracleLib">
                <fileset dir="${server.config.dir}/resources"/>
        </library>
    
        <!-- Declare the database -->
        <dataSource jndiName="jdbc/ilogDataSource"
                    isolationLevel="TRANSACTION_READ_COMMITTED"
                    statementCacheSize="150">
                <connectionManager maxPoolSize="25"
                                   minPoolSize="10"
                                   connectionTimout="10s"
                                   agedTimeout="30m"/>
                <jdbcDriver libraryRef="OracleLib"/>
                <properties.oracle driverType="thin" 
                                   databaseName="xe" 
                                   serverName="oracleServerName" 
                                   portNumber="1521" 
                                   user="system" 
                                   password="oracle"/>
        </dataSource>
    </server>
    For information about properties.oracle for the Liberty server, see OAuth Provider Definition (oauthProvider): databaseStore > dataSource > properties.oracle.
  2. Create an XML file to configure the Decision Server data source.

    Name the file datasource-ds.xml.

    The following example shows a configuration file for Oracle.

    <server>
        <!-- Declare the jar files for Oracle access through JDBC. -->
        <library id="OracleLib">
                <fileset dir="${server.config.dir}/resources"/>
        </library>
    
        <!-- Declare the database -->
        <dataSource jndiName="jdbc/resdatasource">
                <jdbcDriver libraryRef="OracleLib"/>
                <properties.oracle driverType="thin" 
                                   databaseName="xe" 
                                   serverName="oracleServerName" 
                                   portNumber="1521" 
                                   user="system" 
                                   password="oracle"/>
        </dataSource>
    </server>
  3. Create a secret from the two XML files.
    Use the kubectl create secret command to create a secret. The following example creates customdatasource-secret.
    kubectl create secret generic customdatasource-secret --from-file datasource-ds.xml --from-file datasource-dc.xml
  4. When you configure Operational Decision Manager, use the custom parameters for the secret that you created. You can provide your own driver to use your own external database by setting the sc_drivers_url parameter. For more information, see Preparing customized versions of JDBC drivers and CCSAP libraries.

    The sc_driver_url parameter accepts compressed files (in .zip, .tar, .tar.gz, .tar.bz2, or .tar.xz formats) with the following structure: jdbc/db2|oracle|postgresql|sqlserver/driver_files.

    spec: 
      shared_configuration:
        sc_driver_url: https://url-to-driver
      odm_configuration:
        externalCustomDatabase:
         datasourceRef: customdatasource-secret