你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

已知问题、限制和故障排除

本文提供了与 Azure Data Studio 的 Azure SQL 迁移扩展关联的已知问题和故障排除步骤的列表。

重要说明

最新版本的 Integration Runtime (5.28.8488) 阻止访问本地主机上的网络文件共享。 使用 DMS 执行到 Azure SQL 的迁移时,此安全措施会导致失败。 请确保在与网络共享主机不同的计算机上运行集成运行时。

错误代码:2007 - CutoverFailedOrCancelled

  • 消息Cutover failed or cancelled for database <DatabaseName>. Error details: The restore plan is broken because firstLsn <First LSN> of log backup <URL of backup in Azure Storage container>' is not <= lastLsn <last LSN> of Full backup <URL of backup in Azure Storage container>'. Restore to point in time.

  • 原因:由于备份错误地放置在 Azure 存储容器中,因此可能出现此错误。 如果备份放置在网络文件共享中,也可能由于网络连接问题而发生此错误。

  • 建议:确保 Azure 存储容器中的数据库备份正确无误。 如果使用网络文件共享,则网络问题或延迟可能会导致此错误。 等待过程完成。

  • 消息Cutover failed or cancelled for database '{databaseName}'. Error details: 'errorCode: Ext_RestoreSettingsError, message: RestoreId: {RestoreId}, OperationId: {operationId}, Detail: Failed to complete restore., RestoreJobState: Restoring, CompleteRestoreErrorMessage: The database contains incompatible physical layout. Too many full text catalog files.

  • 原因:Azure VM 上的 SQL Server 当前不支持使用全文目录文件还原数据库。

  • 建议:在创建还原时从数据库中删除全文目录文件。

  • 消息Cutover failed or cancelled for database '{databaseName}'. Error details: 'Migration cannot be completed because provided backup file name '{providedFileName}' should be the last restore backup file '{lastRestoredFileName}'.'

  • 原因:此错误是由于 Azure SQL 托管实例中的已知限制导致的。 这意味着 {providedFileName}{lastRestoredFileName} 不相同。 SQL 托管实例根据 LSN 序列自动还原容器中的所有有效备份文件。 典型的失败情况可能是: {providedFileName}log1,但容器中的文件具有其他文件,例如 log2,其 LSN 数大于 log1。 在这种情况下,SQL 托管实例会自动还原容器中的所有文件。 完成迁移后,SQL 托管实例将报告此错误消息。

  • 建议:对于脱机迁移模式,请提供与最大 LSN 相对应的“lastBackupName”。 对于联机迁移方案,如果迁移状态成功,则可以忽略此警告/错误。

