有关使用 Azure 数据库迁移服务的常见问题解答FAQ about using Azure Database Migration Service

本文列出了有关使用 Azure 数据库迁移服务的常见问题和相关解答。This article lists commonly asked questions about using Azure Database Migration Service together with related answers.

概述Overview

问:什么是 Azure 数据库迁移服务?Q. What is Azure Database Migration Service? Azure 数据库迁移服务是一项完全托管的服务,旨在实现从多个数据库源到 Azure 数据平台的无缝迁移,并且最小化停机时间。Azure Database Migration Service is a fully managed service designed to enable seamless migrations from multiple database sources to Azure Data platforms with minimal downtime. 该服务目前已正式发布,目前正在进行的开发工作重点是:The service is currently in General Availability, with ongoing development efforts focused on:

  • 可靠性和性能。Reliability and performance.
  • 源目标对的迭代添加。Iterative addition of source-target pairs.
  • 无摩擦迁移中的持续投资。Continued investment in friction-free migrations.

问:Azure 数据库迁移服务目前支持哪些源-目标对?Q. What source/target pairs does Azure Database Migration Service currently support? 该服务目前支持各种源/目标对或迁移方案。The service currently supports a variety of source/target pairs, or migration scenarios. 有关每个可用迁移方案的状态的完整列表,请参阅文章 Azure 数据库迁移服务支持的迁移方案的状态For a complete listing of the status of each available migration scenario, see the article Status of migration scenarios supported by the Azure Database Migration Service.

其他迁移方案处于预览状态,需要通过 DMS 预览站点提交提名。Other migration scenarios are in preview and require submitting a nomination via the DMS Preview site. 有关预览版中的方案的完整列表以及如何注册以参与其中一个产品/服务,请参阅 DMS 预览站点For a complete listing of the scenarios in preview and to sign up to participate in one of these offerings, see the DMS Preview site.

问:Azure 数据库迁移服务支持将什么版本的 SQL Server 用作源?Q. What versions of SQL Server does Azure Database Migration Service support as a source? 从 SQL Server 迁移时,Azure 数据库迁移服务支持的源为 SQL Server 2005 至 SQL Server 2019。When migrating from SQL Server, supported sources for Azure Database Migration Service are SQL Server 2005 through SQL Server 2019.

问:使用 Azure 数据库迁移服务时,脱机迁移与联机迁移的区别是什么?Q: When using Azure Database Migration Service, what’s the difference between an offline and an online migration? 可以使用 Azure 数据库迁移服务执行脱机和联机迁移。You can use Azure Database Migration Service to perform offline and online migrations. 使用脱机迁移时,应用程序停机时间从迁移开始时算起。**With an offline migration, application downtime starts when the migration starts. 使用联机迁移时,停机时间仅限在迁移结束时进行转换的那段时间。**With an online migration, downtime is limited to the time to cut over at the end of migration. 建议对脱机迁移进行测试,以便确定其停机时间是否可以接受;如果不能接受,请进行联机迁移。We suggest that you test an offline migration to determine whether the downtime is acceptable; if not, do an online migration.

Note

使用 Azure 数据库迁移服务执行联机迁移需要基于“高级”定价层创建实例。Using Azure Database Migration Service to perform an online migration requires creating an instance based on the Premium pricing tier. 有关详细信息,请参阅 Azure 数据库迁移服务定价页。For more information, see the Azure Database Migration Service pricing page.

问:Azure 数据库迁移服务与其他 Microsoft 数据库迁移工具(例如数据库迁移助手 (DMA) 或 SQL Server 迁移助手 (SSMA))有何差别?Q. How does Azure Database Migration Service compare to other Microsoft database migration tools such as the Database Migration Assistant (DMA) or SQL Server Migration Assistant (SSMA)? Azure 数据库迁移服务是将数据库大规模迁移到 Azure 的首选方法。Azure Database Migration Service is the preferred method for database migration to Azure at scale. 有关 Azure 数据库迁移服务与其他 Microsoft 数据库迁移工具的差别,以及对各种方案使用不同服务的建议,请参阅博客文章 Differentiating Microsoft’s Database Migration Tools and Services(Microsoft 数据库迁移工具和服务的差别)。For more detail on how Azure Database Migration Service compares to other Microsoft database migration tools and for recommendations on using the service for various scenarios, see the blog posting Differentiating Microsoft’s Database Migration Tools and Services.

问:Azure 数据库迁移服务与 Azure 迁移产品/服务有何差别?Q. How does Azure Database Migration Service compare to the Azure Migrate offering? Azure 迁移服务可以帮助将本地虚拟机迁移到 Azure IaaS。Azure Migrate assists with migration of on-premises virtual machines to Azure IaaS. 该服务会评估是否适合迁移以及需要根据性能进行哪些大小调整,并提供在 Azure 中运行本地虚拟机的成本估算。The service assesses migration suitability and performance-based sizing, and it provides cost estimates for running your on-premises virtual machines in Azure. Azure Migrate 适合用于将基于本地 VM 的工作负荷直接迁移到 Azure IaaS VM。Azure Migrate is useful for lift-and-shift migrations of on-premises VM-based workloads to Azure IaaS VMs. 但是,与 Azure 数据库迁移服务不同,Azure Migrate 不是适用于 Azure SQL 数据库或 Azure SQL 托管实例等 Azure PaaS 关系数据库平台的专用数据库迁移服务产品。However, unlike Azure Database Migration Service, Azure Migrate isn’t a specialized database migration service offering for Azure PaaS relational database platforms such as Azure SQL Database or Azure SQL Managed Instance.

