Hem*_*nth 6 oracle postgresql database-migration amazon-web-services aws-dms
我正在尝试使用 DMS 将数据从 oracle 实例移动到 postgres RDS。我仅执行完整加载操作,并且已禁用目标上的所有外键。我还确保同一表的列之间的数据类型不会不匹配。我在目标表准备模式下尝试了“不执行任何操作”和“截断”,当我运行该任务时,多个表失败并显示以下错误消息:
[TARGET_LOAD ]E: Command failed to load data with exit error code 1, Command output: <truncated> [1020403] (csv_target.c:981)
[TARGET_LOAD ]E: Failed to wait for previous run [1020403] (csv_target.c:1578)
[TARGET_LOAD ]E: Failed to load data from csv file. [1020403] (odbc_endpoint_imp.c:5648)
[TARGET_LOAD ]E: Handling End of table 'public'.'SKEWED_VALUES' loading failed by subtask 6 thread 1 [1020403] (endpointshell.c:2416)
Run Code Online (Sandbox Code Playgroud)
DMS 没有给出正确的错误信息,我无法理解上述错误消息的含义。
当我使用“在目标上删除表”作为目标表准备模式时,它可以工作,但它以我不想要的不同方式创建列的数据类型。
任何帮助,将不胜感激。
为了解决我的问题,我创建了仅加载一个问题表的任务副本,并将所有日志记录严重性提升为“详细调试”。然后我就看到了这个:
[TARGET_LOAD ]D: RetCode: SQL_SUCCESS_WITH_INFO SqlState: 42622 NativeError: -1 Message: NOTICE: identifier "diagnosticinterpretationrequestdata_diagnosticinterpretationcode" will be truncated to "diagnosticinterpretationrequestdata_diagnosticinterpretationcod" (ar_odbc_stmt.c:4720)
Run Code Online (Sandbox Code Playgroud)
在目标数据库的 RDS 日志中,我发现:
2021-10-11 14:30:36 UTC:...:[19259]:ERROR: invalid input syntax for integer: ""
2021-10-11 14:30:36 UTC:...:[19259]:CONTEXT: COPY diagnosticinterpretationrequest, line 1, column diagnosticinterpretationrequestdata_diagnosticinterpretationcod: ""
2021-10-11 14:30:36 UTC:...:[19259]:STATEMENT: COPY "myschema"."diagnosticinterpretationrequest" FROM STDIN WITH DELIMITER ',' CSV NULL 'attNULL' ESCAPE '\'
Run Code Online (Sandbox Code Playgroud)
我发现如果我添加一个表映射规则来显式重命名列以在 Postgres 的标识符长度限制内截断名称,那么一切都会正常。
{
"rule-type": "transformation",
"rule-id": "1",
"rule-name": "1",
"rule-target": "column",
"object-locator": {
"schema-name": "%",
"table-name": "%",
"column-name": "diagnosticinterpretationrequestdata_diagnosticinterpretationcode"
},
"rule-action": "rename",
"value": "diagnosticinterpretationrequestdata_diagnosticinterpretationcod",
"old-value": null
},
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3903 次 |
| 最近记录: |