错误代码:2009 - MigrationRestoreFailed

  • 消息Migration for Database 'DatabaseName' failed with error cannot find server certificate with thumbprint.

  • 原因:在迁移数据之前,需要将源 SQL Server 实例的证书从受透明数据加密(TDE)保护的数据库迁移到 Azure 虚拟机上的目标 Azure SQL 托管实例或 SQL Server。

  • 建议:将 TDE 证书迁移到目标实例,然后重试该过程。 有关迁移已启用 TDE 的数据库的详细信息,请参阅教程:在 Azure Data Studio 中,将已启用 TDE 的数据库(预览版)迁移到 Azure SQL

  • 消息Migration for Database <DatabaseName> failed with error 'Non retriable error occurred while restoring backup with index 1 - 3169'. The database was backed up on a server running version %ls. That version is incompatible with this server, which is running version %ls. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server.

  • 原因:无法将 SQL Server 备份还原到创建备份时的 SQL Server 版本之前的版本。

  • 建议:有关故障排除步骤,请参阅影响不同 SQL Server 版本之间的数据库还原的问题

  • 消息Migration for Database <DatabaseName> failed with error 'The managed instance has reached its storage limit. The storage usage for the managed instance can't exceed 32768 MBs.'

  • 原因:Azure SQL 托管实例已达到其资源限制。

  • 建议:有关存储限制的详细信息,请参阅 Azure SQL 托管实例资源限制概述

  • 消息Migration for Database <DatabaseName> failed with error 'Non retriable error occurred while restoring backup with index 1 - 3634' The operating system returned the error '1450(Insufficient system resources exist to complete the requested service.)'

  • 原因:DBCC CHECKDB 或数据库快照创建期间,对数据库文件报告了 OS 错误 1450 和 665 中列出的症状之一。

  • 建议:请参阅 DBCC CHECKDB 或数据库快照创建期间,对数据库文件报告了 OS 错误 1450 和 665 以了解故障排除步骤。

  • 消息The restore plan is broken because firstLsn <First LSN> of log backup <URL of backup in Azure Storage container>' isn't <= lastLsn <last LSN> of Full backup <URL of backup in Azure Storage container>'. Restore to point in time.

  • 原因:由于备份错误地放置在 Azure 存储容器中,因此可能出现此错误。 如果备份放置在网络文件共享中,也可能由于网络连接问题而发生此错误。

  • 建议:确保 Azure 存储容器中的数据库备份正确。 如果使用网络文件共享,则网络问题或延迟可能会导致此错误。 等待过程完成。

  • 消息Migration for Database <Database Name> failed with error 'Non retriable error occurred while restoring backup with index 1 - 3234' Logical file <Name> isn't part of database <Database GUID>. Use RESTORE FILELISTONLY to list the logical file names. RESTORE DATABASE is terminating abnormally.

  • 原因:指定了不在数据库备份中的逻辑文件名。 此错误的另一个可能原因是存储帐户容器名称不正确。

  • 建议:运行 RESTORE FILELISTONLY 以检查备份中的逻辑文件名。 有关 RESTORE FILELISTONLY 的详细信息,请参阅 RESTORE 语句 - FILELISTONLY (Transact-SQL)

  • 消息Migration for Database <Database Name> failed with error 'Azure SQL target resource failed to connect to storage account. Make sure the target SQL VNet is allowed under the Azure Storage firewall rules.'

  • 原因:Azure 存储防火墙未配置为允许访问 Azure SQL 目标。

  • 建议:请参阅配置 Azure 存储防火墙和虚拟网络以了解有关 Azure 存储防火墙设置的详细信息。

  • 消息Migration for Database <Database Name> failed with error 'There are backups from multiple databases in the container folder'. Please make sure the container folder has backups from a single database.

  • 原因:多个数据库的备份位于同一容器文件夹中。

  • 建议:如果使用同一 Azure Blob 存储容器将多个数据库迁移到 Azure SQL 托管实例,则必须将不同数据库的备份文件放入该容器内的单独文件夹中。 有关 LRS 的详细信息,请参阅使用日志重播服务(预览版)将数据库从 SQL Server 迁移到 SQL 托管实例

  • 消息Migration for Database <Database Name> failed with error 'Non retriable error occurred while restoring backup with index 1 - 12824' The sp_configure value 'contained database authentication' must be set to 1 in order to restore a contained database. You may need to use RECONFIGURE to set the value_in_use. RESTORE DATABASE is terminating abnormally.

  • 原因:源数据库是包含的数据库。 需要使用特定配置才能启用还原包含的数据库。 有关包含的数据库的详细信息,请参阅包含的数据库用户

  • 建议:在开始迁移之前,请在特定数据库的上下文中运行连接到源 SQL Server 的以下查询。 然后,再次尝试迁移包含的数据库。

    -- Enable "contained database authentication"
    EXECUTE sp_configure 'contained', 1;
    
    RECONFIGURE;
    
  • 消息Migration for Database <Database Name> failed with error 'Managed identity is not set up properly'. Please verify and try again.'

  • 原因:与目标 SQL 托管实例关联的托管标识没有所需的权限/角色来访问包含迁移所需的备份文件的 Azure Blob 存储。

  • 建议:将 Azure Blob 存储帐户上的“存储 Blob 数据读取者”角色分配给与目标 SQL 托管实例关联的托管标识。 有关详细信息,请参阅 博客

    注意

    有关 Azure SQL 托管实例错误的常规故障排除步骤的详细信息,请参阅 Azure SQL 托管实例的已知问题

