Migrating Oracle databases to the AWS Cloud

Author: Raju Chidambaram

Share this article

Many organizations operate with multiple database types. When transitioning to the AWS cloud, businesses often consider two primary strategies: a direct lift-and-shift (rehosting) of existing databases or a more strategic approach of modernizing applications through AWS managed database services (replatforming).

AWS offers a comprehensive suite of tools and services to support both migration paths. For those opting to rehost their Oracle databases, this blog delves into effective strategies for securely transferring, storing, and analyzing data on the AWS cloud.

Migrating Oracle databases to the AWS Cloud

Oracle database migration strategies

Strategy When to choose
Rehost The goal is to migrate the Oracle database without altering the operating system, database software, or configuration.
Replatform The objective is to streamline database management by adopting a Database-as-a-Service (DBaaS) solution.
Re-Architect  (refactor) The goal is to modernize the database and application by redesigning them to leverage the advantages of open-source and cloud-native database technologies.

 

Factors to consider for migrating Oracle On-Prem to AWS Cloud

  • Size
    • Check the size of the database and overall capacity growth.
  • AWR Reports
    • Review AWR reports to check resource usage and database health.
  • Dependency
    • Check current database dependencies on other databases. Also,check for application dependencies.
  • Throughput
    • Determine the IOPS and throughput of your databases.
  • Compliance Needs
    • Evaluate the existing database architecture and complaince requirements to ensure a seamless migration process.
  • Version & Edition
    • Verify Oracle database compatibility by checking the software version and edition against supported AWS offerings.
  • Identify
    • Determine the database workload’s recovery time objectives (RTO), recovery point objectives (RPO), and service level agreements (SLAs).
  • Platform Conversion
    • Oracle databases often reside on operating systems that are not supported by AWS (Solaris, HP-UX, IBM AIX). Migrating these databases necessitates platform conversion.

Pros & Cons

How much downtime the business can afford?

 

  • Offline migration: Offline migration involves taking the source database offline, transferring it to AWS, validating the data, and then switching the application to use the new AWS database. This method requires planned downtime.
  • Online migration: Online migration is a method that minimizes downtime by gradually copying data from the source database to the AWS target while maintaining ongoing operations. Changes from the source are continuously replicated to the target until both databases are synchronized. A final cutover then redirects all traffic to the AWS database.

 

Two ways to choose for Oracle Migrations:

The blog presents two main migration options: using AWS Database Migration Service (AWS DMS) or using native Oracle tools. I’ll outline both approaches.

Option 1: Using AWS Database Migration Service (AWS DMS)

  1. Plan the migration
      • Create project documents and record database details
      • Identify storage requirements
      • Choose the proper instance type based on compute requirements
      • Identify network access security requirements
      • Identify the application migration strategy
      • Identify migration risks

 

  1. Configure the infrastructure
      • Create a VPC
      • Create security groups
      • Create an Amazon RDS for Oracle DB instance

 

  1. Prepare the data
      • Clean the data in the source database
      • Create a replication instance
      • Create source and target endpoints
      • Identify the number of tables and objects to be migrated

 

  1. Migrate the data
      • Drop foreign key constraints and triggers on the target database
      • Drop secondary indexes on the target database
      • Configure AWS DMS full-load task settings
      • Enable foreign keys
      • Enable AWS DMS CDC to replicate ongoing changes
      • Enable triggers
      • Update the sequences
      • Validate the source and target data

 

  1. Cut over to the target database
      • Switch application clients to the new infrastructure
      • Stop all application services and client connections to Oracle
      • Run AWS DMS tasks
      • Set up a rollback task
      • Validate the data
      • Start application services on the new target database
      • Add Amazon CloudWatch monitoring

 

  1. Close out the migration project
    • Clean up resources
      • Review project documents
      • Gather metrics
      • Close out the project

 

