The latest release of Oracle Cloud Infrastructure (OCI) GoldenGate adds a much-requested feature: Single Client Access Name (SCAN) support! It enables our users to connect to Real Application Cluster (RAC) databases easily. Before you start setting up a connection to a RAC database using SCAN, let’s first review what SCAN is and how networking works in OCI GoldenGate.
Single Client Access Name (SCAN)
SCAN acts like a load balancer for a RAC database and allows database clients to connect to one of its listeners based on their availability and workload. Clients, such as OCI GoldenGate, first connect to one of the SCAN listeners. It returns the information of a database listener that the client uses to talk to the database cluster. You can learn more about SCAN in the Oracle database documentation.
OCI Networking and OCI GoldenGate
Like most OCI services, OCI GoldenGate sits in what is called the Oracle Services Network, an area reserved for Oracle services. When you create an OCI GoldenGate Deployment, it does not actually reside in your tenancy. It sits outside and can be accessed through the OCI Service Gateway via a public or private endpoint. This is important to understand, as this will impact how connections to your source and target databases are created using Connections.
Connections in OCI GoldenGate
When you create a Connection for a system that is publicly accessible, there isn’t any specific networking configuration created for OCI GoldenGate, and communication is routed via the OCI Service Gateway.
If you create a Connection to connect to a system that requires private access, then a Private Endpoint must be created to ensure that OCI GoldenGate can connect to it. Since OCI GoldenGate runs in the OCI Services Network, it uses the Reverse Connection functionality in OCI Private Endpoints. A reverse connection endpoint gets created on the private endpoint added in the customer’s subnet to access systems in the customer’s network privately. The connection initiated by OCI GoldenGate will originate from the Ingress IPs addresses mentioned in the Connections details page, as you can see below.

There can be more than one Ingress IP value. Any ingress rules to the customer’s subnet must allow ingress from these Ingress IP addresses.
Creating a Connection for a RAC Database in OCI GoldenGate
At this point, you should have an understanding of SCAN and how OCI networking works with OCI GoldenGate. You can now create a Connection to a RAC database residing in OCI using a SCAN listener.
First, log into Oracle Cloud Console, click Oracle Database in the menu, and then select GoldenGate.

On the OCI GoldenGate Overview page, click Create Connection.

Give it a Name, specify the Compartment where the Connection will be created, and select Oracle Database as the Type. Next, click Select database to pick a database in the same tenancy and region as OCI GoldenGate, or select Enter database information if you prefer to enter the database information manually or point to a database sitting outside of your tenancy and region.
In this example, I use Select database, and pick one of my RAC databases from the list. The rest of the values are automatically filled in, and I can review them and click Create to create the new Connection.

You may now wonder how it works if you cannot select the database and must enter the information manually. For example, you may want to connect to a RAC database running on-premises, or a RAC database residing in a different OCI Region. Let’s go through the same example and use Enter database information instead of Select database.
You still provide a Name, a Compartment where the Connection will be created, and a Type (Oracle Database). Next, you must pick Enter database information and fill in the required information. First, you need to provide a Database connection string. You can get this value from the database details page in OCI. Click on Oracle Database, then Oracle Base Database, then click on the DB Systems name.

Click on Databases in the menu on the left and click on the database you want to connect to.

Finally, click DB Connection and copy the Easy Connect or Long connections string.

Then paste it into the Database connection string field when creating the Connection. You can also get this information from a tnsnames.ora file.
Add the database username, and its password.
Finally, enable Network connectivity via private endpoint and set the Session Mode to Redirect when connecting to a RAC database. OCI GoldenGate will first access the SCAN listener and be redirected to a specific database node listener. Next, select a Subnet that has access to the RAC database and provide one of the SCAN IP address value in the RAC node IP field: you can find it in your database details page (SCAN IP Address) if it runs in OCI.

Your Connection creation page will look similar to this one:

Click Create, and after a few minutes, a new Connection appears in the list, and we can review its details (GoldenGate > Connections).
Next, assign the Connection to one of your Oracle deployments and log into the OCI GoldenGate Deployment Console to review the GoldenGate credential automatically created for this Connection.
On the Configuration screen, the database port used in the connection URL has been set to 16000 instead of the standard Oracle database port (1521). It is expected, the standard port has been substituted with a unique value ranging from 16000 to 65535 and points to a SCAN proxy port that OCI Private Endpoints require to support the SCAN protocol.
Note: By default, the connection string uses the Easy Connect format, which is easier to read. Oracle recommends using the Oracle Net connect descriptor / Long format instead to have the ability to specify connection timeouts and retries among other things. You can modify the credential in the GoldenGate Deployment Console to use this format. Please refer to the Oracle Database documentation for more information about connecting to an Oracle RAC Database using SCANs.
Click Connect in the Action column to test the connection to the RAC database!
Conclusion
Newly added support for SCAN makes it easy for you to connect to an Oracle RAC database in OCI GoldenGate. You can use it to connect to RAC databases on-premises, on OCI, or in other clouds. Autonomous Databases are also supported.
We are continuously adding new features to OCI GoldenGate. Stay tuned for new blogs coming up in the future!