错误代码:2012 - TestConnectionFailed

  • 消息Failed to test connections using provided Integration Runtime. Error details: 'Remote name could not be resolved.'

  • 原因:防火墙中的网络设置导致自承载集成运行时无法连接到服务后端。

  • 建议:存在域名系统 (DNS) 问题。 请联系你的网络团队来修复此问题。 有关详细信息,请参阅排查自承载集成运行时问题

  • 消息Failed to test connections using provided Integration Runtime. 'Cannot connect to <File share>. Detail Message: The system could not find the environment option that was entered

  • 原因:自承载集成运行时无法连接到放置数据库备份的网络文件共享。

  • 建议:确保正确输入网络文件共享名称。

  • 消息Failed to test connections using provided Integration Runtime. The file name does not conform to the naming rules by the data store. Illegal characters in path.

  • 原因:自承载集成运行时无法连接到放置数据库备份的网络文件共享。

  • 建议:确保正确输入网络文件共享名称。

  • 消息Failed to test connections using provided Integration Runtime.

  • 原因:与自承载集成运行时的连接失败。

  • 建议:对于集成运行时连接错误的一般故障排除步骤,请参阅 自承载集成运行时的故障排除

错误代码:2014 - IntegrationRuntimeIsNotOnline

错误代码:2030 - AzureSQLManagedInstanceNotReady

  • 消息Azure SQL Managed Instance <Instance Name> isn't ready.

  • 原因:Azure SQL 托管实例未处于就绪状态。

  • 建议:等待 Azure SQL 托管实例部署并准备就绪,然后重试该过程。

错误代码:2033 - SqlDataCopyFailed

  • 消息Migration for Database <Database> failed in state <state>.

  • 原因:用于数据移动的 ADF 管道失败。

  • 建议:查看 MigrationStatusDetails 页以获取更详细的错误信息。

错误代码:2038 - MigrationCompletedDuringCancel

  • 消息Migration cannot be canceled as Migration was completed during the cancel process. Target server: <Target server> Target database: <Target database>.

  • 原因:收到取消请求,但在取消完成之前迁移已成功完成。

  • 建议:无需执行任何操作。 迁移成功。

错误代码:2039 - MigrationRetryNotAllowed

  • 消息Migration isn't in a retriable state. Migration must be in state WaitForRetry. Current state: <State>, Target server: <Target Server>, Target database: <Target database>.

  • 原因:收到重试请求时,迁移未处于允许重试的状态。

  • 建议:无需执行任何操作。 迁移正在进行或已完成。

错误代码:2040 - MigrationTimeoutWaitingForRetry

  • 消息Migration retry timeout limit of 8 hours reached. Target server: <Target Server>, Target database: <Target Database>.

  • 原因:迁移在失败但可检索的状态下空闲 8 小时,并且已被取消

  • 建议:无需执行任何操作;迁移已取消。

错误代码:2041 - DataCopyCompletedDuringCancel

  • 消息Data copy finished successfully before canceling completed. Target schema is in bad state. Target server: <Target Server>, Target database: <Target Database>.

  • 原因:已收到取消请求,并且数据复制已成功完成,但目标数据库架构未返回到其原始状态。

  • 建议:如果需要,可以将目标数据库返回到其原始状态,方法是运行第一个查询和所有返回的查询,然后运行第二个查询并执行相同的操作。

    SELECT [ROLLBACK]
    FROM [dbo].[__migration_status]
    WHERE STEP IN (3, 4, 6);
    
    SELECT [ROLLBACK]
    FROM [dbo].[__migration_status]
    WHERE STEP IN (5, 7, 8)
    ORDER BY STEP DESC;
    

错误代码:2042 - PreCopyStepsCompletedDuringCancel

  • 消息Pre Copy steps finished successfully before canceling completed. Target database Foreign keys and temporal tables have been altered. Schema migration may be required again for future migrations. Target server: <Target Server>, Target database: <Target Database>.

  • 原因:已收到取消请求,并且已成功完成目标数据库准备复制的步骤。 目标数据库架构尚未返回到其原始状态。

  • 建议:如果需要,可以将目标数据库返回到其原始状态,方法是运行以下查询和所有返回的查询。

    SELECT [ROLLBACK]
    FROM [dbo].[__migration_status]
    WHERE STEP IN (3, 4, 6);
    

