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.

You can find instructions on how to connect to Microsoft SQL Server Management Studio in Open SQL Server Management Studio.

  1. Use Microsoft SQL Server Management Studio to connect to the Source SQL Server on the EC2 instance.

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

    use dms_sample
    BULK INSERT sport_type
    FROM 'C:\Users\Administrator\Desktop\DMS Workshop\Scripts\sports.csv'
    WITH
    (
        FIRSTROW = 2,
        FIELDTERMINATOR = ',',
        ROWTERMINATOR = '\n',
        TABLOCK
    );
    

    \[SqlServer-to-SqlServerRDS-18\]

  3. This time use Microsoft SQL Server Management Studio to connect to the Target SQL Server running on an Amazon RDS instance.

  4. Open a New Query window and execute the following statement:

    use dms_recovery
    SELECT * FROM dms_recovery.sport_type;
    

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_recovery 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 SQL Server 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.