How can a world-leading multimedia content producer migrate Oracle to Amazon EC2 with minimal downtime while also reducing licensing costs? In this blog post, we discuss how we saved our customer 28% in Oracle licensing costs, implemented a reliable HA/DR solution, and migrated their immense environment to the AWS cloud with near-zero downtime using Oracle Data Guard.
To better understand the client’s existing infrastructure, requirements, and potential limitations, let’s explore the customer’s environment prior to our successful migration.
Our client had 18 licensed cores running a custom-built multimedia management service on a 7 terabyte Oracle database with no Disaster Recovery solution established. We initially recommended migrating to Amazon Relational Database Service (RDS), but quickly discovered several key factors preventing us due to Oracle-based documented limitations. Some of these factors included:
- Lack of multiple region support for standby databases. At the time of this blog post, Amazon RDS only supports multiple availability zone deployments within the same geographic region.
- Lack of support for near-zero downtime for the switch from on-premises to the AWS cloud. RDS has a limited set of options for importing data into Oracle on Amazon RDS and the use of Oracle Data Guard has proven to be successful in the past.
- Lack of support for Oracle Data Guard and Automatic Storage Management (ASM). For a list of unsupported features, see Amazon RDS Oracle 12c Version 188.8.131.52 Features Not Supported.
Based on these limitations, we recommended to migrate Oracle to Amazon EC2. As a starting point, we used the Oracle Database Quick Start process which provides templates for deploying a high availability solution with replica databases across multiple availability zones and regions with Oracle Data Guard and Automatic Storage Management. However, we needed to modify the steps based on the use of our customer’s 7 terabyte database. In addition, our customer sought to continue using Red Hat Enterprise Linux 6, and their existing configuration of ASM.
Overall Project Goals:
Migrate Oracle to Amazon EC2
While we migrate Oracle to Amazon EC2, we wanted to ensure that our client could rely upon a Disaster Recovery solution. We sought to help our clients save money through reduced licensing costs and the number of cores used. In addition, we wanted to accomplish the following during this project:
- Minimize the downtime of the database when performing the migration.
- Satisfy the storage requirements and provide for future growth.
- Provide a runbook for the operational tasks required for the move to AWS.
The High Availability / Disaster Recovery Solution
Oracle Data Guard is a feature of Oracle Database Enterprise Edition. It provides a set of tools to manage standby databases for high availability and disaster recovery. To create an Oracle standby database, we replicate the primary database to a secondary machine by applying its online or archived redo logs. When the standby database is set up, any changes to the primary database are replicated to the standby database. This ensures that the contents of the two databases are in sync.
Diagram of how Oracle Data Guard works for synchronizing both standby databases with the primary database
By using Oracle Data Guard while we migrate Oracle to Amazon EC2, we can replace the “Production Site” title on the left side of the above diagram with “On-Premises” and “Standby Site” with “AWS EC2” to describe the architecture needed for a near-zero downtime deployment of our customer’s application.
Oracle Network in AWS
To ensure a high level of security, AWS provides the Amazon Virtual Private Cloud (Amazon VPC) service. We launched the AWS resources in a pre-defined virtual network. As a result, we can isolate the resources for greater security. When we create a VPC, we specify the size in the form of a Classless Inter-Domain Routing (CIDR) block. We recommend creating databases in private subnets, this will ensure that databases are not exposed to the Internet. Likewise, database subnets should be accessible from the VPN (or AWS Direct Connect connection, if available for our client), and from the application subnets.
Oracle Database 12c Enterprise Edition (EE)
Oracle Database 12c EE includes Oracle Data Guard, which is crucial to migrate Oracle to Amazon EC2. At the same time, Oracle Data Guard is central to ensuring the shortest possible downtime during the migration.
Oracle Database 12c EE provides the Linux file system (e.g., ext4) or Automatic Storage Management (ASM) to store data files, redo logs, and archived logs. We recommend using ASM infrastructure, which provides better performance and file management compared to Linux. Oracle ASM supports automatic file management and data striping across multiple EBS volumes. This provides high performance and an easy way to scale storage.
Create Fast Recovery Area (FRA) Disk Group
To simplify the management of backup and recovery files, we recommend creating a fast recovery area (FRA) disk group for the database. The fast recovery area is an Oracle-managed directory, file system, or Oracle ASM disk group that provides a centralized storage location for backup and recovery files. Oracle creates archived logs and flashback logs in the fast recovery area. Oracle Recovery Manager (RMAN) can store its backup sets and image copies in the fast recovery area, using it when restoring files during media recovery.
The RMAN BACKUP command automatically backs up to the fast recovery area when a backup destination is not specified. So, we recommend configuring a fast recovery area to simplify backup management.
Oracle Database Backup and Recovery User’s Guide explains how to size the fast recovery area. As a rule, the larger the fast recovery area, the more useful it is. Ideally, the fast recovery area should be large enough for copies of the data files, control files, online redo log files, and archived redo log files needed to recover the database, and the copies of these backup files that are kept based on the retention policy.
Verifying the Database Using DB Best’s Database Compare Suite
While Oracle has the capability of comparing database objects using the DBMS_COMPARISON package, it is tedious to setup and is dependent on defining shared database objects.
DB Best has a product called Database Compare Suite that enables fast schema and data comparisons to verify that database objects are completely equal. Database Compare Suite (DBCS) includes both a graphical user and command line interface for comparing database objects.
With DBCS, we were quickly able to perform a data validation and confirm that the migration was successful.
By analyzing the performance data of the on-premises Oracle database using a combination of Oracle’s Automatic Workload Repository and the DB Best DBMSys Platform, we were able to reduce the Oracle core licensing count from 18 cores to 15 cores by using the new EC2 Nitro instances using EBS optimized volumes managed by Oracle’s Automatic Storage Management (ASM). In addition, we provided the following solutions:
- We recommended using R4 family instead of the current M5 family of EC2 instance. In this case, the advantages were two-fold –
- Reduction of one CPU core per Oracle license
- Better performing system, in terms of memory which could sustain current workload
- Installation and configuration of database on EC2 instance automated using Ansible
- Scripted and set up database monitoring using Splunk
- Successfully tested CPM for backup and used it for backup replication
- Built the DR for AWS on US-EAST, automated data restore, and achieved our client’s requirement for RPO and RTO
In order to successfully migrate Oracle to AWS EC2, we had to first discover AWS RDS’ existing documented limitations. The decision to migrate to AWS EC2 was made after careful consideration, and may not be a ‘one-size-fits-all’ solution. However, it’s clear that AWS provides a secure infrastructure to run Oracle Databases with an enterprise-class architecture, high availability, and support for small, medium, and large databases. If a database migration to AWS requires near-zero downtime, using Oracle Data Guard replication may be right for your situation.
For additional resources, check out the links that AWS provides as part of the Oracle Database Quick Start.
If you have any questions about this great way to migrate your Oracle databases to AWS with near-zero downtime, feel free to contact DB Best at firstname.lastname@example.org. Also, if you want to learn more about how DB Best can help you with Oracle database solutions, check out our website.