错误代码:2043 - CreateContainerFailed

  • 消息Create container <ContainerName> failed with error Error calling the endpoint '<URL>'. Response status code: 'NA - Unknown'. More details: Exception message: 'NA - Unknown [ClientSideException] Invalid Url:<URL>.

  • 原因:某个根本性问题(例如网络连接问题、DNS 失败、服务器证书验证问题或超时)导致请求失败。

  • 建议:有关故障排除步骤,请参阅 Azure 数据工厂和 Synapse 管道故障排除

错误代码:2049 - FileShareTestConnectionFailed

  • 消息The value of the property '' is invalid: 'Access to <share path> is denied, resolved IP address is <IP address>, network type is OnPremise'.

  • 原因:存储数据库备份的网络共享与自承载集成运行时(SHIR)位于同一台计算机中。

  • 建议:最新版本的 Integration Runtime (5.28.8488) 会阻止访问本地主机上的网络文件共享。 确保在与网络共享托管不同的计算机上运行 Integration Runtime。 如果在当前迁移设置中无法在不同的机器上托管自承载集成运行时和网络共享,则可以使用 DisableLocalFolderPathValidation 选项来选择退出。

    注意

    有关详细信息,请参阅通过本地 PowerShell 设置现有的自承载 IR。 请慎重使用禁用选项,因为此操作安全性较低。

错误代码:2055-SqlInfoCollectionFailed

  • 消息A database operation failed with the following error: 'VIEW SERVER PERFORMANCE STATE permission was denied on object 'server', database 'master'. The user does not have permission to perform this action.

  • 原因:用于目标服务器(Azure SQL 数据库)的登录名不具备 ##MS_ServerStateReader## 服务器角色。

  • 建议:为 Azure SQL 目标授予该登录名 ##MS_ServerStateReader## 角色。

    查询:

    ALTER SERVER ROLE ##MS_ServerStateReader## ADD MEMBER <login>.
    

注意

此查询应在数据库的上下文 master 中运行。

错误代码:2056 - SqlInfoValidationFailed

  • 消息CollationMismatch: Source database collation <CollationOptionSource> is not the same as the target database <CollationOptionTarget>. Source database: <SourceDatabaseName> Target database: <TargetDatabaseName>.

  • 原因:源数据库排序规则与目标数据库的排序规则不同。

  • 建议:将目标 Azure SQL 数据库排序规则更改为与源 SQL Server 数据库相同的排序规则。 默认情况下,Azure SQL 数据库使用 SQL_Latin1_General_CP1_CI_AS 排序规则,如果源 SQL Server 数据库使用不同的排序规则,则可能需要重新创建或选择排序规则匹配的其他目标数据库。 有关详细信息,请参阅排序规则和 Unicode 支持

  • 消息TableColumnCollationMismatch: Table <Tablename> with column <columnname> has collation <collationoptionsource> on source but has collation <collationoptiontarget> on target table.

  • 原因:源数据库表列排序规则与目标数据库表列的排序规则不同。

  • 建议

    1. 使用数据库迁移服务将架构迁移到目标 Azure SQL 数据库。 请参阅博客

    2. 按照此文章手动更改排序规则。

    有关详细信息,请参阅排序规则和 Unicode 支持

  • 消息DatabaseSizeMoreThanMax: No tables were found in the target Azure SQL Database. Check if schema migration was completed beforehand.

  • 原因:目标 Azure SQL 数据库中不存在适用于迁移的所选表。

  • 建议:在开始迁移之前,请确保已创建目标数据库架构。 有关如何部署目标数据库架构的详细信息,请参阅 SQL 数据库项目扩展

  • 消息DatabaseSizeMoreThanMax: The source database size <Source Database Size> exceeds the maximum allowed size of the target database <Target Database Size>. Check if the target database has enough space.

  • 原因:目标数据库没有足够的空间。

  • 建议:在开始迁移之前,请确保已创建目标数据库架构。 有关如何部署目标数据库架构的详细信息,请参阅 SQL 数据库项目扩展

  • 消息:NoTablesFound: Some of the source tables don't exist in the target database. Missing tables: <TableList>

  • 原因:目标 Azure SQL 数据库中不存在适用于迁移的所选表。

  • 建议:检查目标 Azure SQL 数据库中是否存在所选表。 如果从 PowerShell 脚本调用此迁移,请检查表列表参数是否包含正确的表名,以及该参数是否被传递到迁移中。

  • 消息:SqlVersionOutOfRange: Source instance version is lower than 2008, which is not supported to migrate. Source instance: <InstanceName>

  • 原因:Azure 数据库迁移服务不支持从低于 2008 的 SQL Server 实例迁移。

  • 建议:将源 SQL Server 实例升级到较新版本的 SQL Server。 有关详细信息,请参阅升级 SQL Server

  • 消息:TableMappingMismatch: Some of the source tables don't exist in the target database. Missing tables: <TableList>

  • 原因:目标 Azure SQL 数据库中不存在适用于迁移的所选表。

  • 建议:检查目标 Azure SQL 数据库中是否存在所选表。 如果从 PowerShell 脚本调用此迁移,请检查表列表参数是否包含正确的表名,以及该参数是否被传递到迁移中。

