

# Migrate an Oracle database to Amazon DynamoDB using AWS DMS
<a name="migrate-an-oracle-database-to-amazon-dynamodb-using-aws-dms"></a>

*Rambabu Karnena, Amazon Web Services*

## Summary
<a name="migrate-an-oracle-database-to-amazon-dynamodb-using-aws-dms-summary"></a>

This pattern walks you through the steps for migrating an Oracle database to [Amazon DynamoDB](https://aws.amazon.com/dynamodb/) using AWS Database Migration Service ([AWS DMS](https://aws.amazon.com/dms/)). It covers three types of source databases:
+ On-premises Oracle databases
+ Oracle databases on Amazon Elastic Compute Cloud ([Amazon EC2](https://aws.amazon.com/ec2/))
+ Amazon Relational Database Service ([Amazon RDS](https://aws.amazon.com/rds/)) for Oracle DB instances

In this proof of concept, this pattern focuses on migrating from an Amazon RDS for Oracle DB instance.

## Prerequisites and limitations
<a name="migrate-an-oracle-database-to-amazon-dynamodb-using-aws-dms-prereqs"></a>

**Prerequisites**
+ An active AWS account
+ An application connecting to an Amazon RDS for Oracle database
+ A table created in the source Amazon RDS for Oracle database with a primary key and sample data

**Limitations**
+ Oracle database objects, such as procedures, functions, packages, and triggers, are not considered for migration because Amazon DynamoDB does not support these database objects.

**Product versions**
+ This pattern applies to all editions and versions of Oracle databases that are supported by AWS DMS. For more information, see using an [Oracle database as a source for AWS DMS](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html) and using an [Amazon DynamoDB database as a target for AWS DMS](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.DynamoDB.html). We recommend that you use the latest versions of AWS DMS for the most comprehensive version and feature support.

## Architecture
<a name="migrate-an-oracle-database-to-amazon-dynamodb-using-aws-dms-architecture"></a>

**Source technology stack**
+ Amazon RDS for Oracle DB instances, Oracle on Amazon EC2, or on-premises Oracle databases

**Target technology stack**
+ Amazon DynamoDB

**AWS data migration architecture**

![Data moves from Oracle DB to AWS DMS to Amazon DynamoDB.](http://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/images/pattern-img/463fc7d4-ec8d-473b-8c7f-1df31800ee03/images/180e7340-3887-455d-a591-b5850e22770a.png)


## Tools
<a name="migrate-an-oracle-database-to-amazon-dynamodb-using-aws-dms-tools"></a>
+ [AWS Database Migration Service (AWS DMS)](https://docs.aws.amazon.com/dms/latest/userguide/Welcome.html) helps you migrate data stores into the AWS Cloud or between combinations of cloud and on-premises setups.
+ [Amazon DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html) is a fully managed NoSQL database service that provides fast, predictable, and scalable performance.
+ [Amazon Relational Database Service (Amazon RDS)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html) helps you set up, operate, and scale a relational database in the AWS Cloud. This pattern uses Amazon RDS for Oracle.

## Epics
<a name="migrate-an-oracle-database-to-amazon-dynamodb-using-aws-dms-epics"></a>

### Plan the migration
<a name="plan-the-migration"></a>


| Task | Description | Skills required | 
| --- | --- | --- | 
| Create a VPC. | In your AWS account, create a virtual private cloud (VPC) and a private subnet. | Systems administrator | 
| Create security groups and network access control lists. | For more information, see the [AWS documentation](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html). | Systems administrator | 
| Configure and start the Amazon RDS for Oracle DB instance. | For more information, see the [AWS documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Oracle.html). | DBA, Systems administrator | 

### Migrate data
<a name="migrate-data"></a>


| Task | Description | Skills required | 
| --- | --- | --- | 
| Create an IAM role to access DynamoDB. | In the AWS Identity and Access Management (IAM) console, create the role, attach the policy `AmazonDynamoDBFullAccess to it`, and select AWS DMS as the service. | Systems administrator | 
| Create an AWS DMS replication instance for migration. | The replication instance should be in the same Availability Zone and VPC as the source database. | Systems administrator | 
| Create source and target endpoints in AWS DMS. | To create the source database endpoint, you have two options:[See the AWS documentation website for more details](http://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/migrate-an-oracle-database-to-amazon-dynamodb-using-aws-dms.html)To create the target database endpoint, choose the role Amazon Resource Name (ARN) from the previous task to access DynamoDB. | Systems administrator | 
| Create an AWS DMS task to load the source Oracle database tables to DynamoDB. | Choose the source and destination endpoint names and the replication instance from the previous steps. The type can be full load. Choose the Oracle schema and specify **%** to select all tables. | Systems administrator | 
| Validate the tables in DynamoDB. | To view the migration results, choose **Tables** from the left navigation pane in the DynamoDB console. | DBA | 

### Migrate the application
<a name="migrate-the-application"></a>


| Task | Description | Skills required | 
| --- | --- | --- | 
| Modify the application code. | To connect to and retrieve data from DynamoDB, update the application code. | App owner, DBA, Systems administrator | 

### Cut over
<a name="cut-over"></a>


| Task | Description | Skills required | 
| --- | --- | --- | 
| Switch the application clients to use DynamoDB. |  | DBA, App owner, Systems administrator | 

### Close the project
<a name="close-the-project"></a>


| Task | Description | Skills required | 
| --- | --- | --- | 
| Shut down AWS resources. | For example, the shut down the Amazon  RDS for Oracle instance, DynamoDB, and the AWS DMS replication instance. | DBA, Systems administrator | 
| Gather metrics. | Metrics include the time to migrate, the percentages of manual work and work performed by the tool, and cost savings. | DBA, App owner, Systems administrator | 

## Related resources
<a name="migrate-an-oracle-database-to-amazon-dynamodb-using-aws-dms-resources"></a>
+ [AWS Database Migration Service and Amazon DynamoDB: What You Need to Know](https://aws.amazon.com/blogs/database/aws-database-migration-service-and-amazon-dynamodb-what-you-need-to-know/) (blog post)
+ [Using an Oracle Database as a source for AWS DMS](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html)
+ [Using an Amazon DynamoDB database as a target for AWS Database Migration Service](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.DynamoDB.html)
+ [Best Practices for Migrating from RDBMS to Amazon DynamoDB](https://docs.aws.amazon.com/whitepapers/latest/best-practices-for-migrating-from-rdbms-to-dynamodb/welcome.html) (whitepaper)