- Newest
- Most votes
- Most comments
you should be able to migrate just 5 tables with specific columns
below example migrates only 2 tables
and removes specific column from each table
{
"rules": [
{
"rule-type": "transformation",
"rule-id": "319684261",
"rule-name": "319684261",
"rule-target": "column",
"object-locator": {
"schema-name": "public",
"table-name": "cycle_2023_01_24",
"column-name": "testcolumn2"
},
"parallel-load": null,
"rule-action": "remove-column",
"value": null,
"old-value": null
},
{
"rule-type": "transformation",
"rule-id": "319641293",
"rule-name": "319641293",
"rule-target": "column",
"object-locator": {
"schema-name": "public",
"table-name": "cycle_2023_01_23",
"column-name": "testcolumn1"
},
"parallel-load": null,
"rule-action": "remove-column",
"value": null,
"old-value": null
},
{
"rule-type": "selection",
"rule-id": "318744002",
"rule-name": "318744002",
"object-locator": {
"schema-name": "public",
"table-name": "cycle_2023_01_24"
},
"rule-action": "include",
"filters": []
},
{
"rule-type": "selection",
"rule-id": "144651340",
"rule-name": "144651340",
"object-locator": {
"schema-name": "public",
"table-name": "cycle_2023_01_23"
},
"rule-action": "include",
"filters": []
}
]
}
for more information please refer
if you more columns to remove you use include column option
The include-column value of the rule-action parameter changes the mode of the table to drop all columns by default and include the columns specified. Multiple columns are included in the target by invoking the include-column rule multiple times.
answered 2 years ago
Thanks Subhashr,
Can you advise if my understanding is correct?
From the example that you provided. cycle_2023_01_23 table will be migrated but without the testcolumn1 cycle_2023_01_24 table will be migrated but without the testcolumn2
From the doc, yeah I read The include-column value of the rule-action parameter changes the mode of the table to drop all columns by default and include the columns specified. Multiple columns are included in the target by invoking the include-column rule multiple times.
Because the number of columns to migrate is a lot less than the number of columns, it is best to use include-column instead of the remove-column, is that correct? So if I have 20 columns, and I only want 5 of them, that is 5 include-column instead of 15 remove-column?
thats correct but make sure atleast one of the column with primary key so that lob column migration and cdc runs fine.
answered 2 years ago
do you by any chance know if anyone has made a video of some sort for include-column?
Hi, Finally got to try the include-column thing. As it turns out, I don't need to use it. Looks like DMS has some sort of smarts into it. If I create the target table with all the columns, even if I use include-column, DMS inserts to all columns. If I create the target table with only the columns that I wanted, it only populates these columns. I was expecting maybe DMS will complain if there is non 1-1 column mappings but it didn't.
answered 2 years ago

Thanks. I'll have a read at your example.