错误代码:2060 - SqlSchemaCopyFailed

  • 消息The SELECT permission was denied on the object 'sql_logins', database 'master', schema 'sys'.

  • 原因:客户用来连接 Azure SQL 数据库的帐户缺少访问 sys.sql_logins 表的权限。

  • 建议:可以通过两种方法缓解该问题:

    1. sysadmin 角色添加到授予管理员权限的帐户。

    2. 客户如果无法使用 sysadmin 帐户或无法授予该帐户 sysadmin 权限,则需要在源 SQL Server 上获得 db_owner 的最低权限。 在目标 Azure SQL 数据库上,创建用户,并向用户master授予 ##MS_DatabaseManager####MS_DatabaseConnector####MS_DefinitionReader####MS_LoginManager##固定服务器角色。 例如:

      -- Run the script in the master database
      CREATE LOGIN testuser WITH PASSWORD = '<password>';
      
      ALTER SERVER ROLE ##MS_DefinitionReader## ADD MEMBER [testuser];
      GO
      
      ALTER SERVER ROLE ##MS_DatabaseConnector## ADD MEMBER [testuser];
      GO
      
      ALTER SERVER ROLE ##MS_DatabaseManager## ADD MEMBER [testuser];
      GO
      
      ALTER SERVER ROLE ##MS_LoginManager## ADD MEMBER [testuser];
      GO
      
      CREATE USER testuser FOR LOGIN testuser;
      EXECUTE sp_addRoleMember 'dbmanager', 'testuser';
      EXECUTE sp_addRoleMember 'loginmanager', 'testuser';
      
  • 消息Failed to get service token from ADF service.

  • 原因:客户的 SHIR 无法连接数据工厂。

  • 建议:以下是如何解决它的示例文档:集成运行时无法连接到数据工厂

  • 消息IR Nodes are offline.

  • 原因:原因可能在于网络会在迁移期间中断,因此 IR 节点会脱机。 确保安装了 SHIR 的计算机已打开。

  • 建议:确保安装了 SHIR 的计算机处于打开状态。

  • 消息Deployed failure: {0}. Object element: {1}.

  • 原因:这是客户可能会遇到的最常见错误。 这意味着无法将对象部署到目标,因为它在目标上不受支持。

  • 建议:客户需要检查评估结果(评估规则)。 这是可能导致架构迁移失败的评估问题列表:

    注意

    要查看错误详细信息,请打开 Microsoft Integration Runtime 配置管理器,并导航到“诊断”>“日志记录”>“查看日志”。 在事件查看器中,导航到“应用程序和服务日志”>“连接器 - 集成运行时”,然后筛选错误。

  • 消息Deployed failure: Index cannot be created on computed column '{0}' of table '{1}' because the underlying object '{2}' has a different owner. Object element: {3}.

    示例生成的脚本:IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[Sales].[Customer]') AND name = N'AK_Customer_AccountNumber') CREATE UNIQUE NONCLUSTERED INDEX [AK_Customer_AccountNumber] ON [Sales].[Customer] ( [AccountNumber] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)

  • 原因:计算列中的所有函数引用必须具有与表相同的所有者。

  • 建议:请参阅所有权要求

