跳至內容

如何建立僅驗證 AWS DMS 任務?

2 分的閱讀內容
0

我想要建立一個 AWS Database Migration Service (AWS DMS) 任務,用於預覽並驗證資料。

簡短說明

您可以建立下列類型的僅驗證工作

如需更多關於如何使用僅驗證工作的資訊,請參閱 Validation only use cases (僅驗證使用案例)。

解決方法

**注意:**如果您在執行 AWS Command Line Interface (AWS CLI) 命令時收到錯誤訊息,請參閱 Troubleshooting errors for the AWS CLI (對 AWS CLI 錯誤進行疑難排解)。此外,請務必使用最新版 AWS CLI

使用 AWS DMS 主控台建立僅驗證工作

請完成下列步驟:

  1. 開啟 AWS DMS 主控台

  2. 在導覽窗格中,於 Migrate or replicate (移轉或複寫) 底下,選擇 Tasks (任務)。

  3. 選擇 Create task (建立任務)。

  4. Task configuration (任務組態) 下輸入詳細資訊。針對 Task type (任務類型),選擇下列其中一個選項:
    針對僅完全載入驗證任務,選擇 Migrate only (僅移轉)。
    針對僅 CDC 驗證任務,選擇 Replicate only (僅複寫)。

  5. Settings (設定) 下,選擇 JSON editor (JSON 編輯器)。將 EnableValidationValidationOnly 設定設為 true,如下列範例所示:

    "EnableValidation": true,
    "ValidationOnly": true,
  6. 檢查 TargetTablePrepMode 是否已設為 DO_NOTHING

  7. Migration task startup configuration (移轉任務啟動組態) 下,選擇 Manually later (稍後再手動執行)。

  8. 選擇 Create task (建立任務)。

使用 AWS CLI 建立僅驗證任務

若要建立僅驗證任務,請執行 create-replication-task AWS CLI 命令:

aws dms create-replication-task --replication-task-identifier your-task-id validation-only-task --replication-task-settings '{"FullLoadSettings":{"TargetTablePrepMode":"DO_NOTHING"},"ValidationSettings":{"EnableValidation":true,"ValidationOnly":true}}' --replication-instance-arn your-replication-instance-arn --source-endpoint-arn your-source-endpoint-arn --target-endpoint-arn your-target-endpoint-arn --migration-type
your-migration-type --table-mappings your-table-mapping-file-path

**注意:**請將 your-task-id 替換為您的複寫任務 ID、your-replication-instance-arn 替換為您的複寫執行個體 Amazon Resource Name (ARN)、your-source-endpoint-arn 替換為您的來源端點 ARN,並將您的 target-endpoint-arn 替換為您的目標端點 ARN。然後,將 your-migration-type 替換為 cdcfull-load,並將 your-table-mapping-file-path 替換為您的資料表對應檔案路徑。

如果想要從特定的時間戳記開始驗證,請新增 --cdc-start-time 參數並指定您的開始時間。

(選擇性) 若要確認您已成功建立工作,請開啟 AWS DMS 主控台。在導覽窗格中的 Migrate or replicate (移轉或複寫) 下,選擇 Tasks (任務),然後尋找您的任務。

相關資訊

Task settings example (任務設定範例)

Limitations (限制)

AWS 官方已更新 6 個月前