dms-schema-conversion

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DMS Schema Conversion

DMS Schema转换

Overview

概述

This skill handles the full DMS Schema Conversion lifecycle — from first-time setup to running conversions on an existing project.
Execute commands using available tools from the AWS MCP server when connected — it provides sandboxed execution, audit logging, and observability. When the MCP server is not available, fall back to the AWS CLI or shell as needed.
Key documentation:
Global constraint: You MUST fetch and read any linked documentation before acting on it — do NOT rely on memory for any referenced material (selection rules, transformation rules, troubleshooting guides, network configuration, etc.). Documentation contains vendor-specific details that change between engines and API versions.

本技能处理完整的DMS Schema Conversion生命周期——从首次设置到对现有项目执行转换操作。
连接后使用AWS MCP服务器提供的可用工具执行命令——它提供沙箱执行、审计日志和可观测性。当MCP服务器不可用时,根据需要回退使用AWS CLI或shell。
关键文档:
全局约束: 在执行相关操作前,你必须获取并阅读所有链接文档——不要依赖记忆处理任何参考资料(选择规则、转换规则、故障排查指南、网络配置等)。文档包含特定于厂商的细节,这些细节会随引擎和API版本而变化。

Verify Dependencies

验证依赖项

Before starting, check that AWS CLI commands can be executed.
Constraints:
  • You MUST verify that AWS CLI commands can be run (via MCP server tools or directly via shell)
  • You MUST inform the customer if no execution method is available and ask whether to proceed
  • You MUST ask the customer which AWS region to use — do NOT attempt to infer it from the STS response (it does not contain a region field). If the customer is unsure, suggest checking the
    AWS_DEFAULT_REGION
    environment variable or the
    --region
    flag they are using.

开始前,请检查是否可以执行AWS CLI命令。
约束:
  • 你必须验证是否可以运行AWS CLI命令(通过MCP服务器工具或直接通过shell)
  • 如果没有可用的执行方法,你必须告知客户并询问是否继续
  • 你必须询问客户要使用哪个AWS区域——不要尝试从STS响应中推断(它不包含区域字段)。如果客户不确定,建议检查
    AWS_DEFAULT_REGION
    环境变量或他们正在使用的
    --region
    参数。

Project Selection

项目选择

Check for existing migration projects:
aws dms describe-migration-projects
  • If exactly one project exists → ask the customer: "Found migration project
    <name>
    . Would you like to use it, or create a new one?" If they confirm, store
    migration_project_identifier
    and proceed to Actions Menu. If they want a new one, run the setup wizard.
  • If multiple projects exist → list them and ask the customer to pick one, or offer to create a new project. Store
    migration_project_identifier
    , proceed to Actions Menu.
  • If no projects exist → ask: "No migration projects found. Would you like to create one?" If yes, load setup-wizard.md and run the full setup wizard from Phase 1. After wizard completes, run Auto Import, then proceed to Actions Menu.

检查是否存在现有迁移项目:
aws dms describe-migration-projects
  • 如果恰好存在一个项目 → 询问客户:"找到迁移项目
    <name>
    。你想要使用它,还是创建一个新项目?" 如果客户确认,保存
    migration_project_identifier
    并进入操作菜单。如果客户想要新项目,运行设置向导。
  • 如果存在多个项目 → 列出所有项目并让客户选择一个,或者提供创建新项目的选项。保存
    migration_project_identifier
    ,进入操作菜单
  • 如果没有项目 → 询问:"未找到迁移项目。你想要创建一个吗?" 如果是,加载setup-wizard.md并运行第一阶段的完整设置向导。向导完成后,运行自动导入,然后进入操作菜单

Auto Import

自动导入

This section runs only after the setup wizard creates a new project. Do NOT run for existing projects.
  1. Build selection rules to import all schemas from the source server. Use the actual source server endpoint as
    server-name
    . See Selection rules in DMS Schema Conversion for JSON format.
  2. Run
    start-metadata-model-import
    with
    --origin SOURCE --refresh
    and the selection rules from step 1.
  3. Wait for import completion using the DMS waiter:
    aws dms wait metadata-model-imported \
      --migration-project-identifier <migration_project_identifier>
  4. Show discovered schemas: On success, call
    describe-metadata-model-children
    with
    --origin SOURCE
    at the root level to list the imported schemas/databases. Present the discovered names to the customer so they can confirm the correct database connection was established:
    "Import complete. I found the following schemas/databases:
    <list>
    . Does this look correct?"
  5. Proceed to Actions Menu.

