Migrate an Oracle database from Amazon EC2 to Amazon RDS for MariaDB using AWS DMS and AWS SCT - AWS Prescriptive Guidance

Migrate an Oracle database from Amazon EC2 to Amazon RDS for MariaDB using AWS DMS and AWS SCT

Created by Veeranjaneyulu Grandhi (AWS)

R Type: Re-architect

Source: Databases: Relational

Target: Amazon RDS for MariaDB

Created by: AWS

Environment: PoC or pilot

Technologies: Databases; Migration

Workload: Oracle

AWS services: Amazon RDS

Summary

This pattern walks you through the steps for migrating an Oracle database on an Amazon Elastic Compute Cloud (Amazon EC2) instance to an Amazon Relational Database Service (Amazon RDS) for MariaDB DB instance. The pattern uses AWS Data Migration Service (AWS DMS) for data migration and AWS Schema Conversion Tool (AWS SCT) for schema conversion.

Managing Oracle databases on EC2 instances requires more resources and is more costly than using a database on Amazon RDS. Amazon RDS makes it easy to set up, operate, and scale a relational database in the cloud. Amazon RDS provides cost-efficient and resizable capacity while automating time-consuming administration tasks such as hardware provisioning, database setup, patching, and backups.

Prerequisites and limitations

Prerequisites

Limitations

  • Database size limit: 64 TB 

Product versions

Architecture

Source technology stack

  • An Oracle database on an EC2 instance

Target technology stack

  • Amazon RDS for MariaDB 

Data migration architecture

Target architecture

Tools

  • AWS SCT - AWS Schema Conversion Tool (AWS SCT) makes heterogeneous database migrations predictable by automatically converting the source database schema and a majority of the database code objects – including views, stored procedures, and functions – to a format compatible with the target database. After converting your database schema and code objects using AWS SCT, you can use AWS DMS to migrate data from the source database to the target database to complete your migration projects. For more information, see Using Oracle as a Source for AWS SCT in the AWS SCT documentation.

  • AWS DMS - AWS Database Migration Service (AWS DMS) helps you migrate databases to AWS quickly and securely. The source database remains fully operational during the migration, minimizing downtime to applications that rely on the database. AWS DMS can migrate your data to and from the most widely used commercial and open-source databases. AWS DMS supports homogeneous migrations such as Oracle to Oracle, as well as heterogeneous migrations between different database platforms, such as Oracle or Microsoft SQL Server to Amazon Aurora. To learn more about migrating Oracle databases, see Using an Oracle Database as a Source for AWS DMS in the AWS DMS documentation.

Epics

TaskDescriptionSkills required
Identify the source and target database versions and engines.

DBA/Developer
Identify the AWS DMS replication instance.

DBA/Developer
Identify storage requirements (storage type and capacity).

DBA/Developer
Identify network requirements (latency, bandwidth).

DBA/Developer
Identify hardware requirements for the source and target server instances (based on the Oracle compatibility list and capacity requirements).

DBA/Developer
Identify network-access security requirements for the source and target databases.

DBA/Developer
Install the latest AWS SCT and Oracle drivers.

DBA/Developer
Determine a backup strategy.

DBA/Developer
Determine availability requirements.

DBA/Developer
Choose an application migration/switchover strategy.

DBA/Developer
Select the proper instance type based on capacity, storage, and network features.

DBA/Developer
TaskDescriptionSkills required
Create a virtual private cloud (VPC).

The source, target, and replication instances should be in the same VPC and (recommended) in the same Availability Zone.

Developer
Create the necessary security groups for database access.

Developer
Generate and configure a key pair.

Developer
Configure subnets, Availability Zones, and CIDR blocks.

Developer
TaskDescriptionSkills required
Launch the EC2 instance.

Developer
Install the Oracle database on the EC2 instance, with required users and roles.

DBA
Follow the steps in the task description to access Oracle from outside of the EC2 instance.

1. Change the local host in "tnsnames" to the Amazon EC2 public DNS; 2. Change the local host in 'listener' to the Amazon EC2 public DNS; 3. Stop and restart the listener.

DBA
After the EC2 instance restarts, the public DNS changes. Make sure to update the Amazon EC2 public DNS in "tnsnames" and "listener", or use an Elastic IP address.

DBA/Developer
Configure the EC2 instance security group so the replication instance and required clients can access the source database.

DBA/Developer
TaskDescriptionSkills required
Configure and start the Amazon RDS for MariaDB DB instance.

Developer
Create any necessary tablespaces in the Amazon RDS MariaDB database.

DBA
Configure a security group so the replication instance and required clients can access the target database.

Developer
TaskDescriptionSkills required
Install the latest AWS SCT and Oracle drivers.

Developer
Enter appropriate parameters and then connect to the source and target.

Developer
Generate an AWS SCT schema conversion report.

Developer
Make any necessary corrections to the code and schema (especially tablespaces and quotation marks).

DBA/Developer
Validate the schema on the source versus the target before loading data.

Developer
TaskDescriptionSkills required
For full-load and change data capture (CDC) (or just for CDC), set an extra connection attribute.

See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MariaDB.html

Developer
Enable supplemental logging on the source database.

DBA/Developer
For full-load and CDC (or just for CDC), enable archive log mode on the source database.

DBA
Create source and target endpoints and test the connections.

Developer
When the endpoints are connected successfully, create a replication task.

Developer
Select "CDC only" or "Full load + CDC" in the task to capture changes for continuous replication only, or for full load and ongoing changes, respectively.

Developer
Start the replication task and monitor Amazon CloudWatch Logs.

Developer
Validate the data in the source and target databases.

Developer
TaskDescriptionSkills required
Follow the chosen application migration strategy.

DBA, Developer, App owner
Follow the chosen application cutover/switchover strategy.

DBA, Developer, App owner
TaskDescriptionSkills required
Ensure that the schema and data are validated successfully in the source versus the target before project closure.

DBA/Developer
Gather metrics about time to migrate, percentage of manual versus tool tasks, cost savings, etc.

DBA, Developer, App owner
Review the project documents and artifacts.

DBA, Developer, App owner
Shut down temporary AWS resources.

DBA/Developer
Close the project and provide any feedback.

DBA, Developer, App owner