错误代码:Ext_RestoreSettingsError

  • 消息Unable to read blobs in storage container, exception: The remote server returned an error: (403) Forbidden.; The remote server returned an error: (403) Forbidden

  • 原因:Azure SQL 目标无法连接到 Blob 存储。

  • 建议:确认目标网络设置允许访问 Blob 存储。 例如,如果要迁移到 Azure VM 目标上的 SQL Server,请确保不会阻止虚拟机上的出站连接。

  • 消息Failed to create restore job. Unable to read blobs in storage container, exception: The remote name could not be resolved.

  • 原因:Azure SQL 目标无法连接到 Blob 存储。

  • 建议:确认目标网络设置允许访问 Blob 存储。 例如,如果迁移到 SQL VM,请确保 VM 上的出站连接不会受到阻止。

  • 消息:Migration for Database <Database Name> failed with error 'Migration cannot be completed because provided backup file name <Backup File Name> should be the last restore backup file <Last Restore Backup File Name>'

  • 原因:备份设置中未指定最新的备份。

  • 建议:在备份设置中指定最新的备份文件名,然后重试该操作。

  • 消息Operation failed: errorCode: Ext_RestoreSettingsError, message: RestoreId: 1111111-aaaa-bbbb-cccc-dddddddd, OperationId: 2222222-aaaa-bbbb-cccc-dddddddd, Detail: Unable to read blobs in storage container, exception: Unable to connect to the remote server;Unable to connect to the remote server;A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 11.111.11.111:443.

  • 原因:具有公用网络和专用终结点配置的存储帐户都可能会出现此错误。 你还可以拥有一个控制混合网络路由和 DHCP 的本地 DNS 服务器。 除非允许使用 DNS 服务器中配置的 Azure IP 地址,否则 Azure VM 目标上的 SQL Server 不可能解析远程存储 Blob 终结点。

  • 建议:要调试此问题,可以尝试从 Azure VM 目标上的 SQL Server ping Azure Blob 存储 URL,并确认是否存在连接问题。 要解决此问题,必须允许在 DNS 服务器中配置的 Azure IP 地址。 有关详细信息,请参阅排查 Azure 专用终结点连接问题

错误代码:没有此类已知主机或 urlopen 错误 [Errno 11001] getaddrinfo 失败

  • 消息No such host is known

  • 原因:使用 PowerShell 命令 New-AzDataMigrationLoginsMigration 迁移登录名失败,并显示上面的消息。

  • 建议:若要解决此问题,请升级到 Az.DataMigration 低于 0.14.5 的更高版本。

    可以从 Az.DataMigration下载最新版本,也可以使用以下命令进行升级。

 Update-Module -Name Az.DataMigration
  • 消息urlopen error [Errno 11001] getaddrinfo failed

  • 原因:使用 Azure CLI az dataMigration login-migration 迁移登录名失败,并显示上面的消息。

  • 建议:要解决此问题,请将 Microsoft Azure CLI - 数据库迁移服务扩展 - az dataMigration 升级到 1.0.0b1 或更高版本。 运行以下命令进行升级。

 az extension update -n datamigration

错误代码:Blob 容器选择错误:列出容器内容时出错:此请求无权使用此权限执行此作。

  • 消息Blob container selection error: Error listing the contents of the container: This request is not authorized to perform this operation using this permission.

  • 原因:在使用托管标识通过 Azure 门户迁移到 SQL 托管实例时,如果登录的用户在存储帐户上没有存储 Blob 数据读取器访问权限,则会失败并显示上一条消息。

  • 建议:若要解决此问题,请确保已登录的用户对存储帐户具有 存储 Blob 数据读取器 访问权限。 在通过 Azure 门户进行迁移设置期间,需要此权限才能列出 Blob 容器中的文件夹和文件。 有关详细信息,请参阅 DMS - 对 Azure SQL 托管实例迁移的托管标识的支持

Azure 数据库迁移服务命名规则

如果您的 DMS 服务因 Error: Service name 'x_y_z' is not valid 发生故障,则需要遵循 Azure Database Migration Service 的命名规则。 由于 Azure 数据库迁移服务使用 Azure 数据工厂进行计算,因此遵循与命名规则中所述完全相同的命名规则。

Azure SQL 数据库限制