本部分仅在设置向导创建新项目后运行。不要对现有项目运行此操作。
  1. 构建选择规则,从源服务器导入所有架构。使用实际的源服务器端点作为
    server-name
    。有关JSON格式,请参阅DMS Schema转换中的选择规则
  2. 使用
    --origin SOURCE --refresh
    参数和步骤1中的选择规则运行
    start-metadata-model-import
  3. 使用DMS等待器等待导入完成:
    aws dms wait metadata-model-imported \
      --migration-project-identifier <migration_project_identifier>
  4. 显示发现的架构: 成功后,在根级别调用
    describe-metadata-model-children
    并指定
    --origin SOURCE
    ,列出导入的架构/数据库。将发现的名称展示给客户,以便他们确认已建立正确的数据库连接:
    "导入完成。我发现以下架构/数据库:
    <list>
    。看起来是否正确?"
  5. 进入操作菜单

Actions Menu

操作菜单

Present the actions menu using a structured selection tool (e.g.,
AskUserQuestion
) if available — this gives the customer a clickable/selectable list.
For SQL Server → PostgreSQL/Aurora PostgreSQL projects (present as a single-select question "What would you like to do?"):
  1. Convert database — convert schema objects to the target engine (also produces an conversion assessment report)
  2. Assess database — run a compatibility assessment (also produces an conversion assessment report)
  3. Convert statement — convert a single SQL statement
  4. Clean up — delete migration project and related DMS resources
For all other engine combinations (present as a single-select question "What would you like to do?"):
  1. Convert database — convert schema objects to the target engine (also produces an conversion assessment report)
  2. Assess database — run a compatibility assessment (also produces an conversion assessment report)
  3. Work with tree — browse the metadata model tree
  4. Clean up — delete migration project and related DMS resources
The customer can always type a custom request via "Other" (e.g., "work with tree", "show database statistics", or "exit"). If the customer selects "Other" and describes an action covered by this skill, handle it accordingly.
After each action completes, return to this menu by presenting the same selection again.
Note on metadata loading:
start-metadata-model-import
(with
Refresh=false
),
start-metadata-model-assessment
, and
start-metadata-model-conversion
all load the source tree for the scoped objects. If metadata was already imported in the current session for a given subtree, it does not need to be re-imported — these operations will work with what is already loaded.

如果可用,使用结构化选择工具(如
AskUserQuestion
)展示操作菜单——这会给客户一个可点击/选择的列表。
对于SQL Server → PostgreSQL/Aurora PostgreSQL项目(以单选问题形式呈现:"你想要执行什么操作?"):
  1. 转换数据库 — 将架构对象转换为目标引擎(同时生成转换评估报告)
  2. 评估数据库 — 运行兼容性评估(同时生成转换评估报告)
  3. 转换语句 — 转换单个SQL语句
  4. 清理 — 删除迁移项目及相关DMS资源
对于所有其他引擎组合(以单选问题形式呈现:"你想要执行什么操作?"):
  1. 转换数据库 — 将架构对象转换为目标引擎(同时生成转换评估报告)
  2. 评估数据库 — 运行兼容性评估(同时生成转换评估报告)
  3. 浏览元数据树 — 浏览元数据模型树
  4. 清理 — 删除迁移项目及相关DMS资源
客户始终可以通过“其他”选项输入自定义请求(例如“浏览元数据树”、“显示数据库统计信息”或“退出”)。如果客户选择“其他”并描述了本技能涵盖的操作,请相应处理。
每个操作完成后,再次展示相同的选择列表,返回此菜单。
元数据加载说明:
start-metadata-model-import
Refresh=false
)、
start-metadata-model-assessment
start-metadata-model-conversion
都会加载限定范围内对象的源树。如果在当前会话中已导入给定子树的元数据,则无需重新导入——这些操作将使用已加载的内容。

