Create a Data Source for a DB System Database

Use the model Yaml templates to create a data source for an Oracle Cloud Infrastructure Database.

Following is an example of model Yaml template for app deployment with single-instance (SI) DB System data source properties:

Note:

The template files are located at /u01/shared/scripts/pipeline/templates on the administration host.
resources:
  JDBCSystemResource:
    hellods:
      Target: '@@ENV:RESOURCE_PREFIX@@-cluster'
      JdbcResource:
        JDBCDataSourceParams:
          JNDIName: jdbc/hellods
        JDBCDriverParams:
          DriverName: oracle.jdbc.OracleDriver
          URL: '@@SECRET:@@ENV:DOMAIN_UID@@-datasource-secret:url@@'
          PasswordEncrypted: '@@SECRET:@@ENV:DOMAIN_UID@@-datasource-secret:password@@'
          Properties:
            user:
              Value:
            oracle.net.CONNECT_TIMEOUT:
              Value: '120000'
            SendStreamAsBlob:
              Value: true
        JDBCConnectionPoolParams:
          InitialCapacity: 1
          MaxCapacity: 1
          TestTableName: SQL ISVALID
          TestConnectionsOnReserve: true

You must set up the database to create a schema user before you create the data source and update . See Prerequisites to Create a Data Source.

  1. Update the schema user that you created in the Properties section in the model Yaml template.

    See Prerequisites to Create a Data Source.

    For example:

    Properties:
      user:
        Value: <schema user>
  2. Create the data source secrets in the model Yaml file as follows:
    1. Obtain the tns connect string using the python script.
      python3 /u01/shared/scripts/pipeline/create_domain/scripts/precheck_utils.py "get_oci_db_connect_string" "<database_ocid>"
    2. Create <domainuid>-datasource-secret with password and url using the kubectl command.

      For example:

      kubectl create secret generic <domainuid>-datasource-secret --from-literal=password=<password>
      --from-literal=url='jdbc:oracle:thin:@//wrdb19-scan.subnet2ad2phx.paasdevjcsphx.oraclevcn.com:1521/WRPDB.SUBNET2AD2PHX.PAASDEVJCSPHX.ORACLEVCN.COM'
      -n <domainname>-ns