This pattern describes how to speed up loading a partitioned table from Oracle to PostgreSQL by using AWS Database Migration Service (AWS DMS), which doesn't support native partitioning. The target PostgreSQL database can be installed on Amazon Elastic Compute Cloud (Amazon EC2), or it can be an Amazon Relational Database Service (Amazon RDS) for PostgreSQL or Amazon Aurora PostgreSQL-Compatible Edition DB instance.
Uploading a partitioned table includes the following steps:
Create a parent table similar to the Oracle partition table, but don't include any partition.
Create child tables that will inherit from the parent table that you created in step 1.
Create a procedure function and trigger to handle the inserts in the parent table.
However, because the trigger is fired for every insert, the initial load using AWS DMS can be very slow.
To speed up initial loads from Oracle to PostgreSQL 9.0, this pattern creates a separate AWS DMS task for each partition and loads the corresponding child tables. You then create a trigger during cutover.
PostgreSQL version 10 supports native partitioning. However, you might decide to use inherited partitioning in some cases. For more information, see the Additional information section.