Convert Database

转换数据库

  1. Ask what to convert: Ask the customer what they want to convert (e.g., "all schemas", "schema public", "tables starting with PROD_").
  2. Build selection rules: Translate the customer's natural language to selection rules JSON. Refer to Selection rules in DMS Schema Conversion for format, wildcards, and vendor-specific locators.
  3. Run conversion: Call
    start-metadata-model-conversion
    with the migration project and selection rules. Extract
    RequestIdentifier
    .
  4. Wait for completion: Wait using the DMS waiter:
    aws dms wait metadata-model-converted \
      --migration-project-identifier <migration_project_identifier>
  5. Export conversion assessment report: On conversion success, call
    export-metadata-model-assessment
    with the same selection rules. Provide the customer with S3 links for both PDF and CSV reports (
    PdfReport.S3ObjectKey
    and
    CsvReport.S3ObjectKey
    ).
  6. Show summary: Download the Summary CSV from S3 using
    aws s3 cp s3://<bucket>/<CsvReport.S3ObjectKey> ./Summary.csv
    . Present its contents to the customer — show the number of objects per category, how many converted automatically, and how many have Action Items at each complexity level.
  7. Post-convert sub-menu: After showing the summary, present options. Only show "Apply to target" if the target is a live database (not virtual):
    "What would you like to do next?
    1. Fix Action Items — review and fix Action Items from the conversion assessment report
    2. Export as script — export converted DDL as SQL script to S3
    3. Apply to target — apply converted objects to the target database (live targets only)
    4. Back — return to actions menu"
    • Fix Action Items: Load action-items.md and follow the fixing workflow there.
    • Export as script: Run
      aws dms start-metadata-model-export-as-script --migration-project-identifier <migration_project_identifier> --origin TARGET --selection-rules '<json>'
      . Wait via
      aws dms wait metadata-model-exported-as-script
      . Provide the S3 link on completion.
    • Apply to target: Run
      aws dms start-metadata-model-export-to-target --migration-project-identifier <migration_project_identifier> --selection-rules '<json>'
      . Optionally pass
      --overwrite-extension-pack
      if the customer confirms. Wait via
      aws dms wait metadata-model-exported-to-target
      . Inform the customer on completion.
    • Back: Return to Actions Menu.
After completing, ask the customer what they'd like to do next.

  1. 询问转换范围: 询问客户想要转换的内容(例如“所有架构”、“public架构”、“以PROD_开头的表”)。
  2. 构建选择规则: 将客户的自然语言转换为选择规则JSON。有关格式、通配符和特定于厂商的定位符,请参阅DMS Schema转换中的选择规则
  3. 运行转换: 使用迁移项目和选择规则调用
    start-metadata-model-conversion
    。提取
    RequestIdentifier
  4. 等待完成: 使用DMS等待器等待:
    aws dms wait metadata-model-converted \
      --migration-project-identifier <migration_project_identifier>
  5. 导出转换评估报告: 转换成功后,使用相同的选择规则调用
    export-metadata-model-assessment
    。为客户提供PDF和CSV报告的S3链接(
    PdfReport.S3ObjectKey
    CsvReport.S3ObjectKey
    )。
  6. 显示摘要: 使用
    aws s3 cp s3://<bucket>/<CsvReport.S3ObjectKey> ./Summary.csv
    从S3下载摘要CSV。向客户展示其内容——显示每个类别的对象数量、自动转换的数量以及每个复杂度级别的待处理项(Action Items)数量。
  7. 转换后子菜单: 显示摘要后,展示选项。仅当目标是实时数据库(非虚拟)时才显示“应用到目标”:
    "接下来你想要执行什么操作?
    1. 修复待处理项 — 查看并修复转换评估报告中的待处理项
    2. 导出为脚本 — 将转换后的DDL作为SQL脚本导出到S3
    3. 应用到目标 — 将转换后的对象应用到目标数据库 (仅适用于实时目标)
    4. 返回 — 返回操作菜单"
    • 修复待处理项: 加载action-items.md并遵循其中的修复工作流。
    • 导出为脚本: 运行
      aws dms start-metadata-model-export-as-script --migration-project-identifier <migration_project_identifier> --origin TARGET --selection-rules '<json>'
      。通过
      aws dms wait metadata-model-exported-as-script
      等待。完成后提供S3链接。
    • 应用到目标: 运行
      aws dms start-metadata-model-export-to-target --migration-project-identifier <migration_project_identifier> --selection-rules '<json>'
      。如果客户确认,可选择传递
      --overwrite-extension-pack
      参数。通过
      aws dms wait metadata-model-exported-to-target
      等待。完成后通知客户。
    • 返回: 返回操作菜单
