Create an Active GridLink Data Source for a RAC Database

Use the model Yaml templates to create an Active GridLink (AGL) data source for an Oracle Real Application Cluster (RAC) database with WebLogic Suite Edition.

Following is an example of model Yaml template for app deployment with AGL datasource (RAC as infra DB with WebLogic Enterprise Edition) 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:
        DatasourceType: AGL
        JDBCConnectionPoolParams:
          StatementCacheSize: 0
          TestTableName: SQL ISVALID
        JDBCDataSourceParams:
          GlobalTransactionsProtocol: None
          JNDIName: [ jdbc/hellods ]
        JDBCDriverParams:
          DriverName: oracle.jdbc.replay.OracleDataSourceImpl
          URL: '@@SECRET:@@ENV:DOMAIN_UID@@-datasource-secret:url@@'
          PasswordEncrypted: '@@SECRET:@@ENV:DOMAIN_UID@@-datasource-secret:password@@'
          Properties:
            user:
              Value:
        JDBCOracleParams:
          FanEnabled: true
          ActiveGridlink: true
          OnsNodeList:

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

  1. Update the Properties section in the model Yaml template to set OnsNodeList.
    1. Open an SSH connection to a node as the opc user.
      ssh -i <path_to_private_key> opc@<node_public_ip>
    2. Go to /u01/shared/helper-scripts location and invoke the following script:
      ./scan_address.sh
      <db_hostname>-scan.subnet2ad2phx.paasdevjcsphx.oraclevcn.com:6200
  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:@//<db_hostname>-scan.subnet2ad2phx.paasdevjcsphx.oraclevcn.com:1521/<service_name>'
      -n <domainname>-ns