Configure an Oracle Java Cloud Service Instance for an Oracle RAC Database

Not Oracle Cloud Infrastructure This topic does not apply to Oracle Cloud Infrastructure. Identify the Cloud Infrastructure Used by a Service Instance.

After creating an Oracle Java Cloud Service instance that’s associated with an Oracle Real Application Cluster (RAC) database, take steps to further optimize the communication between your service instance and the database cluster.

Note:

This task is applicable only to service instances that meet all of the following criteria:
  • You created the service instance in an Oracle Cloud Infrastructure Classic region.

  • When you created the service instance, you selected the software edition Enterprise Edition with Coherence .

  • You associated the service instance with an Oracle Database Cloud Service deployment that is RAC-enabled.

Oracle Java Cloud Service provisions GridLink data sources in your Oracle WebLogic Server domain to connect to the selected Oracle Database cluster. GridLink provides dynamic load balancing and failover across the nodes in an Oracle Database cluster, and also receives notifications from the cluster when nodes are added or removed. To fully take advantage of these capabilities, Oracle recommends that you make the following modifications to your database and service instance:

  • Create an Oracle Database service that supports Cluster Ready Services (CRS) and the Oracle Notification Service (ONS). These services monitor the status of resources in the database cluster and generate notifications when a status changes.

  • Update WebLogic Server to connect to this new database service using the Single Client Access Name (SCAN) port 1521. The SCAN service provides WebLogic Server with the specific location of an available database node. WebLogic Server then connects to a specific database node using port 1522.

  • If you did not assign an IP network to the database deployment, the database service redirects requests to the database nodes’ public IP addresses. You must create an access rule for the database deployment that permits traffic from the WebLogic Server nodes to port 1522.

Follow these steps:

  1. Create a cluster-enabled service in your existing Oracle Database Cloud Service deployment.
    1. Access the Oracle Java Cloud Service console.
    2. Click the name of the service instance that you want to update.
    3. At the bottom of the Overview page, expand Associations.
    4. Click the name of the Oracle Database Cloud Service deployment that’s associated with this service instance.
    5. Place your cursor over the Connect String field.
      The name of the existing database service displays. For example, SERVICE_NAME=PDB1.123456789.oraclecloud.internal.
    6. Copy the name of the database service, and replace the first word with myservice.

      For example, myservice.123456789.oraclecloud.internal.

      In subsequent steps, this value will be referred to as NEW_SERVICE_NAME.

    7. Identify the Public IP for the first node in this database deployment.
    8. Connect to this IP address using a Secure Shell (SSH) client.
    9. Switch to the oracle user.
      sudo su - oracle
    10. Use svrctl to define a new database service.
      srvctl add service -db orcl -service NEW_SERVICE_NAME -preferred orcl1,orcl2 -pdb pdb1
      srvctl modify service -db orcl -service NEW_SERVICE_NAME -rlbgoal SERVICE_TIME -clbgoal SHORT -pdb pdb1
      srvctl start service -db orcl -service NEW_SERVICE_NAME
  2. Update the boot database URLs in the WebLogic Server domain files.
    1. Return to your service instance in the Oracle Java Cloud Service console.

      Tip:

      From the Oracle Database Cloud Service console, you can use the navigation links at the top of the page to return to your Oracle Java Cloud Service instance.
    2. Identify the Public IP for the first node in this service instance.
    3. Connect to this IP address using an SSH client.
    4. Switch to the oracle user.
      sudo su - oracle
    5. Navigate to the directory config/fmwconfig within your domain configuration.
      cd $DOMAIN_HOME/config/fmwconfig
    6. Edit the file jps-config.xml.
    7. Locate this line in the file.
      <property name="jdbc.url" value="JDBC_URL"/>
    8. Within the JDBC URL, insert the text (LOAD_BALANCE=ON) after the existing text ADDRESS_LIST=.
      jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)...
    9. Within the JDBC URL, change port 1522 to port 1521.
      jdbc:oracle:thin:...(PORT=1521)...
    10. Within the JDBC URL, replace the value of SERVICE_NAME with your new database service name.
      jdbc:oracle:thin:...(SERVICE_NAME=NEW_SERVICE_NAME...
    11. Copy the updated JDBC URL. Then save your changes.

      An example JDBC URL is shown below:

      jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=MyDB-scan-int)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=myservice.123456789.oraclecloud.internal)))
    12. Edit the file jps-config-jse.xml.
    13. Locate this line in the file.
      <property name="jdbc.url" value="JDBC_URL"/>
    14. Replace the value with the updated JDBC URL. Then save your changes.
  3. Update the default data sources in your WebLogic Server domain.
    1. Return to your service instance in the Oracle Java Cloud Service console.
    2. Click Manage this instance menu icon, and then select Open WebLogic Server Administration Console.
    3. Log into the console as the WebLogic Server administrator.
    4. Click Lock & Edit.
    5. From the Domain Structure panel, expand Services, and then click Data Sources.
    6. Click LocalSvcTblDataSource.
    7. Click the Connection Pool tab.
    8. Replace the value of URL with the updated JDBC URL.
    9. Click Save.
    10. Click the ONS tab.
    11. Verify that these fields are configured correctly:
      • Fan Enabled: Yes

      • ONS Nodes: INSTANCE_NAME-scan-int:6200

    12. Repeat from step e to perform the same modification to all remaining GridLink data sources in the domain, including:
      • mds-owsm

      • opss-audit-DBDS

      • opss-audit-viewDS

      • opss-data-source

    13. Click Activate Changes.
  4. Create access rules to permit traffic from your service instance to port 1522 on the database.

    Note:

    This step is required only if the Oracle Java Cloud Service instance and the Oracle Database Cloud Service deployment are not assigned to an IP network.
    1. Return to your service instance in the Oracle Java Cloud Service console.
    2. Identify the Public IP addresses for all nodes in this service instance that will access the RAC database.
    3. At the bottom of the page, expand Associations.
    4. Click the name of the Oracle Database Cloud Service deployment that’s associated with this service instance.
    5. On the Overview page, click Manage this instance menu icon, and then select Access Rules.
    6. On the Access Rules page, click Create Rule.
    7. For Rule Name, enter the name of your Oracle Java Cloud Service instance.
    8. For Source, select <custom>. Enter the public IP addresses of the nodes in your Oracle Java Cloud Service instance as a comma-separated list.

      For example: 203.0.113.13,203.0.113.14,203.0.113.15

      Note:

      You will need to create additional access rules each time you scale out your service instance. Alternatively, you can specify multiple IP addresses in CIDR format, such as 203.0.113.1/24.
    9. For Destination, select DB_1
    10. For Destination Port(s), enter 1522.
    11. Accept the default Protocol (TCP).
    12. Click Create.
    13. Use the navigation links at the top of the page to return to your Oracle Java Cloud Service instance.
  5. Restart the service instance.
    1. On the Overview page, click Restart Service Restart icon.
    2. When prompted for confirmation, click OK.