Multi-Stage Migration Implementation Plan
This plan details how to implement a multi-stage migration from an on-premises Oracle database to AWS PostgreSQL, with cross-database joins and final target tables.
Architecture Overview
┌───────────────┐ ┌─────────────────────────────────────────────────────┐
│ │ │ AWS │
│ On-Premises │ │ │
│ Oracle │─────┐ │ ┌──────────────┐ ┌──────────────┐ │
│ Database │ │ │ │ PostgreSQL │ │ PostgreSQL │ │
│ (Source Table)│ │ │ │ Database 1 │ │ Database 2 │ │
└───────────────┘ │ │ │ │ │ │ │
│ │ │ ┌──────────┐ │ │ ┌──────────┐ │ │
└───┼──►│ Staging │◄├────────┼─┤ Existing │ │ │
│ │ │ Table │ │ │ │ Table │ │ │
DMS Task 1 │ └────┬─────┘ │ │ └──────────┘ │ │
│ │ │ │ │ │ │
│ │ │ │ └──────────────┘ │
│ │ │ │ ▲ │
│ │ │ │ │ │
│ │ ▼ │ │ │
│ │ ┌──────────┐ │ │ │
│ │ │ Cross- │ │ │ │
│ │ │ Database │─┼────────────┘ │
│ │ │ View │ │ FDW Connection │
│ │ └────┬─────┘ │ │
│ │ │ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ ┌──────────┐ │ │
│ │ │ Target │ │ │
│ │ │ Table │◄┼───────────────────────────────────┘
│ │ └──────────┘ │ DMS Task 2
│ │ │
│ └──────────────┘
│
└────────────────────────────────────────────┘
AWS DMSStep 1: Initial Oracle to PostgreSQL Migration
1.1. Set Up Source Oracle Database for Migration
1.2. Set Up Target PostgreSQL Database on AWS
1.3. Set Up AWS DMS for Initial Migration
Create Oracle Source Endpoint:
Create PostgreSQL Target Endpoint:
Create a Replication Instance:
Create Task Settings JSON File (task-settings.json):
Create Table Mappings JSON File (table-mappings.json):
Create the DMS Task:
Start the DMS Task:
Step 2: Set Up Cross-Database FDW Connection
2.1. Set Up Foreign Data Wrapper in PostgreSQL Database 1
2.2. Create the Cross-Database View
Step 3: Migrate View Data to Target Table
3.1. Create the Target Table
3.2. Set Up Second DMS Task for View Migration
Create Table Mappings for View Migration (view-mappings.json):
Create DMS Task Settings for View Migration (view-task-settings.json):
Create a New DMS Task for View Migration:
Start the View Migration Task:
3.3. Alternative: Direct SQL-based Migration
If DMS has trouble with the view, you can use SQL for the final step:
Step 4: Set Up Ongoing Synchronization (Optional)
If you need ongoing data synchronization from Oracle to the final target table:
4.1. Create a Trigger-Based Approach
Step 5: Validation and Monitoring
5.1. Validate Data Migration
5.2. Monitor DMS Tasks
Troubleshooting
Foreign Data Wrapper Issues
DMS Task Failures
View Migration Issues
This implementation plan provides all the necessary steps to migrate data from an on-premises Oracle database to AWS PostgreSQL, create a cross-database view, and load the final data into a target table within the same PostgreSQL database.
Last updated
Was this helpful?