Option 2: Using Native Oracle Tools

    1. Plan the migration (Same as in Option 1)
    2. Configure the infrastructure (Same as in Option 1)
    3. Prepare the source database
      • Create a Data Pump directory or use an existing one
      • Create a migration user and grant permissions
      • Extract roles, users, and tablespaces as a SQL script
      • Transfer the Data Pump dump to the target DB instance

 

  1. Prepare the target database
      • Confirm database options are installed/enabled
      • Create a Data Pump directory
      • Create a migration user and grant permissions
      • Create required tablespaces, users, and roles
      • Import the Data Pump export dump
      • Create excluded indexes and constraints
      • Validate or recompile invalid objects
      • Rebuild invalid indexes
      • Validate database object counts
      • Resolve any discrepancies

 

 

  1. Cut over to the target database (Similar to Option 1, but using Oracle GoldenGate for CDC instead of AWS DMS)

 

  1. Close out the migration project (Same as in Option 1)

Both options include steps for implementing a rollback plan if necessary. The choice between AWS DMS and native Oracle tools depends on specific business requirements and use cases.

 

Technical Challenges to overcome using the migration options:

Both migration options – using AWS Database Migration Service (AWS DMS) and using native Oracle tools – come with their own set of technical challenges. Let’s explore these for each option:

Challenges for using Option 1: Using AWS Database Migration Service (AWS DMS)

 

    1. Schema conversion challenges:
      • AWS DMS may not fully support all Oracle-specific features or data types.
      • Complex stored procedures, functions, and packages may need manual conversion.

 

  1. Performance issues:
      • Large datasets can lead to extended migration times.
      • Network latency between on-premises and AWS can impact transfer speeds.

 

  1. Handling of LOB data:
      • Large Object (LOB) data types may require special handling and can slow down the migration process.

 

  1. Maintaining data consistency:
      • Ensuring data integrity during ongoing replication (CDC) can be challenging, especially for high-transaction environments.

 

  1. Limitations with certain Oracle features:
      • AWS DMS may have limitations with Oracle-specific features like materialized views, synonyms, or certain types of indexes.

 

  1. Handling of sequences:
      • Oracle sequence values may not be maintained exactly, requiring post-migration adjustments.

 

  1. Permissions and security:
      • Ensuring the AWS DMS replication instance has appropriate permissions without compromising security can be tricky.

Challenges for using Option 2: Using Native Oracle Tools

  1. Manual intervention:
      • This method often requires more manual steps and scripting, increasing the risk of human error.

 

  1. Storage management:
      • Exporting and importing large databases can require significant temporary storage space.

 

  1. Network bandwidth:
      • Transferring large Data Pump files between on-premises and AWS can be time-consuming and may require optimized network paths.

 

  1. Version compatibility:
      • Ensuring compatibility between source and target Oracle versions, especially if upgrading simultaneously.

 

  1. Handling of database links:
      • Database links may need to be recreated or adjusted in the new environment.

 

  1. Time zone differences:
      • Handling of TIMESTAMP WITH TIME ZONE data types may require special attention.

 

  1. Maintaining referential integrity:
      • Disabling and re-enabling constraints during the migration process can be complex.

 

  1. Handling of long-running transactions:
      • Long-running transactions on the source database can complicate the CDC process when using Oracle GoldenGate.

 

Common Challenges for Both Options:

    1. Downtime management:
      • Minimizing application downtime during the cutover phase can be challenging.

 

  1. Application changes:
      • Applications may require updates to connection strings or configurations.

 

  1. Performance tuning:
      • The target RDS instance may require tuning to match or exceed the performance of the source system.
    1. Testing and validation:
      • Comprehensive testing of the migrated database and applications is crucial but can be time-consuming.

 

  1. Rollback planning:
      • Designing and implementing an effective rollback strategy in case of migration failure.

 

  1. Handling of users and roles:
      • Mapping on-premises database users and roles to RDS Oracle, considering RDS limitations on certain privileges.

 

  1. Compliance and auditing:
      • Ensuring the migration process meets any regulatory or compliance requirements.

