Configuring a custom external database

You can choose a custom external database for your ODM Kubernetes release.

About this task

ODM for production supports database connections to custom external databases, for example Oracle databases. In this case, the customer is responsible for the backup and recovery process.

To use a custom external database, configure the following parameters:

  • externalCustomDatabase.datasourceRef: data source secret for both Decision Center and Decision Server data source files.
  • externalDatabase.driversUrl: URL of the database driver.

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.

    <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>
    Note: 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 hence provide a better concurrency experience.

  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 the secret customdatasource-secret.
    kubectl create secret generic customdatasource-secret --from-file datasource-ds.xml --from-file datasource-dc.xml
  4. When you install a new Operational Decision Manager release, use the custom parameters for the secret that you created, and set the database driver URL in the external database parameter.
    externalCustomDatabase.datasourceRef=customdatasource-secret
    externalDatabase.driversUrl=<url-to-driver>
    Note: The driversUrl parameter accepts a unique URL or a list of URLs.

    Each URL can link to a single .jar file, or to compressed files in .zip, .tar, .tar.gz, .tar.bz2, or .tar.xz format with the following structure: jdbc/db2|oracle|postgresql|sqlserver/driver_files.

    To set a list of values, use the following syntax:
    --set externalDatabase.driversUrl="{url1,url2}"