Replicate Data Changes


Now you are going to simulate a transaction to the source database by updating the sport_type table. The Database Migration Service will automatically detect and replicate these changes to the target database.

  1. Create another Data Migration Task with the following values for capturing data changes to the source database, and replicating the changes to the target Oracle database.

    Parameter Value
    Task identifier oracle-replication-task
    Replication instance dmsreplication
    Source database endpoint oracle-source
    Target database endpoint oracle-target
    Migration type Replicate data changes only
    CDC stop mode Don’t use custom CDC stop mode
    Target table preparation mode Do nothing
    Stop task after full load completes Don’t stop
    Include LOB columns in replication Limited LOB mode
    Max LOB size (KB) 32
    Enable validation Unchecked
    Enable CloudWatch logs Checked
  2. Expand the Table mappings section, and select Wizard for the editing mode.

  3. Click on Add new selection rule button and enter the following values in the form:

    Parameter Value
    Schema DMS_SAMPLE
    Table name %
    Action Include

If the Create Task screen does not recognize any schemas, make sure to go back to endpoints screen and click on your endpoint. Scroll to the bottom of the page and click on Refresh Button (⟳) in the Schemas section. If your schemas still do not show up on the Create Task screen, click on the Guided tab and manually select DMS_SAMPLE schema and all tables.

  1. After entering the values, make sure Migration task startup configuration is set to start Automatically on create, then click on Create task. .

\[Oracle-to-Oracle-22\]

  1. At this point, the new migration task is ready to replicate ongoing data changes from the source Oracle RDS to the Amazon Aurora RDS (PostgreSQL) database.

\[Oracle-to-Oracle-23\]

Now you are going to simulate a transaction to the source database by updating the sport_type table. The Database Migration Service will automatically detect and replicate these changes to the target database.

  1. Use Oracle SQL Developer connect to the source Oracle RDS instance.

  2. Open a New Query window and execute the following statement to insert 5 new sports into the sport_type table:

INSERT ALL

INTO dms_sample.sport_type (name,description) VALUES ('hockey', 'A sport in which two teams play against each other by trying to more a puck into the opponents goal using a hockey stick')

INTO dms_sample.sport_type (name,description) VALUES ('basketball', 'A sport in which two teams of five players each that oppose one another shoot a basketball through the defenders hoop')

INTO dms_sample.sport_type (name,description) VALUES ('soccer','A sport played with a spherical ball between two teams of eleven players')

INTO dms_sample.sport_type (name,description) VALUES ('volleyball','two teams of six players are separated by a net and each team tries to score by grounding a ball on the others court')

INTO dms_sample.sport_type (name,description) VALUES ('cricket','A bat-and-ball game between two teams of eleven players on a field with a wicket at each end')

SELECT * FROM dual; 

COMMIT;

SELECT * FROM dms_sample.sport_type; 

\[Oracle-to-Oracle-24\]

  1. Repeat steps 35 and 36 from the previus section to inspect the content of sport_type table in the target database.

\[Oracle-to-Oracle-25\]

The new records for that you added for basketball, cricket, hockey, soccer, volleyball to the sports_type table in the source database have been replicated to your DMS_SAMPLE database. You can further investigate the number of inserts, deletes, updates, and DDLs by viewing the Table statistics of your Database migration tasks in AWS console.

The AWS DMS task keeps the target Oracle database up to date with source database changes. AWS DMS keeps all the tables in the task up to date until it’s time to implement the application migration. The latency is close to zero, when the target has caught up to the source.