These challenges underscore the importance of thorough planning, testing, and having experienced database administrators and cloud specialists involved in the migration process. The choice between AWS DMS and native Oracle tools should be made based on the specific requirements of the database, the organization’s expertise, and the acceptable downtime window

Automation: Identify the opportunity and automate repeated tasks:

There are several opportunities to automate various aspects of Oracle database migration to AWS RDS. Automation can significantly reduce manual effort, minimize human errors, and speed up the migration process. Here are some key areas where automation can be applied:

    1. Assessment and planning:
      • Automated discovery tools can scan the source database to identify schema objects, dependencies, and unsupported features.
      • Tools like AWS Schema Conversion Tool (SCT) can automate much of the assessment process.

 

  1. Schema conversion:
      • AWS SCT can automate a significant portion of schema conversion, especially for simpler schemas.
      • Custom scripts can be developed to handle repetitive conversion tasks.

 

  1. Data migration:
      • AWS DMS tasks can be automated using AWS CloudFormation templates or AWS CLI scripts.
      • For native Oracle tools, scripting languages like Python or Bash can be used to automate Data Pump export/import processes.

 

  1. Continuous Data Replication:
      • AWS DMS supports automated continuous replication (CDC) once set up.
      • Oracle GoldenGate processes can be automated using scripts.

 

  1. Testing and validation:
      • Automated comparison tools can be used to verify data integrity between source and target databases.
      • Custom scripts can be developed to automate functional and performance testing.

 

  1. Cutover process:
      • Scripts can be created to automate the sequence of steps required during cutover, including stopping applications, final data sync, and switching connection strings.

 

  1. Monitoring and alerting:
      • AWS CloudWatch can be configured to automatically monitor the migration process and alert on issues.

 

  1. Post-migration tasks:
      • Scripts can be developed to automate post-migration tasks like rebuilding indexes, updating statistics, and validating objects.

 

  1. Infrastructure provisioning:
      • AWS CloudFormation or Terraform can be used to automate the creation of VPCs, security groups, and RDS instances.

 

  1. User and role management:
      • Scripts can be developed to automate the creation of users and roles in the target RDS instance.

 

  1. Application updates:
      • If application changes are needed, CI/CD pipelines can be used to automate application updates and deployments.

 

  1. Rollback procedures:
      • Automated rollback scripts can be prepared in advance to quickly revert to the source database if needed.

 

Tools and approaches for automation:

    1. AWS-specific tools:
      • AWS Database Migration Service (DMS)
      • AWS Schema Conversion Tool (SCT)
      • AWS CloudFormation
      • AWS Command Line Interface (CLI)

 

  1. Scripting languages:
      • Python
      • Bash
      • PowerShell

 

  1. Infrastructure as Code tools:
      • Terraform
      • Ansible

 

  1. Continuous Integration/Continuous Deployment (CI/CD) tools:
      • Jenkins
      • AWS CodePipeline

 

  1. Oracle-specific tools:

 

      • Oracle Data Pump with automated scripts
      • Oracle GoldenGate with automated setup and monitoring

 

While automation can greatly streamline the migration process, it’s important to note that complete end-to-end automation may not be feasible for complex databases or environments with specific requirements. In these cases, a hybrid approach combining automated processes with manual oversight and intervention is often the most effective strategy

Conclusion

Migrating workloads from Oracle Cloud to AWS presents opportunities for substantial cost reduction, improved performance, and increased scalability. Whether you’re dealing with large-scale databases, complex schemas, or stringent performance requirements, RalanTech has the knowledge and experience to guide you through a successful Oracle to AWS migration, setting the foundation for improved scalability, performance, and cost-efficiency in your database operations.

RalanTech, as an experienced IT consulting company, is uniquely positioned to guide organizations through this complex migration journey.

Recent Blogs

Database Challenges
Blog
Oracle DBA Support: 7 Biggest Challenges & Solutions
Remote Oracle Database Support
Blog
Why You Should Opt for Remote Oracle DBA Support Services?
Database downtime
Blog
Reduce Downtime and Complexity With Oracle Support

Sign up for our Newsletter