使用适用于 Azure Data Studio 的 Azure SQL 扩展迁移到 Azure SQL 数据库具有以下限制:

Azure SQL 数据库脱机迁移利用 Azure 数据工厂 (ADF) 管道进行数据移动,因此遵守 ADF 限制。 如果同时创建数据库迁移服务,则会创建相应的 ADF。 因此,工厂限制适用于每个服务。

  • 安装 SHIR 的计算机充当迁移的计算。 确保此计算机可以处理数据复制的 CPU 和内存负载。 有关详细信息,请参阅 SHIR 建议

  • 每个数据库限制为 100,000 个表。

  • 每个服务限制为 10,000 个并发数据库迁移。

  • 迁移速度在很大程度上取决于目标 Azure SQL 数据库 SKU 和自承载集成运行时主机。

  • 由于启动活动时的 ADF 开销,Azure SQL 数据库迁移对表编号的可伸缩性很差。 如果数据库包含数千个表,每个表的启动过程都可能需要几秒钟时间,即使这些表仅包含 1 位数据的一行。

  • 目前不支持对具有双字节字符的 Azure SQL 数据库表名进行迁移。 缓解措施是在迁移之前重命名表。 成功迁移后,可以将其重新更改为原始名称。

  • 由于超时,具有大型 Blob 列的表可能无法迁移。

  • 目前不支持保留了 SQL Server 的数据库名称。

  • 目前不支持包含分号的数据库名称。

  • 不会迁移计算列。

  • 源数据库中具有默认约束且包含 NULL 值的列使用目标 Azure SQL 数据库上定义的默认值进行迁移,而不是保留 NUL。

Azure SQL 托管实例限制

重要说明

使用 Azure SQL 扩展进行联机迁移时使用与日志重播服务 (LRS) 相同的技术,并具有相同的限制。 将数据库迁移到“业务关键”服务层级之前,请考虑这些限制,它们不适用于“常规用途”服务层级

使用 Azure Data Studio 的 Azure SQL 扩展迁移到 Azure SQL 托管实例具有以下限制:

  • 如果迁移单一数据库,必须将数据库备份放在数据库文件夹(包括容器根文件夹)内的平面文件结构中,并且无法嵌套文件夹。 不支持嵌套文件夹。

  • 如果使用同一 Azure Blob 存储容器迁移多个数据库,则必须将不同数据库的备份文件放入该容器内的单独文件夹中。

  • 不支持在目标 Azure SQL 托管实例中使用数据库迁移服务(DMS)覆盖现有数据库。

  • DMS 不支持在目标上配置高可用性和灾难恢复来匹配源拓扑。

  • 不支持下列服务器对象:

    • SQL Server 代理作业
    • 凭据
    • SQL Server Integration Services (SSIS)软件包
    • 服务器审核
  • 不能使用从 Azure 数据工厂创建的现有自承载集成运行时通过 DMS 进行数据库迁移。 自承载集成运行时最初在 Azure Data Studio 中使用 Azure SQL 迁移扩展创建,可以重复用于更多数据库迁移。

  • 单个日志重播服务 (LRS) 作业(由 DMS 创建)最多可以运行 30 天。 当此期限到期时,作业将自动取消,因此目标数据库会自动删除。

  • 如果收到以下错误:Memory-optimized filegroup must be empty in order to be restored on General Purpose tier of SQL Database Managed Instance,此问题是设计造成的。 Azure SQL 托管实例的“常规用途”层不支持 SQL Server In-Memory OLTP。 若要继续迁移,一种方法是升级到支持内存中 OLTP 的业务关键层。 另一种方法是确保源数据库在 Azure SQL 托管实例为常规用途时不使用 Hekaton。

Azure VM 上的 SQL Server 限制