设置Setup

问:使用 Azure 数据库迁移服务的先决条件是什么?Q. What are the prerequisites for using Azure Database Migration Service? 若要确保 Azure 数据库迁移服务在执行数据库迁移时顺利运行,需要满足几个先决条件。There are several prerequisites required to ensure that Azure Database Migration Service runs smoothly when performing database migrations. 某些先决条件适用于该服务支持的所有方案(源/目标对),而其他先决条件则是特定方案所特有的。Some of the prerequisites apply across all scenarios (source-target pairs) supported by the service, while other prerequisites are unique to a specific scenario.

在所有支持的迁移方案中通用的 Azure 数据库迁移服务先决条件包括需要:Azure Database Migration Service prerequisites that are common across all supported migration scenarios include the need to:

  • 使用 Azure 资源管理器部署模型创建 Azure 数据库迁移服务的 Azure 虚拟网络,它将使用 ExpressRouteVPN 为本地源服务器提供站点到站点连接。Create a Azure Virtual Network for Azure Database Migration Service by using the Azure Resource Manager deployment model, which provides site-to-site connectivity to your on-premises source servers by using either ExpressRoute or VPN.
  • 确保虚拟网络的网络安全组规则未阻止以下通信端口:443、53、9354、445、12000。Ensure that your virtual network Network Security Group rules don't block the following communication ports 443, 53, 9354, 445, 12000. 有关虚拟网络 NSG 流量筛选的更多详细信息,请参阅使用网络安全组筛选网络流量一文。For more detail on virtual network NSG traffic filtering, see the article Filter network traffic with network security groups.
  • 在源数据库的前面使用了防火墙设备时,可能需要添加防火墙规则以允许 Azure 数据库迁移服务访问要迁移的源数据库。When using a firewall appliance in front of your source database(s), you may need to add firewall rules to allow Azure Database Migration Service to access the source database(s) for migration.

有关使用 Azure 数据库迁移服务完成特定迁移方案所要满足的所有先决条件列表,请参阅 docs.azure.cn 上的 Azure 数据库迁移服务文档中的相关教程。For a list of all the prerequisites required to compete specific migration scenarios using Azure Database Migration Service, see the related tutorials in the Azure Database Migration Service documentation on docs.azure.cn.

问:如何查找 Azure 数据库迁移服务的 IP 地址,以便可以创建防火墙规则的允许列表用于访问要迁移的源数据库?Q. How do I find the IP address for Azure Database Migration Service so that I can create an allow list for the firewall rules used to access my source database for migration? 可能需要添加防火墙规则,以允许 Azure 数据库迁移服务访问要迁移的源数据库。You may need to add firewall rules allowing Azure Database Migration Service to access to your source database for migration. 该服务的 IP 地址是动态的,但如果你使用 ExpressRoute,则企业网络会专门分配此地址。The IP address for the service is dynamic, but if you're using ExpressRoute, this address is privately assigned by your corporate network. 标识相应 IP 地址的最简单方法是查看预配的 Azure 数据库迁移服务资源所在的同一个资源组,找到关联的网络接口。The easiest way to identify the appropriate IP address is to look in the same resource group as your provisioned Azure Database Migration Service resource to find the associated Network Interface. 通常,网络接口资源的名称以 NIC 前缀开头,后接唯一的字符和序号,例如 NIC-jj6tnztnmarpsskr82rbndyp。Usually the name of the Network Interface resource begins with the NIC prefix and followed by a unique character and number sequence, for example NIC-jj6tnztnmarpsskr82rbndyp. 选择此网络接口资源后,可以看到需要包含在 Azure 门户资源概述页上的允许列表中的 IP 地址。By selecting this network interface resource, you can see the IP address that needs to be included in the allow list on the resource overview Azure portal page.

可能还需要在允许列表中包含 SQL Server 侦听的端口源。You may also need to include the port source that SQL Server is listening on the allow list. 默认情况下为端口 1433,但源 SQL Server 可能也配置为侦听其他端口。By default, it's port 1433, but the source SQL Server may be configured to listen on other ports as well. 在这种情况下,也需要在允许列表中包含这些端口。In this case, you need to include those ports on the allow list as well. 可以使用动态管理视图查询来确定 SQL Server 侦听的端口:You can determine the port that SQL Server is listening on by using a Dynamic Management View query:

    SELECT DISTINCT
        local_tcp_port
    FROM sys.dm_exec_connections
    WHERE local_tcp_port IS NOT NULL