完成后,询问客户接下来想要执行什么操作。

Assess Database

评估数据库

Assessment analyzes conversion complexity and generates an conversion assessment report without actually converting any objects. Use this when the customer wants to understand the migration effort before committing to conversion.
Important: If the customer already ran a conversion on the same scope, a separate assessment is not necessary — conversion already produces an conversion assessment report. Inform the customer: "You already have an conversion assessment report from the conversion you ran. Would you like me to show that report instead, or do you want to re-run assessment on a different scope?"
  1. Ask what to assess: Ask the customer what they want to assess (e.g., "all schemas", "schema pg_catalog", "tables starting with PROD_").
  2. Build selection rules: Translate the customer's natural language to selection rules JSON. Refer to Selection rules in DMS Schema Conversion for format, wildcards, and vendor-specific locators.
  3. Run assessment: Call
    start-metadata-model-assessment
    with the migration project and selection rules. Extract
    RequestIdentifier
    .
  4. Wait for completion: Wait using the DMS waiter:
    aws dms wait metadata-model-assessed \
      --migration-project-identifier <migration_project_identifier>
  5. Export conversion assessment report: On success, call
    export-metadata-model-assessment
    with the same selection rules. Provide the customer with S3 links for both PDF and CSV reports (
    PdfReport.S3ObjectKey
    and
    CsvReport.S3ObjectKey
    ). The report contains conversion complexity statistics, Action Items, and estimated effort.
  6. Show summary: Download the Summary CSV from S3 using
    aws s3 cp s3://<bucket>/<CsvReport.S3ObjectKey> ./Summary.csv
    . Present its contents to the customer — show the number of objects per category, how many converted automatically, and how many have Action Items at each complexity level.
  7. Offer to fix Action Items: Ask the customer:
    "Would you like me to help fix the Action Items?"
    If yes, load action-items.md and follow the fixing workflow there.
After completing, ask the customer what they'd like to do next.

评估会分析转换复杂度并生成转换评估报告,但不会实际转换任何对象。当客户想要在提交转换前了解迁移工作量时使用此功能。
重要提示: 如果客户已对相同范围运行过转换,则无需单独进行评估——转换已生成转换评估报告。告知客户:"你已经有一份来自之前转换的转换评估报告。你想要我展示该报告,还是在不同范围重新运行评估?"
  1. 询问评估范围: 询问客户想要评估的内容(例如“所有架构”、“pg_catalog架构”、“以PROD_开头的表”)。
  2. 构建选择规则: 将客户的自然语言转换为选择规则JSON。有关格式、通配符和特定于厂商的定位符,请参阅DMS Schema转换中的选择规则
  3. 运行评估: 使用迁移项目和选择规则调用
    start-metadata-model-assessment
    。提取
    RequestIdentifier
  4. 等待完成: 使用DMS等待器等待:
    aws dms wait metadata-model-assessed \
      --migration-project-identifier <migration_project_identifier>
  5. 导出转换评估报告: 成功后,使用相同的选择规则调用
    export-metadata-model-assessment
    。为客户提供PDF和CSV报告的S3链接(
    PdfReport.S3ObjectKey
    CsvReport.S3ObjectKey
    )。报告包含转换复杂度统计数据、待处理项和预估工作量。
  6. 显示摘要: 使用
    aws s3 cp s3://<bucket>/<CsvReport.S3ObjectKey> ./Summary.csv
    从S3下载摘要CSV。向客户展示其内容——显示每个类别的对象数量、自动转换的数量以及每个复杂度级别的待处理项数量。
  7. 提供修复待处理项的帮助: 询问客户:
    "你想要我帮助修复待处理项吗?"
    如果是,加载action-items.md并遵循其中的修复工作流。