使用 Azure Data Studio 的 Azure SQL 扩展迁移到 Azure VM 上的 SQL Server 具有以下限制:

  • 如果迁移单一数据库,必须将数据库备份放置在数据库文件夹(包括容器根文件夹)内的平面文件结构中,并且无法嵌套文件夹。 不支持嵌套文件夹。

  • 如果使用同一 Azure Blob 存储容器迁移多个数据库,则必须将不同数据库的备份文件放入该容器内的单独文件夹中。

  • Azure 数据库迁移服务不支持在目标 Azure 虚拟机上的 SQL Server 中使用数据库迁移服务 (DMS) 覆盖现有数据库。

  • DMS 不支持在目标上配置高可用性和灾难恢复以匹配源拓扑。

  • 不支持下列服务器对象:

    • SQL Server 代理作业
    • 凭据
    • SQL Server Integration Services (SSIS) 包
    • 服务器审核
  • 不能使用从 Azure 数据工厂创建的现有自承载集成运行时通过 DMS 进行数据库迁移。 最初,应在 Azure Data Studio 中使用 Azure SQL 迁移扩展创建自承载集成运行时,并可以重复使用这些扩展进行进一步的数据库迁移。

  • 迁移到 Azure 虚拟机上的 SQL Server 时,不支持将 SQL Server 2008 及更早版本作为目标版本的虚拟机 (VM)。

  • 如果将 VM 与 SQL Server 2012 或 SQL Server 2014 配合使用,则需要将源数据库备份文件存储在 Azure Blob 存储容器上,而不是使用网络共享选项。 将备份文件存储为页 blob,因为块 blob 仅在 SQL Server 2016 及更高版本中受支持。

  • 必须确保目标 Azure 虚拟机中的 SQL Server IaaS 代理扩展处于 完整模式 ,而不是轻型模式。

  • SQL Server IaaS 代理扩展仅支持管理默认服务器实例或单个命名实例。

  • 可以同时使用一个或多个迁移将最多 100 个数据库迁移到与目标相同的 Azure SQL Server 虚拟机。 此外,使用 100 个数据库的迁移完成后,必须等待至少 30 分钟,然后才能开始与目标相同的 Azure SQL Server VM 的新迁移。 而且,每个数据库的每项迁移操作(开始迁移、直接转换)都将依次花费几分钟时间。 例如,若要迁移 100 个数据库,创建迁移队列大约需要 200 (2 x 100) 分钟,大约需要 100 (1 x 100) 分钟才能跨所有 100 个数据库(不包括备份和还原计时)。 因此,随着数据库数量的增加,迁移速度会变慢。

    应根据严格的迁移测试提前计划更长的迁移窗口,或者在将大量数据库迁移到 SQL Server Azure VM 时将其分区成批。

  • 除了配置 Azure 存储帐户的网络/防火墙之外,还允许 VM 访问备份文件。 还需要在 Azure VM 上配置 SQL Server 的网络/防火墙,以允许与存储帐户建立出站连接。

  • 在 SQL 迁移过程中,需要为 Azure VM 上的目标 SQL Server 保持电源开启。 此外,创建新迁移时,请故障转移或取消迁移。

  • 错误Login failed for user 'NT Service\SQLIaaSExtensionQuery

    原因:SQL Server 实例处于单用户模式。 一个可能的原因是 Azure VM 上的目标 SQL Server 处于升级模式。

    解决方案:等待 Azure VM 上的目标 SQL Server 退出升级模式,然后重新开始迁移。

  • 错误Ext_RestoreSettingsError, message: Failed to create restore job.;Cannot create file 'F:\data\XXX.mdf' because it already exists

    解决方案:连接到 Azure VM 上的目标 SQL Server 并删除 XXX.mdf 文件。 然后,再次开始迁移。

Azure Data Studio 限制

未能启动 Sql 迁移服务:错误:请求错误

  • 消息Error at ClientRequest.<anonymous> (c:\Users\MyUser\.azuredatastudio\extensions\microsoft.sql-migration-1.4.2\dist\main.js:2:7448) at ClientRequest.emit (node:events:538:35) at TLSSocket.socketOnEnd (node:_http_client:466:9) at TLSSocket.emit (node:events:538:35) at endReadableNT (node:internal/streams/readable:1345:12) at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

  • 原因:当 Azure Data Studio 无法从 https://github.com/microsoft/sqltoolsservice/releases 中下载 MigrationService 包时,会出现此问题。 下载失败可能是由于网络工作断开或代理设置未解决。

  • 建议:解决此问题的可靠方法是手动下载包。 按照此链接中所述的缓解步骤操作:https://github.com/microsoft/azuredatastudio/issues/22558#issuecomment-1496307891