Transforming certified containers for multischema

Use the following steps to transform certified containers for multischema.

Before you begin

Ensure that you have completed configurations specific to the database that you are using. For more information, see Customizing certified containers.

Procedure

  1. Create database schemas that are required to be used with multischema by using the steps specific to your database. Following are the minimum required schemas:
    • Configuration schema, such as omdb_conf
    • Master schema, such as omdb_mstr
    • Transaction schema, such as omdb_tran
    • Statistics schema, such as omdb_stat
  2. Ensure to set the properties, multischema.enabled=true and multischema.version=10.0 as explained in Sandbox.cfg sharded properties.
  3. Create or modify the multischema.xml. Ensure that you add a datasource parameter as shown in the following sample snippet. The datasource parameter is used when setting up datasources in Liberty server.xml.
    <pool id="DEFAULT_STATISTICS">
                <jdbc>                
                    <param name="url" value="<jdbc_connection_url>"/>
                    <param name="user" value="omdb_stat"/>
                    <param name="password" value="omdb_stat"/>
                    <param name="driver" value="<db_driver_class>"/>
                    <param name="schema" value="OMDB_STAT"/>
                    <param name="datasource" value="jdbc/OMDB_STAT"/>
                </jdbc>
    </pool>
    Note:
    • For <jdbc_connection_url>, provide the jdbc connection URL of your database.
    • For <db_driver_class>, provide any one from the following values, based on the database you are using.
      • For Oracle: oracle.jdbc.OracleDriver
      • For DB2: com.ibm.db2.jcc.DB2Driver
      • For PostgreSQL: org.postgresql.Driver
  4. Specify the metadata schema information in the system_overrides.properties.
  5. Update the Liberty server.xml to add more datasources for each of the schemas that are added in multischema.xml. Ensure that the value of jndiName matches with the value of datasource parameter that is provided in the multischema.xml. The following snippet is an example of datasource that is configured in server.xml for one of the schemas.
    <dataSource jndiName="jdbc/OMDB_STAT">
          <properties.<db_suffix> databaseName="<db_name>" serverName="<db_host>" portNumber="<db_port>" password="<db_schema_password>" user="<db_schema_user>"/>
          <jdbcDriver libraryRef="dblib"/>
          <connectionManager minPoolSize="10" maxPoolSize="80"/>
    </dataSource>
    Note:
    • Ensure that your database driver is present in the libraryRef that is used in the datasource.
    • For <db_suffix>, provide any one from the following values, based on the database you are using.
      • For Oracle: oracle
      • For DB2: db2.jcc
      • For PostgreSQL: postgresql