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 S3 bucket.

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

You can find instructions on how to connect to Microsoft SQL Server Management Studio in Connect to the EC2 Instance section.

  1. 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 dbo.sport_type
    FROM 'C:\Users\Administrator\Desktop\DMS Workshop\Scripts\sports.csv'
    WITH
    (
        FIRSTROW = 2,
        FIELDTERMINATOR = ',',
        ROWTERMINATOR = '\n',
        TABLOCK
    );
    

    \[SQLServer-S3-26\]

  2. Now go back to target S3 bucket and navigate to sport_type folder. You should see new file with latest timestamp.

    \[SQLServer-S3-27\]

  3. Download and open the CSV file.

    \[SQLServer-S3-28\]

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 the S3 bucket. Note that the value “I” in the first column of the CSV file. “I” in the first column indicates that a new row was INSERTed into the table at the source database.

The AWS DMS task keeps the content of the target S3 bucket up to date with changes to the source 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.