0

I have an Oracle RDS instance configured with DMS with an S3 target. After full load I ongoing replication, when I update a row with a new value, the DMS file that is created only shows those columns that were updated, but I want the whole row in its current state in the database.

Example: | client_id | client_name | age |
| :---: | :---: | :----: | | 1 | John Smith| 46| | 2 | Jane Doe | 25 |

I then update Johns age to be 47, I would expect the DMS to look like this: | Op | DMS_TIMESTAMP | client_id | client_name | age | | :---: | :----: | :---: | :---: | :---: | | u | 2022-01-01 12:00:00 | 1 | John Smith | 47 |

However the file I receive looks like this:
| Op | DMS_TIMESTAMP | client_id | client_name | age | | :---: | :----: | :---: | :---: | :---: | | u | 2022-01-01 12:00:00 | 1 | null | 47 |

According to the docs the DMS row should represent the current state of the row but all of my columns that are not a primary key seem to be missing, despite the row having correct values in the database. Am I missing a configuration?

Sixsmith
  • 109
  • 2
  • 11

1 Answers1

0

I was missing a part of the documentation that explains that if you want the values of all the columns of a row, you need to apply the following to the table:

alter table table_name ADD SUPPLEMENTAL LOG DATA (all) columns';

As I needed to apply this for all the tables in a schema, I created this loop to apply it.

BEGIN
    FOR I IN (
    SELECT
        table_name,
        owner
    FROM
        ALL_TABLES
    WHERE
        owner = 'SCHEMA_OWNER'
) LOOP
    -- Print table name
    BEGIN
    DBMS_OUTPUT.PUT_LINE('Attempting to alter ' || I.table_name || ' at ' || current_timestamp);
    EXECUTE IMMEDIATE 'alter table SCHEMA_OWNER.' || I.table_name || ' ADD SUPPLEMENTAL LOG DATA (all) columns';
    EXCEPTION
    WHEN OTHERS THEN 
        DBMS_OUTPUT.PUT_LINE(I.table_name || ' alteration failed at ' || current_timestamp);
    END;
END LOOP;
END;
Sixsmith
  • 109
  • 2
  • 11