Migrate an on-premises Oracle database to Amazon RDS for Oracle - AWS Prescriptive Guidance

Migrate an on-premises Oracle database to Amazon RDS for Oracle

Created by Baji Shaik (AWS) and Pavan Pusuluri (AWS)

Summary

This pattern describes the steps for migrating on-premises Oracle databases to Amazon Relational Database Service (Amazon RDS) for Oracle. As part of the migration process, you create a migration plan and consider important factors about your target database infrastructure based on your source database. You can choose one of two migration options based on your business requirements and use case:

  • AWS Database Migration Service (AWS DMS) – You can use AWS DMS to migrate databases to the AWS Cloud quickly and securely. Your source database remains fully operational during the migration, which minimizes downtime to applications that rely on the database. You can reduce migration time by using AWS DMS to create a task that captures ongoing changes after you complete an initial full-load migration through a process called change data capture (CDC). For more information, see Migrate from Oracle to Amazon RDS with AWS DMS in the AWS documentation.

  • Native Oracle tools – You can migrate databases by using native Oracle tools, such as Oracle and Data Pump Export and Data Pump Import with Oracle GoldenGate for CDC. You can also use native Oracle tools such as the original Export utility and original Import utility to reduce the full-load time.

Prerequisites and limitations

Prerequisites

  • An active AWS account

  • An on-premises Oracle database

  • An Amazon RDS Oracle database (DB) instance

Limitations

  • Database size limit: 64 TB

Product versions

Architecture

Source technology stack

  • On-premises Oracle databases

Target technology stack

  • Amazon RDS for Oracle

Source and target architecture

The following diagram shows how to migrate an on-premises Oracle database to Amazon RDS for Oracle by using AWS DMS.

Migration workflow by using AWS DMS.

The diagram shows the following workflow:

  1. Create or use an existing database user, grant the required AWS DMS permissions to that user, turn on ARCHIVELOG mode, and then set up supplemental logging.

  2. Configure the internet gateway between the on-premises and AWS network.

  3. Configure source and target endpoints for AWS DMS.

  4. Configure AWS DMS replication tasks to migrate the data from the source database to the target database.

  5. Complete the post-migration activities on the target database.

The following diagram shows how to migrate an on-premises Oracle database to Amazon RDS for Oracle by using native Oracle tools.

Migration workflow by using native Oracle tools.

The diagram shows the following workflow:

  1. Create or use an existing database user and grant the required permissions to back up the Oracle database by using Oracle Export (exp) and Import (imp) utilities.

  2. Configure the internet gateway between the on-premises and AWS network.

  3. Configure the Oracle client on the Bastion host to take the backup database.

  4. Upload the backup database to an Amazon Simple Storage Service (Amazon S3) bucket.

  5. Restore the database backup from Amazon S3 to an Amazon RDS for Oracle database.

  6. Configure Oracle GoldenGate for CDC.

  7. Complete the post-migration activities on the target database.

Tools

  • AWS Database Migration Service (AWS DMS) helps you migrate data stores into the AWS Cloud or between combinations of cloud and on-premises setups.

  • Native Oracle tools help you perform a homogeneous migration. You can use Oracle Data Pump to migrate data between your source and target databases. This pattern uses Oracle Data Pump to perform the full load from the source database to the target database.

  • Oracle GoldenGate helps you perform logical replication between two or more databases. This pattern uses GoldenGate to replicate the delta changes after the initial load by using Oracle Data Pump.

Epics

TaskDescriptionSkills required

Create project documents and record database details.

  1. Document your migration goals, migration requirements, key project stakeholders, project milestones, project deadlines, key metrics, migration risks, and risk mitigation plans.

  2. Document critical information about your source database, including RAM, IOPS, and CPUs. You will later use this information to determine the appropriate target DB instance.

  3. Validate the versions of your source and target databases.

DBA

Identify storage requirements.

Identify and document your storage requirements, including the following:

  1. Calculate the storage allocated for the source DB instance.

  2. Gather the historical growth metrics from the source DB instance.

  3. Forecast future growth for the target DB instance.

Note

For General Purpose (gp2) SSD volumes, you get three IOPS per 1 GB of storage. Allocate storage by calculating the total number of read and write IOPS on the source database.

DBA, SysAdmin

Choose the proper instance type based on compute requirements.

  1. Determine the compute requirements of the target DB instance.

  2. Identify performance issues.

  3. Consider the factors for determining the appropriate instance type:

    • CPU utilization of the source DB instance

    • IOPS (read and write) for the source DB instance

    • Memory footprint on the source DB instance

SysAdmin