完成后,询问客户接下来想要执行什么操作。

Review Action Items

查看待处理项

Load action-items.md and follow the workflow there.
After completing, ask the customer what they'd like to do next.

加载action-items.md并遵循其中的工作流。
完成后,询问客户接下来想要执行什么操作。

Work with Tree

浏览元数据树

The metadata tree represents database schemas hierarchically. It contains two kinds of elements:
  • Objects — actual database objects (tables, functions, views, sequences, indexes) that have SQL definitions
  • Categories — virtual grouping containers ("Schemas", "Tables", "Functions") that organize objects for navigation but have no SQL definitions
The tree uses on-demand loading — metadata is retrieved from the database only when imported. See Navigating the metadata model for full details.
Navigation uses two APIs:
  • describe-metadata-model-children
    — returns the children of a given node, each with its own
    SelectionRules
    for drilling deeper
  • describe-metadata-model
    — returns the name, type, and SQL definition of a specific object
Both require
--origin SOURCE
or
--origin TARGET
and accept only
explicit
selection rules.
  1. Show tree root: Call
    describe-metadata-model-children
    with selection rules targeting the root level and
    --origin SOURCE
    . If the tree is empty, automatically run a metadata import (same as Auto Import) and then re-display the tree root.
  2. Navigate: Each child in the response has
    MetadataModelName
    and
    SelectionRules
    . Present the children and ask the customer what to do:
    • Show children — drill into a child by calling
      describe-metadata-model-children
      with the child's
      SelectionRules
      as the
      --selection-rules
      parameter
    • Show definition — display the DDL for the selected object (see step 3). Only available for objects, not categories.
    • Go up — return to the parent node
    • Exit tree — return to actions menu
  3. Show definition: Call
    describe-metadata-model
    with the child's
    SelectionRules
    and
    --origin SOURCE
    . The response includes
    Definition
    (SOURCE DDL) and
    TargetMetadataModels
    (list of converted counterparts with their own
    SelectionRules
    ). To get the TARGET DDL, call
    describe-metadata-model
    again with
    SelectionRules
    from
    TargetMetadataModels[0]
    and
    --origin TARGET
    . Present both clearly labeled as SOURCE and TARGET.
  4. Refresh from database: If the customer asks to refresh, run
    start-metadata-model-import
    with selection rules scoped to the current tree position,
    --origin SOURCE --refresh
    . Wait via
    aws dms wait metadata-model-imported
    . After refresh completes, re-display the current node's children.
After completing, ask the customer what they'd like to do next.

元数据树以层级结构表示数据库架构。它包含两种元素:
  • 对象 — 具有SQL定义的实际数据库对象(表、函数、视图、序列、索引)
  • 类别 — 用于组织对象以便导航的虚拟分组容器(“架构”、“表”、“函数”),但没有SQL定义
树使用按需加载——仅在导入时从数据库检索元数据。有关详细信息,请参阅浏览元数据模型
导航使用两个API:
  • describe-metadata-model-children
    — 返回给定节点的子节点,每个子节点都有自己的
    SelectionRules
    用于深入浏览
  • describe-metadata-model
    — 返回特定对象的名称、类型和SQL定义
