Incrementally migrate from Amazon RDS for Oracle to Amazon RDS for PostgreSQL using Oracle SQL Developer and AWS SCT
Created by Pinesh Singal (AWS)
Environment: PoC or pilot | Source: Amazon RDS for Oracle | Target: Amazon RDS for PostgreSQL |
R Type: Re-architect | Workload: Oracle | Technologies: Migration; Databases; Modernization |
AWS services: Amazon EC2; Amazon RDS |
Summary
Many migration strategies and approaches run in multiple phases that can last from a few weeks to several months. During this time, you can experience delays because of patching or upgrades in the source Oracle DB instances that you want to migrate to PostgreSQL DB instances. To avoid this situation, we recommend that you incrementally migrate the remaining Oracle database code to PostgreSQL database code.
This pattern provides an incremental migration strategy with no downtime for a multi-terabyte Oracle DB instance that has a high number of transactions performed after your initial migration and that must be migrated to a PostgreSQL database. You can use this pattern’s step-by-step approach to incrementally migrate an Amazon Relational Database Service (Amazon RDS) for Oracle DB instance to an Amazon RDS for PostgreSQL DB instance without signing in to the Amazon Web Services (AWS) Management Console.
The pattern uses Oracle SQL Developer
Note: Before you migrate your production workloads, we recommend that you run a proof of concept (PoC) for this pattern's approach in a testing or non-production environment.
Prerequisites and limitations
Prerequisites
An active AWS account.
An existing Amazon RDS for Oracle DB instance.
An existing Amazon RDS for PostgreSQL DB instance.
AWS SCT, installed and configured with JDBC drivers for Oracle and PostgreSQL database engines. For more information about this, see Installing AWS SCT and Installing the required database drivers in the AWS SCT documentation.
Oracle SQL Developer, installed and configured. For more information about this, see the Oracle SQL Developer
documentation. The
incremental-migration-sct-sql.zip
file (attached), downloaded to your local computer.
Limitations
The minimum requirements for your source Amazon RDS for Oracle DB instance are:
Oracle versions 10.2 and later (for versions 10.x), 11g (versions 11.2.0.3.v1 and later) and up to 12.2, and 18c for the Enterprise, Standard, Standard One, and Standard Two editions
The minimum requirements for your target Amazon RDS for PostgreSQL DB instance are:
PostgreSQL versions 9.4 and later (for versions 9.x), 10.x, and 11.x
This pattern uses Oracle SQL Developer. Your results might vary if you use other tools to find and export schema differences.
The SQL scripts
generated by Oracle SQL Developer can raise transformation errors, which means that you need to perform a manual migration. If the AWS SCT source and target test connections fail, make sure that you configure the JDBC driver versions and inbound rules for the virtual private cloud (VPC) security group to accept incoming traffic.
Product versions
Amazon RDS for Oracle DB instance version 12.1.0.2 (version 10.2 and later)
Amazon RDS for PostgreSQL DB instance version 11.5 (version 9.4 and later)
Oracle SQL Developer version 19.1 and later
AWS SCT version 1.0.632 and later
Architecture
Source technology stack
Amazon RDS for Oracle DB instance
Target technology stack
Amazon RDS for PostgreSQL DB instance
Source and target architecture
The following diagram shows the migration of an Amazon RDS for Oracle DB instance to an Amazon RDS for PostgreSQL DB instance.
The diagram shows the following migration workflow:
Open Oracle SQL Developer and connect to the source and target databases.
Generate a diff report
and then generate the SQL scripts file for the schema difference objects. For more information about diff reports, see Detailed diff reports in the Oracle documentation. Configure AWS SCT and run the Python code.
The SQL scripts file converts from Oracle to PostgreSQL.
Run the SQL scripts file on the target PostgreSQL DB instance.
Automation and scale
You can automate this migration by adding additional parameters and security-related changes for multiple functionalities in a single program to your Python script.
Tools
AWS SCT – AWS Schema Conversion Tool (AWS SCT) converts your existing database schema from one database engine to another.
Oracle SQL Developer
– Oracle SQL Developer is an integrated development environment (IDE) that simplifies the development and management of Oracle databases in both traditional and cloud-based deployments.
Code
The incremental-migration-sct-sql.zip
file (attached) contains the complete source code for this pattern.
Epics
Task | Description | Skills required |
---|---|---|
Run Database Diff in Oracle SQL Developer. |
| DBA |
Generate the SQL scripts file. | Choose Generate Script to generate the differences in the SQL files. This generates the SQL scripts file that AWS SCT uses to convert your database from Oracle to PostgreSQL. | DBA |
Task | Description | Skills required |
---|---|---|
Configure AWS SCT with the Windows Command Prompt. |
4. Modify the AWS SCT configuration parameters according to your requirements and then copy the SQL scripts file into your working directory in the | DBA |
Run the Python script. |
| DBA |
Create the objects in Amazon RDS for PostgreSQL | Run the SQL files and create objects in your Amazon RDS for PostgreSQL DB instance. | DBA |
Related resources
Attachments
To access additional content that is associated with this document, unzip the following file: attachment.zip