AWS Database Blog
Use Oracle Real Application Clusters as a source for AWS DMS
AWS Database Migration Service (AWS DMS) is a managed migration and replication service that helps you move your database to AWS quickly, securely, and with minimal downtime and zero data loss. You can migrate data from one or many Oracle databases using AWS DMS. With an Oracle database as a source, you can migrate data to any of the targets supported by AWS DMS.
Oracle Real Application Clusters (RAC) is a technology that allows an Oracle database to run across multiple servers. The main benefits are increased availability and horizontal scalability. RAC enables user sessions to fail over and replay changes on another server in the event of an outage, without requiring any modifications to applications.
With the high availability features of Oracle RAC, you can achieve a more reliable migration when using AWS DMS. However, because Oracle RAC has multiple hostnames and IP addresses, there may be confusion over which host or IP address to configure in AWS DMS for Oracle RAC database.
In this post, we explore the steps to configure Oracle RAC as a source for AWS DMS.
Solution overview
There are three options to configure Oracle RAC as a source endpoint:
- Use Amazon Route 53 Resolver and the RAC Single Client Access Name(SCAN)
- Use the RAC SCAN IP
- Create a replication instance with the AWS Command Line Interface (AWS CLI) to use on-premises DNS for RAC scan name resolution.
We discuss the steps for all three options in this post. You should choose the option that is best suited for your use case.
The following diagram shows a RAC database with a two node cluster configured with three SCAN IP’-s and SCAN name. AWS DMS resolves the SCAN name to Three IP addresses using Amazon Route 53, and connects to the source RAC database using the SCAN listener.
To illustrate the configuration of the endpoint, we use the Oracle RAC configuration shown in the following table.
SCAN Name | scan.cluster |
SCAN 1 IPv4 VIP | 10.0.3.176 |
SCAN 2 IPv4 VIP | 10.0.3.253 |
SCAN 3 IPv4 VIP | 10.0.3.84 |
Prerequisites
Complete the following prerequisite steps:
- Create an Oracle user with the appropriate permissions for AWS DMS to access your Oracle source database. In this example, we create a user called
dmsuser
. Make sure you grant the following privilege that is specific to Oracle RAC: - Make sure the on-premises firewall accepts connections to the RAC SCAN hostname or RAC SCAN IP’-s from the AWS DMS replication instance IP. Refer to Setting up a network for a replication instance for more details
- If you want to run the pre-migration assessment as part of the migration, grant the following permissions to the Oracle user:
In AWS DMS, there are two methods for reading the redo logs when doing change data capture (CDC) for Oracle as a source: Oracle LogMiner and AWS DMS Binary Reader. LogMiner is an Oracle API to read the online redo logs and archived redo log files. Binary Reader is a AWS DMS method that reads and parses the raw redo log files directly.
AWS DMS uses LogMiner by default. LogMiner is often slower and might consume more resources on the source database, which could lead to source latency. If the archive generation size is more than 20 GB per hour, we recommend Binary Reader. When you use Oracle RAC as a source, we also recommend Binary Reader.
Use the following extra connection attributes (ECA) if you want to use Binary Reader:-
For Binary Reader, AWS DMS will read the archive and redo log files from the Oracle Automatic Storage Management(ASM) instance or a database cluster file system based on the Oracle archive log location.
Use Route 53 Resolver and the RAC SCAN name
In this option, you use the Route 53 Resolver and the RAC SCAN name to configure the AWS DMS endpoint. Route 53 Resolver helps you resolve the on-premises DNS records of the source Oracle RAC system. After you configure Route 53 Resolver, you can resolve the SCAN IPs from your AWS DMS replication instance’s VPC. Complete the following steps:
- Configure Route 53 Resolver.
- Run the nslookup command on an Amazon Elastic Compute Cloud (Amazon EC2) instance that is on the same VPC and subnet as the AWS DMS replication instance to make sure the DNS resolution is working correctly.
- On the AWS DMS console, under Migrate data in the navigation pane, choose Endpoints.
- Choose Create endpoint.
- For Endpoint identifier, enter a name for your endpoint.
- Choose Oracle for Source engine.
- For Access to endpoint database, select Provide access information manually or select AWS Secrets Manager
- Provide the rest of the details, including the sever name (SCAN name), port, user name and password, SSL mode, and SID or service name.
You can also use any name for Server name, and specify the SCAN name in the Extra connection attributes section. ECAs always override the parameters mentioned under Source engine.
To add an ECA, use the following code:
Alternatively, use the following code:
- Test the endpoint connection.
Use the RAC SCAN IP
With this option, you don’t need to configure Route 53 Resolver. Instead, you use the RAC SCAN IP. Complete the following steps:
- On the AWS DMS console, under Migrate data in the navigation pane, choose Endpoints.
- Choose Create endpoint.
- For Endpoint identifier, enter a name for your endpoint.
- Choose Oracle for Source engine.
- For Access to endpoint database, select Provide access information manually.
- For Server name, enter a name.
- Provide the rest of the details, including port, user name and password, SSL mode, and SID or service name.
- Specify the SCAN IPs for Extra connection attributes.
The following is a sample connect string. In this example, you specify the SCAN IPs of the source RAC system, and specify the port and service name of the source database:
- Test the connection.
Create a replication instance with the AWS CLI to use on-premises DNS for RAC SCAN name resolution-
Use the following AWS CLI command to create the replication instance using the on-premises DNS server:-