两者都需要
--origin SOURCE
--origin TARGET
,并且仅接受
explicit
选择规则。
  1. 显示树根: 调用
    describe-metadata-model-children
    ,使用针对根级别的选择规则并指定
    --origin SOURCE
    。如果树为空,自动运行元数据导入(与自动导入相同),然后重新显示树根。
  2. 导航: 响应中的每个子节点都有
    MetadataModelName
    SelectionRules
    。展示子节点并询问客户想要执行的操作:
    • 显示子节点 — 使用子节点的
      SelectionRules
      作为
      --selection-rules
      参数调用
      describe-metadata-model-children
      ,深入浏览子节点
    • 显示定义 — 显示所选对象的DDL(见步骤3)。仅适用于对象,不适用于类别。
    • 返回上级 — 返回父节点
    • 退出树浏览 — 返回操作菜单
  3. 显示定义: 使用子节点的
    SelectionRules
    --origin SOURCE
    调用
    describe-metadata-model
    。响应包含
    Definition
    (源DDL)和
    TargetMetadataModels
    (包含各自
    SelectionRules
    的转换对应项列表)。要获取目标DDL,使用
    TargetMetadataModels[0]
    中的
    SelectionRules
    并指定
    --origin TARGET
    再次调用
    describe-metadata-model
    。将两者分别标记为SOURCETARGET清晰展示。
  4. 从数据库刷新: 如果客户要求刷新,使用限定到当前树位置的选择规则、
    --origin SOURCE --refresh
    运行
    start-metadata-model-import
    。通过
    aws dms wait metadata-model-imported
    等待。刷新完成后,重新显示当前节点的子节点。
完成后,询问客户接下来想要执行什么操作。

Convert Statement

转换语句

Restriction: This feature is only available for SQL Server → PostgreSQL/Aurora PostgreSQL migration projects. Do NOT offer or show this option for any other source/target engine combination.
  1. Determine context: Navigate the metadata tree to find the target location. For SQL Server this is server → database → schema; for other engines it's server → schema. Use
    describe-metadata-model-children
    to drill into nodes until you reach the schema level. Let the customer pick the schema (or database + schema for SQL Server). If the tree is empty, ask the customer to provide the location manually.
  2. Get the SQL statement: Ask the customer for the SQL statement they want to convert.
  3. Build selection rules for the schema: Build selection rules targeting the schema location. See Selection rules in DMS Schema Conversion for format and vendor-specific locators.
  4. Create metadata model: Generate a unique model name (e.g.,
    statement-<timestamp>
    ). Call
    start-metadata-model-creation
    with:
    • --selection-rules
      — the schema selection rules from step 3
    • --metadata-model-name
      — the generated model name
    • --properties '{"StatementProperties": {"Definition": "<sql_statement>"}}'
    Wait via
    aws dms wait metadata-model-created
    .
  5. Build selection rules for the statement: Build selection rules targeting the specific statement. See Selection rules in DMS Schema Conversion — use
    statement-name
    set to the model name.
  6. Convert the created model: Call
    start-metadata-model-conversion
    with the statement selection rules from step 5. Wait via
    aws dms wait metadata-model-converted
    .
  7. Show converted result: Call
    describe-metadata-model
    with the statement selection rules from step 5 and
    --origin SOURCE
    . From the response, extract
    TargetMetadataModels[0].SelectionRules
    . Then call
    describe-metadata-model
    with those target selection rules and
    --origin TARGET
    . Present the converted SQL from the
    Definition
    field clearly to the customer.
  8. Export conversion assessment report: Call
    export-metadata-model-assessment
    with the source selection rules from step 5. Provide the customer with S3 links for PDF and CSV reports.
After completing, ask the customer what they'd like to do next.

限制: 此功能仅适用于SQL Server → PostgreSQL/Aurora PostgreSQL迁移项目。不要为任何其他源/目标引擎组合提供或显示此选项。
  1. 确定上下文: 浏览元数据树找到目标位置。对于SQL Server,位置是服务器→数据库→架构;对于其他引擎,是服务器→架构。使用
    describe-metadata-model-children
    深入节点直到到达架构级别。让客户选择架构(对于SQL Server是数据库+架构)。如果树为空,询问客户手动提供位置。
  2. 获取SQL语句: 询问客户想要转换的SQL语句。
  3. 构建架构选择规则: 构建针对架构位置的选择规则。有关格式和特定于厂商的定位符,请参阅DMS Schema转换中的选择规则
  4. 创建元数据模型: 生成唯一的模型名称(例如
    statement-<timestamp>
    )。调用
    start-metadata-model-creation
    并指定:
    • --selection-rules
      — 步骤3中的架构选择规则
    • --metadata-model-name
      — 生成的模型名称
    • --properties '{"StatementProperties": {"Definition": "<sql_statement>"}}'
    通过
    aws dms wait metadata-model-created
    等待。
  5. 构建语句选择规则: 构建针对特定语句的选择规则。有关详细信息,请参阅DMS Schema转换中的选择规则 — 使用
    statement-name
    设置为模型名称。
  6. 转换创建的模型: 使用步骤5中的语句选择规则调用
    start-metadata-model-conversion
    。通过
    aws dms wait metadata-model-converted
    等待。
  7. 显示转换结果: 使用步骤5中的语句选择规则和
    --origin SOURCE
    调用
    describe-metadata-model
    。从响应中提取
    TargetMetadataModels[0].SelectionRules
    。然后使用这些目标选择规则并指定
    --origin TARGET
    调用
    describe-metadata-model
    。将
    Definition
    字段中的转换后SQL清晰展示给客户。
  8. 导出转换评估报告: 使用步骤5中的选择规则调用
    export-metadata-model-assessment
    。为客户提供PDF和CSV报告的S3链接。
