Migrate from Oracle to Amazon DocumentDB using AWS DMS - AWS Prescriptive Guidance

Migrate from Oracle to Amazon DocumentDB using AWS DMS

Created by Sashikanta Pattanayak (AWS) and Munesh Siddappa (AWS)

Environment: PoC or pilot

Source: Databases: Relational

Target: Amazon DocumentDB

R Type: Re-architect

Workload: Oracle

Technologies: Migration; Databases

AWS services: Amazon DocumentDB

Summary

This pattern provides guidance for migrating an Oracle database to an Amazon DocumentDB (with MongoDB compatibility) database by using AWS Database Migration Service (AWS DMS). This approach can be applied to an on-premises Oracle source database as well as an Amazon Relational Database Service (Amazon RDS) for Oracle DB instance. This pattern uses an Amazon RDS Oracle DB source instance as an example.

Amazon DocumentDB (with MongoDB compatibility) is a fully managed, MongoDB-compatible document database service that makes it easy to store, query, and index JSON data.

The use case for this pattern is one-to-one replication of an Oracle database table to an Amazon DocumentDB collection. The pattern uses AWS DMS replication tasks to read the table structure of the Oracle database, create the corresponding collection in Amazon DocumentDB, and perform a full load migration. You can view and query your data in Amazon DocumentDB, the same as you would in MongoDB.  

Prerequisites and limitations

Prerequisites

  • An active AWS account

  • Familiarity with using Oracle databases

  • Familiarity with using Amazon DocumentDB

  • For the Oracle user, SELECT ANY TABLE privilege

  • For the Amazon DocumentDB use, the privilege required to dump data  

Limitations

The following limitations apply when using Amazon DocumentDB as a target for AWS DMS:

  • In Amazon DocumentDB, collection names can't contain the dollar symbol ($). In addition, database names can't contain any Unicode characters.

  • AWS DMS doesn't support merging of multiple source tables into a single Amazon DocumentDB collection.

  • When AWS DMS processes changes from a source table that doesn't have a primary key, any large binary object (LOB) columns in that table are ignored.

  • If the Change table option is enabled and AWS DMS encounters a source column named "_id", that column appears as "__id" (two underscores) in the change table.

  • If you choose Oracle as a source endpoint, the Oracle source must have full supplemental logging enabled. Otherwise, if there are columns at the source that weren't changed, the data is loaded into Amazon DocumentDB as null values. 

Product versions

Architecture

Source technology stack

  • Amazon RDS for Oracle DB instance

Target technology stack

  • Amazon DocumentDB

Source and target architecture

Use AWS DMS to migrate Oracle database to Amazon DocumentDB (with MongoDB compatibility) database.

Tools

  • AWS DMSAWS Database Migration Service (AWS DMS) is a web service that you can use to migrate data from a source data store to a target data store. The AWS DMS User Guide specifies the Oracle source database versions and editions that are supported for use with AWS DMS. For additional information relevant to this pattern, see Using Amazon DocumentDB as a Target for AWS DMS.

  • Amazon EC2Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the AWS cloud. Your Amazon DocumentDB cluster should be running in your default virtual private cloud (VPC). To interact with your Amazon DocumentDB cluster, you must launch an EC2 instance into your default VPC, in the same AWS Region where you created your Amazon DocumentDB cluster. For details, refer to Launch an Amazon EC2 instance in the Amazon DocumentDB documentation.

Epics

TaskDescriptionSkills required

Validate the source and target database versions and engines.

AWS Admin

Choose the proper instance type (capacity, storage features, network features).

AWS Admin

Identify network/host access security requirements for the source and target databases.

AWS Admin

Create an outbound security group to the source and target databases.

AWS Admin

Create and configure an EC2 instance for Amazon DocumentDB.

AWS Admin
TaskDescriptionSkills required

Create a VPC and subnets.

AWS Admin

Create security groups and network access control lists (ACLs).

AWS Admin

Configure and start the source Amazon RDS for Oracle instance.

AWS Admin

Configure and start the Amazon DocumentDB instance.

AWS Admin
TaskDescriptionSkills required

Verify that the Oracle database can be connected using the connection details.

AWS Admin

Verify that the Oracle user has the SELECT ANY TABLE privilege.

AWS Admin
TaskDescriptionSkills required

Create the Amazon DocumentDB cluster by choosing the proper instance class and number of instances.

AWS Admin
TaskDescriptionSkills required

Configure the EC2 instance.

To interact with your Amazon DocumentDB cluster, you must launch an EC2 instance into your default VPC, in the same AWS Region where you created your Amazon DocumentDB cluster. Configure the AWS Region, VPCs, Availability Zones, and subnets for the EC2 instance.

AWS Admin

Configure the key pair.

A public/private key pair allows you to connect securely to the EC2 instance after it launches.

AWS Admin

Set the bastion host CIDR ranges (optional).

Set the CIDR IP range that is allowed for external Secure Shell (SSH) access to the bastion host instances.

AWS Admin
TaskDescriptionSkills required

Create an AWS DMS replication instance.

AWS Admin

Create source and target endpoints.

AWS Admin

Create AWS DMS replication tasks for a full load.

AWS Admin
TaskDescriptionSkills required

Connect to the Amazon DocumentDB cluster through the EC2 instance.

AWS Admin

Connect to the cluster using the mongo shell.

For instructions, see the Amazon DocumentDB links in the References and Help section.

AWS Admin

Verify the results of the migration.

AWS Admin

Related resources