DMS 迁移错误:String Length Exceeds DDL Length 完整解决方案
问题描述
在使用 AWS DMS 进行数据库迁移时,经常遇到以下错误:
TASK MANAGER (retcode -1) to execute statement:
RetCode: SQL ERROR SqlState: xx008 NativeError: 30
Message: [Amazon][Amazon Redshift] (30) Error occurred while trying to execute a query:
[SQLState xx008] ERROR: Load into table 'target_table' failed.
Check 'stl_load_errors' system table for details.String length exceeds DDL length
根本原因:
- 源端数据库某些字段的实际数据长度超过目标端定义的字段长度
- 常见于 VARCHAR/CHAR 类型字段
- 目标端为 Redshift、Aurora、RDS 等
问题定位流程
1. 查看 DMS 任务日志
# 获取任务详情
aws dms describe-replication-tasks 