Identify network access security requirements.

  1. Identify and document the network access security requirements for your source and target databases.

  2. Configure the appropriate security groups for enabling the application to communicate with the database.

DBA, SysAdmin

Identify the application migration strategy.

  1. Determine and document the migration cutover strategy.

  2. Determine and document your application’s recovery time objective (RTO) and recovery point objective (RPO), and then plan for the cutover accordingly.

DBA, SysAdmin, App owner

Identify migration risks.

Assess the database and document migration specific risks and mitigations. For example:

  • Identify no-logging tables and highlight the risk of data loss in the event of recovery.

  • Extract the source database users and privileges, and highlight the conflicts with Amazon RDS privileges.

  • Review the alert log for any Oracle-specific errors and warnings.

  • Identify the supported and unsupported features of the target DB instance.

  • Review the deprecated features of the target DB version engine.

DBA
TaskDescriptionSkills required

Create a VPC.

Create a new Amazon Virtual Private Cloud (Amazon VPC) for the target DB instance.

SysAdmin

Create security groups.

Create a security group in your new VPC to allow inbound connections to the DB instance.

SysAdmin

Create an Amazon RDS for Oracle DB instance.

Create the target DB instance with the new VPC and security group, and then start the instance.

SysAdmin
TaskDescriptionSkills required

Prepare the source database.

  1. Create a Data Pump directory or use an existing one.

  2. Create a migration user and grant permissions to perform the Data Pump extract.

  3. Extract roles, users, and tablespaces from the source database as a SQL script.

  4. Transfer the extracted Data Pump dump to the target DB instance data pump directory.

DBA, SysAdmin

Prepare the target database.

  1. Confirm that all the database options (for example, text and Java) are installed or enabled on the target Amazon RDS for Oracle DB instance.

  2. Create a Data Pump directory or use an existing one.

  3. Create a migration user and grant permissions to perform the Data Pump import.

  4. Create the required tablespaces, users, and roles on the target DB instance.

  5. Import the transferred Data Pump export dump to the target database.

  6. Create any indexes excluded during import or object creation.

  7. Create any constraints excluded during import.

  8. Validate or recompile invalid objects.

  9. Rebuild the invalid indexes.

  10. Validate the database object counts between the source and the target databases.

  11. Resolve any discrepancies found between object counts.

DBA, SysAdmin
TaskDescriptionSkills required

Prepare the data.

  1. Clean the data in the source database.

  2. Create a replication instance.

  3. Create a source endpoint and target endpoint.

  4. Identify the number of tables and objects to be migrated.

DBA

Migrate the data.

  1. Drop foreign key constraints and triggers on the target database.

  2. Drop secondary indexes on the target database.

  3. Configure AWS DMS full-load task settings from the source database to the target database.

  4. Enable foreign keys.

  5. Enable AWS DMS CDC to replicate ongoing changes.

  6. Enable triggers.

  7. Update the sequences.

  8. Validate the source and target data.

DBA
TaskDescriptionSkills required

Switch the application clients to the new infrastructure.

  1. Stop all application services and client connections pointing to Oracle.

  2. Run the AWS DMS tasks.

  3. Set up a rollback task (for example, reverse CDC from the Amazon RDS database to the on-premises Oracle database).

  4. Validate the data.

  5. Start the application services on the new target database by configuring Amazon Route 53 to the new Amazon RDS for Oracle DB instance.

  6. Add Amazon CloudWatch monitoring to your new Amazon RDS for Oracle DB instance.

DBA, SysAdmin, App owner

Implement your rollback plan.

  1. Stop all application services pointing to the Amazon RDS for Oracle DB instance.

  2. Roll back the changes to the source on-premises Oracle database by using an AWS DMS task.

  3. Stop the AWS DMS tasks running from the on-premises Oracle database to the Amazon RDS for Oracle database.

  4. Configure the applications back on the source Oracle database.

  5. Confirm the rollback deployment is complete.

DBA, App owner
TaskDescriptionSkills required

Clean up resources.

Shut down or remove the temporary AWS resources, such as the AWS DMS replication instance and S3 bucket.

DBA, SysAdmin

Review project documents.

Review your migration planning documents and goals, and then confirm that you completed all required migration steps.

DBA, SysAdmin, App owner

Gather metrics.

Record key migration metrics, including how long it took to complete the migration, the percentage of manual vs. tool-based tasks, cost savings, and other relevant metrics.

DBA, SysAdmin, App owner

Close out the project.

Close out the migration project and capture feedback about the effort.

DBA, SysAdmin, App owner

Related resources

References

Tutorials and videos