完成后,询问客户接下来想要执行什么操作。

Database Statistics

数据库统计信息

When a customer asks about their source database statistics — such as the number of objects, object types, schema sizes, or a general overview — run an assessment and present the results as a concise summary.
  1. Build selection rules based on the customer's scope. If they specify particular schemas or objects, scope accordingly. If no scope is specified, default to all schemas on the source server (wildcard
    %
    ). See Selection rules in DMS Schema Conversion for JSON format.
  2. Run assessment: Call
    start-metadata-model-assessment
    with the migration project and selection rules. See schema-conversion-operations.md for execution details.
  3. Wait for completion using the DMS waiter or fallback polling as described in schema-conversion-operations.md.
  4. Export conversion assessment report: Call
    export-metadata-model-assessment
    with the same selection rules.
  5. Download and present only what the customer asked for: Download the Summary CSV from S3:
    aws s3 cp s3://<bucket>/<CsvReport.S3ObjectKey> ./Summary.csv
    The report contains many data points. Present only the information the customer requested — do not dump the entire report. For example:
    • If they asked "how many tables?" → show only the table count
    • If they asked about a specific schema → show only that schema's stats
  6. Offer next steps: Ask if they'd like to see conversion complexity or proceed with conversion.
Constraints:
  • If the customer specifies a scope, use it. If not, default to all schemas.
  • Present only what the customer asked for — do not overwhelm with unrequested data.
  • Present statistics in a clear, tabular format.
After completing, ask the customer what they'd like to do next.

当客户询问源数据库统计信息(例如对象数量、对象类型、架构大小或总体概述)时,运行评估并将结果作为简洁摘要展示。
  1. 构建选择规则 根据客户指定的范围。如果客户指定了特定架构或对象,则相应限定范围。如果未指定范围,默认使用源服务器上的所有架构(通配符
    %
    )。有关JSON格式,请参阅DMS Schema转换中的选择规则
  2. 运行评估: 使用迁移项目和选择规则调用
    start-metadata-model-assessment
    。有关执行细节,请参阅schema-conversion-operations.md
  3. 等待完成 使用DMS等待器或按照schema-conversion-operations.md中描述的回退轮询方式等待。
  4. 导出转换评估报告: 使用相同的选择规则调用
    export-metadata-model-assessment
  5. 下载并仅展示客户请求的内容: 从S3下载摘要CSV:
    aws s3 cp s3://<bucket>/<CsvReport.S3ObjectKey> ./Summary.csv
    报告包含许多数据点。仅展示客户请求的信息——不要输出整个报告。例如:
    • 如果客户询问“有多少张表?” → 仅展示表的数量
    • 如果客户询问特定架构 → 仅展示该架构的统计信息
  6. 提供下一步选项: 询问客户是否想要查看转换复杂度或继续执行转换。
约束:
  • 如果客户指定了范围,请使用该范围。如果未指定,默认使用所有架构。
  • 仅展示客户请求的内容——不要用未请求的数据淹没客户。
  • 以清晰的表格格式展示统计信息。
完成后,询问客户接下来想要执行什么操作。

Clean Up

清理