也可以通过查询 SQL Server 错误日志来确定 SQL Server 侦听的端口:You can also determine the port that SQL Server is listening by querying the SQL Server error log:

    USE master
    GO
    xp_readerrorlog 0, 1, N'Server is listening on'
    GO

问:如何设置 Azure 虚拟网络?Q. How do I set up an Azure Virtual Network? 虽然有多篇 Azure 教程可以指导你完成设置虚拟网络的过程,但官方文档出现在 Azure 虚拟网络一文中。While multiple Azure tutorials that can walk you through the process of setting up a virtual network, the official documentation appears in the article Azure Virtual Network.

使用情况Usage

问:使用 Azure 数据库迁移服务执行数据库迁移所要执行的步骤摘要是什么?Q. What is a summary of the steps required to use Azure Database Migration Service to perform a database migration? 在典型的简单数据库迁移过程中,需要:During a typical, simple database migration, you:

  1. 创建目标数据库。Create a target database(s).
  2. 评估源数据库。Assess your source database(s).
    • 对于同构迁移,使用 DMA 评估现有数据库。For homogenous migrations, assess your existing database(s) by using DMA.
    • 对于异构迁移(从竞争源进行),使用 SSMA 评估现有数据库。For heterogeneous migrations (from compete sources), assess your existing database(s) with SSMA. 还可以使用 SSMA 来转换数据库对象,以及将架构迁移到目标平台。You also use SSMA to convert database objects and migrate the schema to your target platform.
  3. 创建 Azure 数据库迁移服务的实例。Create an instance of Azure Database Migration Service.
  4. 创建迁移项目,用于指定源数据库、目标数据库和要迁移的表。Create a migration project specifying the source database(s), target database(s), and the tables to migrate.
  5. 启动完全加载。Start the full load.
  6. 选择后续验证。Pick the subsequent validation.
  7. 执行从生产环境到新的基于云的数据库的手动切换。Perform a manual switchover of your production environment to the new cloud-based database.

故障排除和优化Troubleshooting and optimization

问:我正在 DMS 中设置一个迁移项目,在连接到源数据库时遇到问题。Q. I’m setting up a migration project in DMS, and I’m having difficulty connecting to my source database. What should I do? 如果在迁移过程中连接到源数据库系统时遇到问题,请在虚拟网络中创建一个虚拟机,通过其设置 DMS 实例。If you have trouble connecting to your source database system while working on migration, create a virtual machine in the virtual network with which you set up your DMS instance. 在该虚拟机中,应该能够运行连接测试,例如,使用 UDL 文件测试连接到 SQL Server,或下载 Robo 3T 以测试 MongoDB 连接。In the virtual machine, you should be able to run a connect test, such as using a UDL file to test a connection to SQL Server or downloading Robo 3T to test MongoDB connections. 如果连接测试成功,则在连接到源数据库时应该不会遇到问题。If the connection test succeeds, you shouldn't have an issue with connecting to your source database. 如果连接测试失败,请与网络管理员联系。If the connection test doesn't succeed, contact your network administrator.

问:为什么 Azure 数据库迁移服务不可用或已停止?Q. Why is my Azure Database Migration Service unavailable or stopped? 如果用户显式停止 Azure 数据库迁移服务 (DMS),或者如果服务处于非活动状态已有 24 小时,则服务将处于已停止或自动暂停状态。If the user explicitly stops Azure Database Migration Service (DMS) or if the service is inactive for a period of 24 hours, the service will be in a stopped or auto paused state. 在上述每种情况下,服务将不可用并处于已停止状态。In each case, the service will be unavailable and in a stopped status. 若要恢复活动迁移,请重启该服务。To resume active migrations, restart the service.

问:在优化 Azure 数据库迁移服务的性能方面,你们是否提供任何建议?Q. Are there any recommendations for optimizing the performance of Azure Database Migration Service? 可以采取几项措施来加快使用该服务迁移数据库的速度:You can do a few things to speed up your database migration using the service:

  • 创建服务实例时使用多 CPU 常规用途定价层,使该服务可以利用多个 vCPU 来实现行化和加速数据传输。Use the multi CPU General Purpose Pricing Tier when you create your service instance to allow the service to take advantage of multiple vCPUs for parallelization and faster data transfer.
  • 在数据迁移操作期间,暂时将 Azure SQL 数据库目标实例纵向扩展到高级层 SKU,以尽量减少遇到使用较低级 SKU 时出现的 Azure SQL 数据库限制,从而避免对数据传输活动造成影响。Temporarily scale up your Azure SQL Database target instance to the Premium tier SKU during the data migration operation to minimize Azure SQL Database throttling that may impact data transfer activities when using lower-level SKUs.

后续步骤Next steps

有关 Azure 数据库迁移服务和区域可用性的概述,请参阅什么是 Azure 数据库迁移服务一文。For an overview of the Azure Database Migration Service and regional availability, see the article What is the Azure Database Migration Service.