Configure Single Client Access Name with Cloud DNS

You can access an Oracle® Real Application Clusters (RAC) cluster via a highly-available DNS name provided by Cloud DNS. This is achieved by pointing the DNS entry at a RAC Single Client Access Name (SCAN), which stays persistent as cluster topology changes.

Before you begin

You need access to the following resources and services to complete this guide:

System architecture

The following diagram shows the system architecture used in this guide:

A system architecture diagram of Google Cloud connected to an Oracle RAC cluster

Set up Cloud DNS to point to your RAC cluster

To set up single DNS name access to your RAC cluster, complete the following steps:

  1. If you haven't run the Google Cloud CLI previously, you must run the following command to specify your project name and authenticate with the Google Cloud console:

    gcloud auth login
    
  2. Enable the Cloud DNS API for your Google Cloud project.

  3. Create an inbound server policy in Cloud DNS for the VPC connected to your Bare Metal Solution servers. This makes sure your Bare Metal Solution servers can communicate with Cloud DNS.

  4. List the inbound forwarder entry points to determine the correct entry point IP address for each Bare Metal Solution server.

  5. Configure each Bare Metal Solution server to use the IP address from the previous step for name resolution. The steps involved are specific to your operating system.

    For example, to configure name resolution in Red Hat Enterprise Linux 8:

    1. Disable NetworkManager DNS processing.
    2. Add the following line to /etc/resolv.conf, replacing ENTRY_POINT_IP_ADDRESS with the entry point IP address:

      nameserver ENTRY_POINT_IP_ADDRESS
      
  6. Configure Cloud DNS for Private Google Access.

  7. Log into a Bare Metal Solution server that hosts a RAC database as the database user that was configured at install time.

  8. If you haven't set the ORACLE_HOME and PATH environment variable in your shell profile, set it now so you can connect to your database.

  9. Request the SCAN configuration with srvctl to find the SCAN name:

    srvctl config scan
    

    You should receive a response similar to the following example:

    SCAN name: cluster01-scan.mycompany.internal, Network: 1
    Subnet IPv4: /192.168.1.0/255.255.255.0/bond0.118, static
    Subnet IPv6:
    SCAN 1 IPv4 VIP: 192.168.1.30
    SCAN VIP is enabled
    SCAN 2 IPv4 VIP: 192.168.1.31
    SCAN VIP is enabled
    SCAN 3 IPv4 VIP: 192.168.1.32
    SCAN VIP is enabled
    

    The SCAN name in the previous response is cluster01-scan.mycompany.internal.

  10. Create a private zone in Cloud DNS, providing the following details:

    • A new zone name, to identify the zone in configuration commands.
    • A description for your zone, to better define its purpose.
    • The DNS name suffix for your zone, such as mycompany.internal. This should match the suffix of the SCAN name returned in the previous srvctl config scan command.
    • The VPC network that the private DNS zone should be visible to.
  11. Add a record to the previous zone, providing the following details:

    • The name of the zone you created in the previous step.
    • The full DNS name. In this guide, that's cluster01-scan.mycompany.internal.
    • The time to live (TTL). This is how long the DNS record is cached before it's refreshed.
    • The resource record type. For SCAN, this is an A record.
    • The SCAN IPs returned in the previous srvctl config scan command.

    Repeat this process for any additional names that need to be resolved.

  12. On the Bare Metal Solution server, validate that SCAN resolution is working with nslookup:

    nslookup cluster01-scan.mycompany.internal
    

    If successful, you should receive a response similar to the following example:

    Server:  10.158.0.3
    Address: 10.158.0.3#53
    
    Name: cluster01-scan.mycompany.internal
    Address: 192.168.1.32
    Name: cluster01-scan.mycompany.internal
    Address: 192.168.1.30
    Name: cluster01-scan.mycompany.internal
    Address: 192.168.1.31
    

You can now access your RAC cluster using a single, highly available, resilient DNS name via Cloud DNS.

Oracle is a registered trademark of Oracle and/or its affiliates.