Delete the migration project and its associated DMS resources. Resources MUST be deleted in dependency order.
  1. Confirm with customer: List the resources that will be deleted and ask for confirmation:
    aws dms describe-migration-projects --filter Name=migration-project-identifier,Values=<migration_project_identifier>
    Show the project name, source/target data providers, and instance profile.
  2. Delete migration project:
    aws dms delete-migration-project \
      --migration-project-identifier <migration_project_identifier>
  3. Delete data providers: Delete both source and target data providers:
    aws dms delete-data-provider \
      --data-provider-identifier <source_data_provider_identifier>
    aws dms delete-data-provider \
      --data-provider-identifier <target_data_provider_identifier>
  4. Delete instance profile:
    aws dms delete-instance-profile \
      --instance-profile-identifier <instance_profile_identifier>
  5. Delete subnet group:
    aws dms delete-replication-subnet-group \
      --replication-subnet-group-identifier <subnet_group_identifier>
  6. Confirm completion: Inform the customer that all DMS Schema Conversion resources have been removed.
Constraints:
  • You MUST get explicit customer confirmation before deleting any resources.
  • You MUST delete in order: migration project first, then data providers, then instance profile, then subnet group — deleting in the wrong order will fail due to dependencies.
  • You MUST NOT delete the underlying infrastructure (VPC, subnets, security groups, RDS instances, Secrets Manager secrets) — those are outside the scope of DMS Schema Conversion cleanup.
After completing, ask the customer what they'd like to do next.

删除迁移项目及其关联的DMS资源。必须按依赖顺序删除资源。
  1. 获得客户确认: 列出将被删除的资源并请求确认:
    aws dms describe-migration-projects --filter Name=migration-project-identifier,Values=<migration_project_identifier>
    展示项目名称、源/目标数据提供程序和实例配置文件。
  2. 删除迁移项目:
    aws dms delete-migration-project \
      --migration-project-identifier <migration_project_identifier>
  3. 删除数据提供程序: 删除源和目标数据提供程序:
    aws dms delete-data-provider \
      --data-provider-identifier <source_data_provider_identifier>
    aws dms delete-data-provider \
      --data-provider-identifier <target_data_provider_identifier>
  4. 删除实例配置文件:
    aws dms delete-instance-profile \
      --instance-profile-identifier <instance_profile_identifier>
  5. 删除子网组:
    aws dms delete-replication-subnet-group \
      --replication-subnet-group-identifier <subnet_group_identifier>
  6. 确认完成: 告知客户所有DMS Schema转换资源已被移除。
约束:
  • 删除任何资源前必须获得客户的明确确认。
  • 必须按以下顺序删除:先删除迁移项目,然后是数据提供程序,接着是实例配置文件,最后是子网组——错误的删除顺序会因依赖关系而失败。
  • 不得删除底层基础设施(VPC、子网、安全组、RDS实例、Secrets Manager密钥)——这些超出了DMS Schema转换清理的范围。
完成后,询问客户接下来想要执行什么操作。

Cancel Awareness

取消操作感知

During any running async operation, if the customer requests cancellation, refer to cancel-operations.md for the correct cancel command mapping.

在任何异步操作运行期间,如果客户请求取消,请参考cancel-operations.md获取正确的取消命令映射。

Security Considerations

安全注意事项

  • Ensure database credentials are stored in Secrets Manager with encryption
  • Apply least-privilege IAM policies scoped to specific resources
  • Restrict security group rules to specific CIDRs or security groups and database ports
  • See DMS security best practices for additional guidance

  • 确保数据库凭据存储在加密的Secrets Manager中
  • 应用限定到特定资源的最小权限IAM策略
  • 将安全组规则限制为特定CIDR或安全组以及数据库端口
  • 有关其他指导,请参阅DMS安全最佳实践

Error Handling

错误处理

When any operation fails or returns an error, load troubleshooting.md and follow its guidance to diagnose and resolve the issue. Explain the error to the customer in plain language and offer options: retry, try a different action, or exit.
当任何操作失败或返回错误时,加载troubleshooting.md并遵循其指导诊断和解决问题。用通俗易懂的语言向客户解释错误,并提供选项:重试、尝试其他操作或退出。