dms-schema-conversion
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDMS 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:
- Selection rules in DMS Schema Conversion — scoping operations to specific objects
- Transformation rules in DMS Schema Conversion — renaming schemas, tables, columns during conversion
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。
关键文档:
- DMS Schema转换中的选择规则 — 将操作范围限定到特定对象
- DMS Schema转换中的转换规则 — 在转换期间重命名架构、表、列
全局约束: 在执行相关操作前,你必须获取并阅读所有链接文档——不要依赖记忆处理任何参考资料(选择规则、转换规则、故障排查指南、网络配置等)。文档包含特定于厂商的细节,这些细节会随引擎和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 environment variable or the
AWS_DEFAULT_REGIONflag they are using.--region
开始前,请检查是否可以执行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 . Would you like to use it, or create a new one?" If they confirm, store
<name>and proceed to Actions Menu. If they want a new one, run the setup wizard.migration_project_identifier - If multiple projects exist → list them and ask the customer to pick one, or offer to create a new project. Store , proceed to Actions Menu.
migration_project_identifier - 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.
-
Build selection rules to import all schemas from the source server. Use the actual source server endpoint as. See Selection rules in DMS Schema Conversion for JSON format.
server-name -
Runwith
start-metadata-model-importand the selection rules from step 1.--origin SOURCE --refresh -
Wait for import completion using the DMS waiter:
aws dms wait metadata-model-imported \ --migration-project-identifier <migration_project_identifier> -
Show discovered schemas: On success, callwith
describe-metadata-model-childrenat 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:--origin SOURCE"Import complete. I found the following schemas/databases:. Does this look correct?"<list> -
Proceed to Actions Menu.
本部分仅在设置向导创建新项目后运行。不要对现有项目运行此操作。
-
构建选择规则,从源服务器导入所有架构。使用实际的源服务器端点作为。有关JSON格式,请参阅DMS Schema转换中的选择规则。
server-name -
使用参数和步骤1中的选择规则运行
--origin SOURCE --refresh。start-metadata-model-import -
使用DMS等待器等待导入完成:
aws dms wait metadata-model-imported \ --migration-project-identifier <migration_project_identifier> -
显示发现的架构: 成功后,在根级别调用并指定
describe-metadata-model-children,列出导入的架构/数据库。将发现的名称展示给客户,以便他们确认已建立正确的数据库连接:--origin SOURCE"导入完成。我发现以下架构/数据库:。看起来是否正确?"<list> -
进入操作菜单。
Actions Menu
操作菜单
Present the actions menu using a structured selection tool (e.g., ) if available — this gives the customer a clickable/selectable list.
AskUserQuestionFor SQL Server → PostgreSQL/Aurora PostgreSQL projects (present as a single-select question "What would you like to do?"):
- Convert database — convert schema objects to the target engine (also produces an conversion assessment report)
- Assess database — run a compatibility assessment (also produces an conversion assessment report)
- Convert statement — convert a single SQL statement
- 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?"):
- Convert database — convert schema objects to the target engine (also produces an conversion assessment report)
- Assess database — run a compatibility assessment (also produces an conversion assessment report)
- Work with tree — browse the metadata model tree
- 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:(withstart-metadata-model-import),Refresh=false, andstart-metadata-model-assessmentall 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.start-metadata-model-conversion
如果可用,使用结构化选择工具(如)展示操作菜单——这会给客户一个可点击/选择的列表。
AskUserQuestion对于SQL Server → PostgreSQL/Aurora PostgreSQL项目(以单选问题形式呈现:"你想要执行什么操作?"):
- 转换数据库 — 将架构对象转换为目标引擎(同时生成转换评估报告)
- 评估数据库 — 运行兼容性评估(同时生成转换评估报告)
- 转换语句 — 转换单个SQL语句
- 清理 — 删除迁移项目及相关DMS资源
对于所有其他引擎组合(以单选问题形式呈现:"你想要执行什么操作?"):
- 转换数据库 — 将架构对象转换为目标引擎(同时生成转换评估报告)
- 评估数据库 — 运行兼容性评估(同时生成转换评估报告)
- 浏览元数据树 — 浏览元数据模型树
- 清理 — 删除迁移项目及相关DMS资源
客户始终可以通过“其他”选项输入自定义请求(例如“浏览元数据树”、“显示数据库统计信息”或“退出”)。如果客户选择“其他”并描述了本技能涵盖的操作,请相应处理。
每个操作完成后,再次展示相同的选择列表,返回此菜单。
元数据加载说明:(start-metadata-model-import)、Refresh=false和start-metadata-model-assessment都会加载限定范围内对象的源树。如果在当前会话中已导入给定子树的元数据,则无需重新导入——这些操作将使用已加载的内容。start-metadata-model-conversion
Convert Database
转换数据库
-
Ask what to convert: Ask the customer what they want to convert (e.g., "all schemas", "schema public", "tables starting with PROD_").
-
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.
-
Run conversion: Callwith the migration project and selection rules. Extract
start-metadata-model-conversion.RequestIdentifier -
Wait for completion: Wait using the DMS waiter:
aws dms wait metadata-model-converted \ --migration-project-identifier <migration_project_identifier> -
Export conversion assessment report: On conversion success, callwith the same selection rules. Provide the customer with S3 links for both PDF and CSV reports (
export-metadata-model-assessmentandPdfReport.S3ObjectKey).CsvReport.S3ObjectKey -
Show summary: Download the Summary CSV from S3 using. 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.
aws s3 cp s3://<bucket>/<CsvReport.S3ObjectKey> ./Summary.csv -
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?
- Fix Action Items — review and fix Action Items from the conversion assessment report
- Export as script — export converted DDL as SQL script to S3
- Apply to target — apply converted objects to the target database (live targets only)
- Back — return to actions menu"
- Fix Action Items: Load action-items.md and follow the fixing workflow there.
- Export as script: Run . Wait via
aws dms start-metadata-model-export-as-script --migration-project-identifier <migration_project_identifier> --origin TARGET --selection-rules '<json>'. Provide the S3 link on completion.aws dms wait metadata-model-exported-as-script - Apply to target: Run . Optionally pass
aws dms start-metadata-model-export-to-target --migration-project-identifier <migration_project_identifier> --selection-rules '<json>'if the customer confirms. Wait via--overwrite-extension-pack. Inform the customer on completion.aws dms wait metadata-model-exported-to-target - Back: Return to Actions Menu.
After completing, ask the customer what they'd like to do next.
-
询问转换范围: 询问客户想要转换的内容(例如“所有架构”、“public架构”、“以PROD_开头的表”)。
-
构建选择规则: 将客户的自然语言转换为选择规则JSON。有关格式、通配符和特定于厂商的定位符,请参阅DMS Schema转换中的选择规则。
-
运行转换: 使用迁移项目和选择规则调用。提取
start-metadata-model-conversion。RequestIdentifier -
等待完成: 使用DMS等待器等待:
aws dms wait metadata-model-converted \ --migration-project-identifier <migration_project_identifier> -
导出转换评估报告: 转换成功后,使用相同的选择规则调用。为客户提供PDF和CSV报告的S3链接(
export-metadata-model-assessment和PdfReport.S3ObjectKey)。CsvReport.S3ObjectKey -
显示摘要: 使用从S3下载摘要CSV。向客户展示其内容——显示每个类别的对象数量、自动转换的数量以及每个复杂度级别的待处理项(Action Items)数量。
aws s3 cp s3://<bucket>/<CsvReport.S3ObjectKey> ./Summary.csv -
转换后子菜单: 显示摘要后,展示选项。仅当目标是实时数据库(非虚拟)时才显示“应用到目标”:"接下来你想要执行什么操作?
- 修复待处理项 — 查看并修复转换评估报告中的待处理项
- 导出为脚本 — 将转换后的DDL作为SQL脚本导出到S3
- 应用到目标 — 将转换后的对象应用到目标数据库 (仅适用于实时目标)
- 返回 — 返回操作菜单"
- 修复待处理项: 加载action-items.md并遵循其中的修复工作流。
- 导出为脚本: 运行。通过
aws dms start-metadata-model-export-as-script --migration-project-identifier <migration_project_identifier> --origin TARGET --selection-rules '<json>'等待。完成后提供S3链接。aws dms wait metadata-model-exported-as-script - 应用到目标: 运行。如果客户确认,可选择传递
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?"
-
Ask what to assess: Ask the customer what they want to assess (e.g., "all schemas", "schema pg_catalog", "tables starting with PROD_").
-
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.
-
Run assessment: Callwith the migration project and selection rules. Extract
start-metadata-model-assessment.RequestIdentifier -
Wait for completion: Wait using the DMS waiter:
aws dms wait metadata-model-assessed \ --migration-project-identifier <migration_project_identifier> -
Export conversion assessment report: On success, callwith the same selection rules. Provide the customer with S3 links for both PDF and CSV reports (
export-metadata-model-assessmentandPdfReport.S3ObjectKey). The report contains conversion complexity statistics, Action Items, and estimated effort.CsvReport.S3ObjectKey -
Show summary: Download the Summary CSV from S3 using. 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.
aws s3 cp s3://<bucket>/<CsvReport.S3ObjectKey> ./Summary.csv -
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.
评估会分析转换复杂度并生成转换评估报告,但不会实际转换任何对象。当客户想要在提交转换前了解迁移工作量时使用此功能。
重要提示: 如果客户已对相同范围运行过转换,则无需单独进行评估——转换已生成转换评估报告。告知客户:"你已经有一份来自之前转换的转换评估报告。你想要我展示该报告,还是在不同范围重新运行评估?"
-
询问评估范围: 询问客户想要评估的内容(例如“所有架构”、“pg_catalog架构”、“以PROD_开头的表”)。
-
构建选择规则: 将客户的自然语言转换为选择规则JSON。有关格式、通配符和特定于厂商的定位符,请参阅DMS Schema转换中的选择规则。
-
运行评估: 使用迁移项目和选择规则调用。提取
start-metadata-model-assessment。RequestIdentifier -
等待完成: 使用DMS等待器等待:
aws dms wait metadata-model-assessed \ --migration-project-identifier <migration_project_identifier> -
导出转换评估报告: 成功后,使用相同的选择规则调用。为客户提供PDF和CSV报告的S3链接(
export-metadata-model-assessment和PdfReport.S3ObjectKey)。报告包含转换复杂度统计数据、待处理项和预估工作量。CsvReport.S3ObjectKey -
显示摘要: 使用从S3下载摘要CSV。向客户展示其内容——显示每个类别的对象数量、自动转换的数量以及每个复杂度级别的待处理项数量。
aws s3 cp s3://<bucket>/<CsvReport.S3ObjectKey> ./Summary.csv -
提供修复待处理项的帮助: 询问客户:"你想要我帮助修复待处理项吗?"如果是,加载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:
- — returns the children of a given node, each with its own
describe-metadata-model-childrenfor drilling deeperSelectionRules - — returns the name, type, and SQL definition of a specific object
describe-metadata-model
Both require or and accept only selection rules.
--origin SOURCE--origin TARGETexplicit-
Show tree root: Callwith selection rules targeting the root level and
describe-metadata-model-children. If the tree is empty, automatically run a metadata import (same as Auto Import) and then re-display the tree root.--origin SOURCE -
Navigate: Each child in the response hasand
MetadataModelName. Present the children and ask the customer what to do:SelectionRules- Show children — drill into a child by calling with the child's
describe-metadata-model-childrenas theSelectionRulesparameter--selection-rules - 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
- Show children — drill into a child by calling
-
Show definition: Callwith the child's
describe-metadata-modelandSelectionRules. The response includes--origin SOURCE(SOURCE DDL) andDefinition(list of converted counterparts with their ownTargetMetadataModels). To get the TARGET DDL, callSelectionRulesagain withdescribe-metadata-modelfromSelectionRulesandTargetMetadataModels[0]. Present both clearly labeled as SOURCE and TARGET.--origin TARGET -
Refresh from database: If the customer asks to refresh, runwith selection rules scoped to the current tree position,
start-metadata-model-import. Wait via--origin SOURCE --refresh. After refresh completes, re-display the current node's children.aws dms wait metadata-model-imported
After completing, ask the customer what they'd like to do next.
元数据树以层级结构表示数据库架构。它包含两种元素:
- 对象 — 具有SQL定义的实际数据库对象(表、函数、视图、序列、索引)
- 类别 — 用于组织对象以便导航的虚拟分组容器(“架构”、“表”、“函数”),但没有SQL定义
树使用按需加载——仅在导入时从数据库检索元数据。有关详细信息,请参阅浏览元数据模型。
导航使用两个API:
- — 返回给定节点的子节点,每个子节点都有自己的
describe-metadata-model-children用于深入浏览SelectionRules - — 返回特定对象的名称、类型和SQL定义
describe-metadata-model
两者都需要或,并且仅接受选择规则。
--origin SOURCE--origin TARGETexplicit-
显示树根: 调用,使用针对根级别的选择规则并指定
describe-metadata-model-children。如果树为空,自动运行元数据导入(与自动导入相同),然后重新显示树根。--origin SOURCE -
导航: 响应中的每个子节点都有和
MetadataModelName。展示子节点并询问客户想要执行的操作:SelectionRules- 显示子节点 — 使用子节点的作为
SelectionRules参数调用--selection-rules,深入浏览子节点describe-metadata-model-children - 显示定义 — 显示所选对象的DDL(见步骤3)。仅适用于对象,不适用于类别。
- 返回上级 — 返回父节点
- 退出树浏览 — 返回操作菜单
- 显示子节点 — 使用子节点的
-
显示定义: 使用子节点的和
SelectionRules调用--origin SOURCE。响应包含describe-metadata-model(源DDL)和Definition(包含各自TargetMetadataModels的转换对应项列表)。要获取目标DDL,使用SelectionRules中的TargetMetadataModels[0]并指定SelectionRules再次调用--origin TARGET。将两者分别标记为SOURCE和TARGET清晰展示。describe-metadata-model -
从数据库刷新: 如果客户要求刷新,使用限定到当前树位置的选择规则、运行
--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.
-
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. Useto 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.
describe-metadata-model-children -
Get the SQL statement: Ask the customer for the SQL statement they want to convert.
-
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.
-
Create metadata model: Generate a unique model name (e.g.,). Call
statement-<timestamp>with:start-metadata-model-creation- — the schema selection rules from step 3
--selection-rules - — the generated model name
--metadata-model-name --properties '{"StatementProperties": {"Definition": "<sql_statement>"}}'
Wait via.aws dms wait metadata-model-created -
Build selection rules for the statement: Build selection rules targeting the specific statement. See Selection rules in DMS Schema Conversion — useset to the model name.
statement-name -
Convert the created model: Callwith the statement selection rules from step 5. Wait via
start-metadata-model-conversion.aws dms wait metadata-model-converted -
Show converted result: Callwith the statement selection rules from step 5 and
describe-metadata-model. From the response, extract--origin SOURCE. Then callTargetMetadataModels[0].SelectionRuleswith those target selection rules anddescribe-metadata-model. Present the converted SQL from the--origin TARGETfield clearly to the customer.Definition -
Export conversion assessment report: Callwith the source selection rules from step 5. Provide the customer with S3 links for PDF and CSV reports.
export-metadata-model-assessment
After completing, ask the customer what they'd like to do next.
限制: 此功能仅适用于SQL Server → PostgreSQL/Aurora PostgreSQL迁移项目。不要为任何其他源/目标引擎组合提供或显示此选项。
-
确定上下文: 浏览元数据树找到目标位置。对于SQL Server,位置是服务器→数据库→架构;对于其他引擎,是服务器→架构。使用深入节点直到到达架构级别。让客户选择架构(对于SQL Server是数据库+架构)。如果树为空,询问客户手动提供位置。
describe-metadata-model-children -
获取SQL语句: 询问客户想要转换的SQL语句。
-
构建架构选择规则: 构建针对架构位置的选择规则。有关格式和特定于厂商的定位符,请参阅DMS Schema转换中的选择规则。
-
创建元数据模型: 生成唯一的模型名称(例如)。调用
statement-<timestamp>并指定:start-metadata-model-creation- — 步骤3中的架构选择规则
--selection-rules - — 生成的模型名称
--metadata-model-name --properties '{"StatementProperties": {"Definition": "<sql_statement>"}}'
通过等待。aws dms wait metadata-model-created -
构建语句选择规则: 构建针对特定语句的选择规则。有关详细信息,请参阅DMS Schema转换中的选择规则 — 使用设置为模型名称。
statement-name -
转换创建的模型: 使用步骤5中的语句选择规则调用。通过
start-metadata-model-conversion等待。aws dms wait metadata-model-converted -
显示转换结果: 使用步骤5中的语句选择规则和调用
--origin SOURCE。从响应中提取describe-metadata-model。然后使用这些目标选择规则并指定TargetMetadataModels[0].SelectionRules调用--origin TARGET。将describe-metadata-model字段中的转换后SQL清晰展示给客户。Definition -
导出转换评估报告: 使用步骤5中的源选择规则调用。为客户提供PDF和CSV报告的S3链接。
export-metadata-model-assessment
完成后,询问客户接下来想要执行什么操作。
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.
-
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.
% -
Run assessment: Callwith the migration project and selection rules. See schema-conversion-operations.md for execution details.
start-metadata-model-assessment -
Wait for completion using the DMS waiter or fallback polling as described in schema-conversion-operations.md.
-
Export conversion assessment report: Callwith the same selection rules.
export-metadata-model-assessment -
Download and present only what the customer asked for: Download the Summary CSV from S3:
aws s3 cp s3://<bucket>/<CsvReport.S3ObjectKey> ./Summary.csvThe 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
-
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.
当客户询问源数据库统计信息(例如对象数量、对象类型、架构大小或总体概述)时,运行评估并将结果作为简洁摘要展示。
-
构建选择规则 根据客户指定的范围。如果客户指定了特定架构或对象,则相应限定范围。如果未指定范围,默认使用源服务器上的所有架构(通配符)。有关JSON格式,请参阅DMS Schema转换中的选择规则。
% -
运行评估: 使用迁移项目和选择规则调用。有关执行细节,请参阅schema-conversion-operations.md。
start-metadata-model-assessment -
等待完成 使用DMS等待器或按照schema-conversion-operations.md中描述的回退轮询方式等待。
-
导出转换评估报告: 使用相同的选择规则调用。
export-metadata-model-assessment -
下载并仅展示客户请求的内容: 从S3下载摘要CSV:
aws s3 cp s3://<bucket>/<CsvReport.S3ObjectKey> ./Summary.csv报告包含许多数据点。仅展示客户请求的信息——不要输出整个报告。例如:- 如果客户询问“有多少张表?” → 仅展示表的数量
- 如果客户询问特定架构 → 仅展示该架构的统计信息
-
提供下一步选项: 询问客户是否想要查看转换复杂度或继续执行转换。
约束:
- 如果客户指定了范围,请使用该范围。如果未指定,默认使用所有架构。
- 仅展示客户请求的内容——不要用未请求的数据淹没客户。
- 以清晰的表格格式展示统计信息。
完成后,询问客户接下来想要执行什么操作。
Clean Up
清理
Delete the migration project and its associated DMS resources. Resources MUST be deleted in dependency order.
-
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. -
Delete migration project:
aws dms delete-migration-project \ --migration-project-identifier <migration_project_identifier> -
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> -
Delete instance profile:
aws dms delete-instance-profile \ --instance-profile-identifier <instance_profile_identifier> -
Delete subnet group:
aws dms delete-replication-subnet-group \ --replication-subnet-group-identifier <subnet_group_identifier> -
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资源。必须按依赖顺序删除资源。
-
获得客户确认: 列出将被删除的资源并请求确认:
aws dms describe-migration-projects --filter Name=migration-project-identifier,Values=<migration_project_identifier>展示项目名称、源/目标数据提供程序和实例配置文件。 -
删除迁移项目:
aws dms delete-migration-project \ --migration-project-identifier <migration_project_identifier> -
删除数据提供程序: 删除源和目标数据提供程序:
aws dms delete-data-provider \ --data-provider-identifier <source_data_provider_identifier> aws dms delete-data-provider \ --data-provider-identifier <target_data_provider_identifier> -
删除实例配置文件:
aws dms delete-instance-profile \ --instance-profile-identifier <instance_profile_identifier> -
删除子网组:
aws dms delete-replication-subnet-group \ --replication-subnet-group-identifier <subnet_group_identifier> -
确认完成: 告知客户所有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并遵循其指导诊断和解决问题。用通俗易懂的语言向客户解释错误,并提供选项:重试、尝试其他操作或退出。