SQL Server 到 Azure SQL 托管实例迁移的评估规则Assessment rules for SQL Server to Azure SQL Managed Instance migration

适用于: Azure SQL 数据库

迁移工具通过运行大量评估规则来验证源 SQL Server 实例,以确定在将 SQL Server 数据库迁移到 Azure SQL 托管实例之前必须解决的问题。Migration tools validate your source SQL Server instance by running a number of assessment rules to identify issues that must be addressed before migrating your SQL Server database to Azure SQL Managed Instance.

本文列举了用于评估将 SQL Server 数据库迁移到 Azure SQL 托管实例的可行性的规则。This article provides a list of the rules used to assess the feasibility of migrating your SQL Server database to Azure SQL Managed Instance.

AnalysisCommand 作业AnalysisCommand job

标题:AnalysisCommand 作业步骤在 Azure SQL 托管实例中不受支持。 Title: AnalysisCommand job step is not supported in Azure SQL Managed Instance.
类别:警告Category: Warning

描述 Description
这是用于运行 Analysis Services 命令的作业步骤。It is a job step that runs an Analysis Services command. AnalysisCommand 作业步骤在 Azure SQL 托管实例中不受支持。AnalysisCommand job step is not supported in Azure SQL Managed Instance.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看所有使用 Analysis Services 命令作业步骤的作业,并评估是否可以删除作业步骤或受影响的对象。Review impacted objects section in Azure Migrate to see all jobs using Analysis Service Command job step and evaluate if the job step or the impacted object can be removed. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例中的 SQL Server 代理差异More information: SQL Server Agent differences in Azure SQL Managed Instance

AnalysisQuery 作业AnalysisQuery job

标题:AnalysisQuery 作业步骤在 Azure SQL 托管实例中不受支持。 Title: AnalysisQuery job step is not supported in Azure SQL Managed Instance.
类别:警告Category: Warning

描述 Description
这是用于运行 Analysis Services 查询的作业步骤。It is a job step that runs an Analysis Services query. AnalysisQuery 作业步骤在 Azure SQL 托管实例中不受支持。AnalysisQuery job step is not supported in Azure SQL Managed Instance.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看所有使用 Analysis Services 查询作业步骤的作业,并评估是否可以删除作业步骤或受影响的对象。Review impacted objects section in Azure Migrate to see all jobs using Analysis Service Query job step and evaluate if the job step or the impacted object can be removed. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例中的 SQL Server 代理差异More information: SQL Server Agent differences in Azure SQL Managed Instance

文件中的程序集Assembly from file

标题:带有文件参数的“CREATE ASSEMBLY”和“ALTER ASSEMBLY”在 Azure SQL 托管实例中不受支持。 Title: 'CREATE ASSEMBLY' and 'ALTER ASSEMBLY' with a file parameter are unsupported in Azure SQL Managed Instance.
类别:警告Category: Warning

描述 Description
Azure SQL 托管实例无法访问文件共享或 Windows 文件夹。Azure SQL Managed Instance cannot access file shares or Windows folders. 请查看“受影响的对象”部分,了解 BULK INSERT 语句的特定用法,这些语句不引用 Azure Blob。See the "Impacted Objects" section for the specific uses of BULK INSERT statements that do not reference an Azure blob. 如果源不是 Azure Blob 存储,则在迁移到 Azure SQL 托管实例后,使用“BULK INSERT”的对象将无法工作。Objects with 'BULK INSERT' where the source is not Azure blob storage will not work after migrating to Azure SQL Managed Instance.

建议 Recommendation
迁移到 Azure SQL 托管实例时,需要将 BULK INSERT 语句从使用本地文件或文件共享转换为使用 Azure Blob 存储中的文件。You will need to convert BULK INSERT statements that use local files or file shares to use files from Azure blob storage instead, when migrating to Azure SQL Managed Instance. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例中的 CLR 差异More information: CLR differences in Azure SQL Managed Instance

大容量插入Bulk insert

标题:使用非 Azure Blob 数据源的 BULK INSERT 在 Azure SQL 托管实例中不受支持。 Title: BULK INSERT with non-Azure blob data source is not supported in Azure SQL Managed Instance.
类别:问题Category: Issue

描述 Description
Azure SQL 托管实例无法访问文件共享或 Windows 文件夹。Azure SQL Managed Instance cannot access file shares or Windows folders. 请查看“受影响的对象”部分,了解 BULK INSERT 语句的特定用法,这些语句不引用 Azure Blob。See the "Impacted Objects" section for the specific uses of BULK INSERT statements that do not reference an Azure blob. 如果源不是 Azure Blob 存储,则在迁移到 Azure SQL 托管实例后,使用“BULK INSERT”的对象将无法工作。Objects with 'BULK INSERT' where the source is not Azure blob storage will not work after migrating to Azure SQL Managed Instance.

建议 Recommendation
迁移到 Azure SQL 托管实例时,需要将 BULK INSERT 语句从使用本地文件或文件共享转换为使用 Azure Blob 存储中的文件。You will need to convert BULK INSERT statements that use local files or file shares to use files from Azure blob storage instead, when migrating to Azure SQL Managed Instance.

详细信息:Azure SQL 托管实例中 Bulk Insert 与 OPENROWSET 之间的差异More information: Bulk Insert and OPENROWSET differences in Azure SQL Managed Instance

CLR 安全性CLR Security

标题:标记为 SAFE 或 EXTERNAL_ACCESS 的 CLR 程序集被认为 UNSAFE Title: CLR assemblies marked as SAFE or EXTERNAL_ACCESS are considered UNSAFE
类别:问题Category: Issue

描述 Description
Azure SQL 托管实例中强制实施 CLR 严格安全性模式。CLR Strict Security mode is enforced in Azure SQL Managed Instance. 此模式默认启用,并为包含用户定义的标记为 SAFE 或 EXTERNAL_ACCESS 的 CLR 程序集的数据库引入了中断性变更。This mode is enabled by default and introduces breaking changes for databases containing user-defined CLR assemblies marked either SAFE or EXTERNAL_ACCESS.

建议 Recommendation
CLR 在 .NET Framework 中使用代码访问安全性 (CAS)(不可再作为安全边界)。CLR uses Code Access Security (CAS) in the .NET Framework, which is no longer supported as a security boundary. 从 SQL Server 2017 (14.x) 数据库引擎开始,引入了称为 CLR 严格安全性的 sp_configure 选项,以增强 CLR 程序集的安全性。Beginning with SQL Server 2017 (14.x) database engine, an sp_configure option called clr strict security is introduced to enhance the security of CLR assemblies. 默认启用 CLR 严格安全性,并将 SAFE CLR 程序集和 EXTERNAL_ACCESS CLR 程序集与标记为 UNSAFE 的程序集同等对待。Clr strict security is enabled by default, and treats SAFE and EXTERNAL_ACCESS CLR assemblies as if they were marked UNSAFE. 禁用 CLR 严格安全性后,如果在创建 CLR 程序集时将 PERMISSION_SET 设置为 SAFE,则该程序集也许可以访问外部系统资源、调用非托管代码以及获取“sysadmin”特权。When clr strict security is disabled, a CLR assembly created with PERMISSION_SET = SAFE may be able to access external system resources, call unmanaged code, and acquire sysadmin privileges. 启用严格安全性后,未签名的任何程序集都将加载失败。After enabling strict security, any assemblies that are not signed will fail to load. 此外,如果数据库具有 SAFE 或 EXTERNAL_ACCESS 程序集,则 RESTORE 或 ATTACH DATABASE 语句可以完成,但程序集可能加载失败。Also, if a database has SAFE or EXTERNAL_ACCESS assemblies, RESTORE or ATTACH DATABASE statements can complete, but the assemblies may fail to load. 若要加载程序集,必须更改或删除每个程序集并重新创建,以便使用证书或非对称密钥对程序集进行签名,这样的证书或密钥具有与服务器上的 UNSAFE ASSEMBLY 权限相应的登录名。To load the assemblies, you must either alter or drop and recreate each assembly so that it is signed with a certificate or asymmetric key that has a corresponding login with the UNSAFE ASSEMBLY permission on the server.

详细信息:CLR 严格安全性More information: CLR strict security

COMPUTE 子句Compute clause

标题:COMPUTE 子句已弃用,并且已被删除。 Title: COMPUTE clause is discontinued and has been removed.
类别:警告Category: Warning

描述 Description
COMPUTE 子句生成的总计在结果集的末尾显示为附加的汇总列。The COMPUTE clause generates totals that appear as additional summary columns at the end of the result set. 但是,此子句在 Azure SQL 托管实例中不再受支持。However, this clause is no longer supported in Azure SQL Managed Instance.

建议 Recommendation
需要改用 ROLLUP 运算符来重新编写 T-SQL 模块。The T-SQL module needs to be rewritten using the ROLLUP operator instead. 下面的代码演示如何将 COMPUTE 替换为 ROLLUP:The code below demonstrates how COMPUTE can be replaced with ROLLUP:

USE AdventureWorks GO;  

SELECT SalesOrderID, UnitPrice, UnitPriceDiscount 
FROM Sales.SalesOrderDetail 
ORDER BY SalesOrderID COMPUTE SUM(UnitPrice), SUM(UnitPriceDiscount) 
BY SalesOrderID GO; 

SELECT SalesOrderID, UnitPrice, UnitPriceDiscount,SUM(UnitPrice) as UnitPrice , 
SUM(UnitPriceDiscount) as UnitPriceDiscount 
FROM Sales.SalesOrderDetail 
GROUP BY SalesOrderID, UnitPrice, UnitPriceDiscount WITH ROLLUP;

详细信息:SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine Functionality in SQL Server

Cryptographic providerCryptographic provider

标题:已发现使用了 CREATE CRYPTOGRAPHIC PROVIDER 或 ALTER CRYPTOGRAPHIC PROVIDER,但这两个语句在 Azure SQL 托管实例中不受支持。 Title: A use of CREATE CRYPTOGRAPHIC PROVIDER or ALTER CRYPTOGRAPHIC PROVIDER was found, which is not supported in Azure SQL Managed Instance.
类别:问题Category: Issue

描述 Description
Azure SQL 托管实例不支持 CRYPTOGRAPHIC PROVIDER 语句,因为它无法访问文件。Azure SQL Managed Instance does not support CRYPTOGRAPHIC PROVIDER statements because it cannot access files. 请查看“受影响的对象”部分,了解 CRYPTOGRAPHIC PROVIDER 语句的特定用法。See the Impacted Objects section for the specific uses of CRYPTOGRAPHIC PROVIDER statements. 迁移到 Azure SQL 托管实例后,使用“CREATE CRYPTOGRAPHIC PROVIDER”或“ALTER CRYPTOGRAPHIC PROVIDER”的对象将无法工作。Objects with 'CREATE CRYPTOGRAPHIC PROVIDER' or 'ALTER CRYPTOGRAPHIC PROVIDER' will not work correctly after migrating to Azure SQL Managed Instance.

建议 Recommendation
检查使用“CREATE CRYPTOGRAPHIC PROVIDER”或“ALTER CRYPTOGRAPHIC PROVIDER”的对象。Review objects with 'CREATE CRYPTOGRAPHIC PROVIDER' or 'ALTER CRYPTOGRAPHIC PROVIDER'. 在必须使用的任何此类对象中,删除所使用的这些功能。In any such objects that are required, remove the uses of these features. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例中的 Cryptographic provider 差异More information: Cryptographic provider differences in Azure SQL Managed Instance

数据库兼容性Database compatibility

标题:不支持低于 100 的数据库兼容性级别 Title: Database compatibility level below 100 is not supported
类别:警告Category: Warning

描述 Description
数据库兼容性级别是一个非常有用的工具,借助该工具,可以在升级 SQL Server 数据库引擎的同时,通过保持与升级前相同的数据库兼容性级别来使连接应用程序保持正常运行状态,从而帮助实现数据库现代化。Database Compatibility Level is a valuable tool to assist in database modernization, by allowing the SQL Server Database Engine to be upgraded, while keeping connecting applications functional status by maintaining the same pre-upgrade Database Compatibility Level. Azure SQL 托管实例不支持低于 100 的兼容性级别。Azure SQL Managed Instance doesn't support compatibility levels below 100. 如果在 Azure SQL 托管实例上还原兼容性级别低于 100 的数据库,则兼容性级别将升级到 100。When the database with compatibility level below 100 is restored on Azure SQL Managed Instance, the compatibility level is upgraded to 100.

建议... 在 Azure SQL 托管实例上将数据库兼容性级别升级到 100 后,评估应用程序功能是否完好无损。Recommendation... Evaluate if the application functionality is intact when the database compatibility level is upgraded to 100 on Azure SQL Managed Instance. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例中支持的兼容性级别More information: Supported compatibility levels in Azure SQL Managed Instance

DATABASE_PRINCIPAL_ALIASESDatabase principal alias

标题:SYS.DATABASE_PRINCIPAL_ALIASES 已弃用,并且已被删除。 Title: SYS.DATABASE_PRINCIPAL_ALIASES is discontinued and has been removed.
类别:问题Category: Issue

描述 Description
在 Azure SQL 托管实例中,SYS.DATABASE_PRINCIPAL_ALIASES 已弃用,并且已被删除。SYS.DATABASE_PRINCIPAL_ALIASES is discontinued and has been removed in Azure SQL Managed Instance.

建议 Recommendation
请使用角色而不是别名。Use roles instead of aliases.

详细信息:SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine Functionality in SQL Server

DISABLE_DEF_CNST_CHK 选项DISABLE_DEF_CNST_CHK option

标题:SET 选项 DISABLE_DEF_CNST_CHK 已弃用,并且已被删除。 Title: SET option DISABLE_DEF_CNST_CHK is discontinued and has been removed.
类别:问题Category: Issue

描述 Description
在 Azure SQL 托管实例中,SET 选项 DISABLE_DEF_CNST_CHK 已弃用,并且已被删除。SET option DISABLE_DEF_CNST_CHK is discontinued and has been removed in Azure SQL Managed Instance.

详细信息:SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine Functionality in SQL Server

FASTFIRSTROW 提示FASTFIRSTROW hint

标题:FASTFIRSTROW 查询提示已弃用,并且已被删除。 Title: FASTFIRSTROW query hint is discontinued and has been removed.
类别:警告Category: Warning

描述 Description
在 Azure SQL 托管实例中,FASTFIRSTROW 查询提示已弃用,并且已被删除。FASTFIRSTROW query hint is discontinued and has been removed in Azure SQL Managed Instance.

建议 Recommendation
FASTFIRSTROW 查询提示改用 OPTION (FAST n)。Instead of FASTFIRSTROW query hint use OPTION (FAST n).

详细信息:SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine Functionality in SQL Server

文件流FileStream

标题:文件流和 Filetable 在 Azure SQL 托管实例中不受支持。 Title: Filestream and Filetable are not supported in Azure SQL Managed Instance.
类别:问题Category: Issue

描述 Description
文件流功能使用户可以在 NTFS 文件系统中存储文档文档、图像和视频等非结构化数据,但此功能在 Azure SQL 托管实例中不受支持。The Filestream feature, which allows you to store unstructured data such as text documents, images, and videos in NTFS file system, is not supported in Azure SQL Managed Instance. 无法迁移此数据库,因为无法在 Azure SQL 托管实例上还原包含文件流文件组的备份。This database can't be migrated as the backup containing Filestream filegroups can't be restored on Azure SQL Managed Instance.

建议 Recommendation
将非结构化文件上传到 Azure Blob 存储,并在 Azure SQL 托管实例中存储与这些文件相关的元数据(名称、类型、URL 位置、存储密钥等)。Upload the unstructured files to Azure Blob storage and store metadata related to these files (name, type, URL location, storage key etc.) in Azure SQL Managed Instance. 可能需要对应用程序进行重新设计,以启用与 Azure SQL 托管实例的 Blob 流式传输。You may have to re-engineer your application to enable streaming blobs to and from Azure SQL Managed Instance. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:与 SQL Azure 的 Blob 流式传输博客More information: Streaming Blobs To and From SQL Azure blog

异类 MS DTCHeterogeneous MS DTC

标题:Azure SQL 托管实例不支持对非 SQL Server 远程服务器使用 BEGIN DISTRIBUTED TRANSACTION。 Title: BEGIN DISTRIBUTED TRANSACTION with non-SQL Server remote server is not supported in Azure SQL Managed Instance.
类别:问题Category: Issue

描述 Description
如果远程服务器不是 SQL Server,则由 Transact SQL BEGIN DISTRIBUTED TRANSACTION 启动并由 Microsoft 分布式事务处理协调器 (MS DTC) 管理的分布式事务 Azure SQL 托管实例中不受支持。Distributed transaction started by Transact SQL BEGIN DISTRIBUTED TRANSACTION and managed by Microsoft Distributed Transaction Coordinator (MS DTC) is not supported in Azure SQL Managed Instance if the remote server is not SQL Server.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看使用 BEGIN DISTRUBUTED TRANSACTION 的所有对象。Review impacted objects section in Azure Migrate to see all objects using BEGIN DISTRUBUTED TRANSACTION. 考虑将参与者数据库迁移到 Azure SQL 托管实例,其中支持跨多个实例的分布式事务(目前处于预览阶段)。Consider migrating the participant databases to Azure SQL Managed Instance where distributed transactions across multiple instances are supported (Currently in preview). 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例的跨多个服务器的事务More information: Transactions across multiple servers for Azure SQL Managed Instance

同源 MS DTCHomogenous MS DTC

标题:Azure SQL 托管实例支持跨多个服务器的 BEGIN DISTRIBUTED TRANSACTION。 Title: BEGIN DISTRIBUTED TRANSACTION is supported across multiple servers for Azure SQL Managed Instance.
类别:问题Category: Issue

描述 Description
Azure SQL 托管实例支持由 Transact SQL BEGIN DISTRIBUTED TRANSACTION 启动并由 Microsoft 分布式事务处理协调器 (MS DTC) 管理的跨多个服务器的分布式事务。Distributed transaction started by Transact SQL BEGIN DISTRIBUTED TRANSACTION and managed by Microsoft Distributed Transaction Coordinator (MS DTC) is supported across multiple servers for Azure SQL Managed Instance.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看使用 BEGIN DISTRUBUTED TRANSACTION 的所有对象。Review impacted objects section in Azure Migrate to see all objects using BEGIN DISTRUBUTED TRANSACTION. 考虑将参与者数据库迁移到 Azure SQL 托管实例,其中支持跨多个实例的分布式事务(目前处于预览阶段)。Consider migrating the participant databases to Azure SQL Managed Instance where distributed transactions across multiple instances are supported (Currently in preview). 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例的跨多个服务器的事务More information: Transactions across multiple servers for Azure SQL Managed Instance

链接服务器(非 SQL 提供程序)Linked server (non-SQL provider)

标题:Azure SQL 托管实例不支持将链接服务器用于非 SQL 提供程序。 Title: Linked server with non-SQL Server Provider is not supported in Azure SQL Managed Instance.
类别:问题Category: Issue

描述 Description
链接服务器使 SQL Server 数据库引擎可以对 SQL Server 实例外部的 OLE DB 数据源执行命令。Linked servers enable the SQL Server Database Engine to execute commands against OLE DB data sources outside of the instance of SQL Server. Azure SQL 托管实例不支持将链接服务器用于非 SQL 提供程序。Linked server with non-SQL Server Provider is not supported in Azure SQL Managed Instance.

建议 Recommendation
如果远程服务器提供程序不是 SQL Server,而是 Oracle 或 Sybase 等,则 Azure SQL 托管实例不支持链接服务器功能。Azure SQL Managed Instance does not support linked server functionality if the remote server provider is non-SQL Server like Oracle, Sybase etc.

建议执行以下操作以避免需要使用链接服务器:The following actions are recommended to eliminate the need for linked servers:

  • 确定哪些从属数据库属于非 SQL 远程服务器,并考虑将它们移到要迁移的数据库中。Identify the dependent database(s) from remote non-SQL servers and consider moving these into the database being migrated.
  • 将从属数据库迁移到受支持的目标,例如 SQL 托管实例、SQL 数据库、Azure Synapse SQL 和 SQL Server 实例。Migrate the dependent database(s) to supported targets like SQL Managed Instance, SQL Database, Azure Synapse SQL and SQL Server instances.
  • 考虑在 Azure SQL 托管实例和 Azure 虚拟机上的 SQL Server (SQL VM) 之间创建链接服务器。Consider creating linked server between Azure SQL Managed Instance and SQL Server on Azure Virtual Machine (SQL VM). 然后在 SQL VM 和 Oracle 或 Sybase 等服务器之间创建链接服务器。此方法确实涉及两个跃点,但可用作临时解决方法。Then from SQL VM create linked server to Oracle, Sybase etc. This approach does involve two hops but can be used as temporary workaround.
  • 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例中的链接服务器差异More information: Linked Server differences in Azure SQL Managed Instance

合并作业Merge job

标题:合并作业步骤在 Azure SQL 托管实例中不受支持。 Title: Merge job step is not supported in Azure SQL Managed Instance.
类别:警告Category: Warning

描述 Description
这是用于激活复制合并代理的作业步骤。It is a job step that activates the replication Merge Agent. 复制合并代理是一个将数据库表中保存的初始快照应用于订阅服务器的实用工具可执行文件。The Replication Merge Agent is a utility executable that applies the initial snapshot held in the database tables to the Subscribers. 它还合并自初始快照创建后发布服务器上发生的增量数据更改,并根据配置的规则或通过使用创建的自定义冲突解决程序来协调冲突。It also merges incremental data changes that occurred at the Publisher after the initial snapshot was created, and reconciles conflicts either according to the rules you configure or using a custom resolver you create. 合并作业步骤在 Azure SQL 托管实例中不受支持。Merge job step is not supported in Azure SQL Managed Instance.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看所有使用合并作业步骤的作业,并评估是否可以删除作业步骤或受影响的对象。Review impacted objects section in Azure Migrate to see all jobs using Merge job step and evaluate if the job step or the impacted object can be removed. 或者,迁移到 Azure 虚拟机上的 SQL ServerAlternatively, migrate to SQL Server on Azure Virtual Machine

详细信息:Azure SQL 托管实例中的 SQL Server 代理差异More information: SQL Server Agent differences in Azure SQL Managed Instance

MI 数据库大小MI database size

标题:Azure SQL 托管实例不支持超过 8 TB 的数据库大小。 Title: Azure SQL Managed Instance does not support database size greater than 8 TB.
类别:问题Category: Issue

描述 Description
数据库大小超过实例的最大保留存储空间。The size of the database is greater than maximum instance reserved storage. 不能选择此数据库进行迁移,因为大小超出了允许的限制。This database can't be selected for migration as the size exceeded the allowed limit.

建议 Recommendation
评估数据是否可以存档、压缩或分片到多个数据库中。Evaluate if the data can be archived compressed or sharded into multiple databases. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例的硬件代系特性More information: Hardware generation characteristics of Azure SQL Managed Instance

MI 实例大小MI instance size

标题:Azure SQL 托管实例中的实例最大存储大小不能超过 8 TB。 Title: Maximum instance storage size in Azure SQL Managed Instance cannot be greater than 8 TB.
类别:警告Category: Warning

描述 Description
所有数据库的总大小超过实例的最大保留存储空间。The size of all databases is greater than maximum instance reserved storage.

建议 Recommendation
如果所有数据库都必须在同一个实例上,请考虑将数据库迁移到其他 Azure SQL 托管实例或 Azure 虚拟机上的 SQL Server。Consider migrating the databases to different Azure SQL Managed Instances or to SQL Server on Azure Virtual Machine if all the databases must exist on the same instance.

详细信息:Azure SQL 托管实例的硬件代系特性More information: Hardware generation characteristics of Azure SQL Managed Instance

多个日志文件Multiple log files

标题:Azure SQL 托管实例不支持多个日志文件。 Title: Azure SQL Managed Instance does not support multiple log files.
类别:问题Category: Issue

描述 Description
SQL Server 允许数据库记录到多个文件。SQL Server allows a database to log to multiple files. 此数据库具有多个日志文件,但 Azure SQL 托管实例不支持多个日志文件。This database has multiple log files which is not supported in Azure SQL Managed Instance. **无法迁移此数据库,因为无法在 Azure SQL 托管实例上还原备份。**This database can't be migrated as the backup can't be restored on Azure SQL Managed Instance. **

建议 Recommendation
Azure SQL 托管实例仅支持每个数据库一个日志。Azure SQL Managed Instance supports only a single log per database. 将此数据库迁移到 Azure 之前,需要保留一个日志文件而删除其余所有日志文件:You need to delete all but one of the log files before migrating this database to Azure:

ALTER DATABASE [database_name] REMOVE FILE [log_file_name]

详细信息:Azure SQL 托管实例中不支持的数据库选项More information: Unsupported database options in Azure SQL Managed Instance

Next 列Next column

标题:名为 NEXT 的表和列将导致 Azure SQL 托管实例发生错误。 Title: Tables and Columns named NEXT will lead to an error In Azure SQL Managed Instance.
类别:问题Category: Issue

描述 Description
检测到名为 NEXT 的表或列。Tables or columns named NEXT were detected. Microsoft SQL Server 中引入的序列使用 ANSI 标准 NEXT VALUE FOR 功能。Sequences, introduced in Microsoft SQL Server, use the ANSI standard NEXT VALUE FOR function. 如果表或列名为 NEXT 且该列的别名为 VALUE,在省略 ANSI 标准 AS 的情况下,所得到的语句可能会导致错误。If a table or a column is named NEXT and the column is aliased as VALUE, and if the ANSI standard AS is omitted, the resulting statement can cause an error.

建议 Recommendation
在设置表或列的别名时重写语句以包含 ANSI 标准 AS 关键字。Rewrite statements to include the ANSI standard AS keyword when aliasing a table or column. 例如,当列名为 NEXT 且该列的别名为 VALUE 时,查询 SELECT NEXT VALUE FROM TABLE 将导致发生错误,并且应重新编写为 SELECT NEXT AS VALUE FROM TABLE。For example, when a column is named NEXT and that column is aliased as VALUE, the query SELECT NEXT VALUE FROM TABLE will cause an error and should be rewritten as SELECT NEXT AS VALUE FROM TABLE. 例如,当表名为 NEXT 且该表的别名为 VALUE 时,查询 SELECT Col1 FROM NEXT VALUE 将导致发生错误,并且应重新编写为 SELECT Col1 FROM NEXT AS VALUE。Similarly, when a table is named NEXT and that table is aliased as VALUE, the query SELECT Col1 FROM NEXT VALUE will cause an error and should be rewritten as SELECT Col1 FROM NEXT AS VALUE.

非 ANSI 样式左外部联接Non-ANSI style left outer join

标题:非 ANSI 样式左外部联接已弃用,并且已被删除。 Title: Non-ANSI style left outer join is discontinued and has been removed.
类别:警告Category: Warning

描述 Description
在 Azure SQL 托管实例中,非 ANSI 样式左外部联接已弃用,并且已被删除。Non-ANSI style left outer join is discontinued and has been removed in Azure SQL Managed Instance.

建议 Recommendation
使用 ANSI 联接语法。Use ANSI join syntax.

详细信息:SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine Functionality in SQL Server

非 ANSI 样式右外部联接Non-ANSI style right outer join

标题:非 ANSI 样式右外部联接已弃用,并且已被删除。 Title: Non-ANSI style right outer join is discontinued and has been removed.
类别:警告Category: Warning

描述 Description
在 Azure SQL 托管实例中,非 ANSI 样式右外部联接已弃用,并且已被删除。Non-ANSI style right outer join is discontinued and has been removed in Azure SQL Managed Instance.

详细信息:SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine Functionality in SQL Server

建议 Recommendation
使用 ANSI 联接语法。Use ANSI join syntax.

数据库数目超过 100 个Databases exceed 100

标题:每个 Azure SQL 托管实例最多支持 100 个数据库。 Title: Azure SQL Managed Instance supports a maximum of 100 databases per instance.
类别:警告Category: Warning

描述 Description
除非已达到实例存储大小限制,否则 Azure SQL 托管实例支持的最大数据库数目为 100 个。Maximum number of databases supported in Azure SQL Managed Instance is 100, unless the instance storage size limit has been reached.

建议 Recommendation
如果所有数据库都必须在同一个实例上,请考虑将数据库迁移到其他 Azure SQL 托管实例或 Azure 虚拟机上的 SQL Server。Consider migrating the databases to different Azure SQL Managed Instances or to SQL Server on Azure Virtual Machine if all the databases must exist on the same instance.

详细信息:Azure SQL 托管实例资源限制More information: Azure SQL Managed Instance Resource Limits

OPENROWSET(非 Blob 数据源)OPENROWSET (non-blob data source)

标题:Azure SQL 托管实例不支持将批量操作中使用的 OpenRowSet 用于非 Azure Blob 存储数据源。 Title: OpenRowSet used in bulk operation with non-Azure blob storage data source is not supported in Azure SQL Managed Instance.
类别:问题Category: Issue

描述 Description
OPENROWSET 通过内置的 BULK 提供程序支持批量操作,该提供程序使文件中的数据可被读取并作为行集返回。OPENROWSET supports bulk operations through a built-in BULK provider that enables data from a file to be read and returned as a rowset. Azure SQL 托管实例不支持将 OPENROWSET 用于非 Azure Blob 存储数据源。OPENROWSET with non-Azure blob storage data source is not supported in Azure SQL Managed Instance.

建议 Recommendation
OPENROWSET 函数只能用于对 SQL Server 实例(托管实例、本地实例或虚拟机中的实例)执行查询。OPENROWSET function can be used to execute queries only on SQL Server instances (either managed, on-premises, or in Virtual Machines). 仅支持将值 SQLNCLI、SQLNCLI11 和 SQLOLEDB 用作提供程序。Only SQLNCLI, SQLNCLI11, and SQLOLEDB values are supported as provider. 因此,建议的操作是确定哪些从属数据库属于非 SQL 远程服务器,并考虑将它们移到要迁移的数据库中。Therefore, the recommendation action is that identify the dependent database(s) from remote non-SQL Servers and consider moving these into the database being migrated. 或者,迁移到 Azure 虚拟机上的 SQL ServerAlternatively, migrate to SQL Server on Azure Virtual Machine

详细信息:Azure SQL 托管实例中 Bulk Insert 与 OPENROWSET 之间的差异More information: Bulk Insert and OPENROWSET differences in Azure SQL Managed Instance

OPENROWSET(非 SQL 提供程序)OPENROWSET (non-SQL provider)

标题:Azure SQL 托管实例不支持将 OpenRowSet 用于非 SQL 提供程序。 Title: OpenRowSet with non-SQL provider is not supported in Azure SQL Managed Instance.
类别:问题Category: Issue

描述 Description
当访问链接服务器中的表时,这种方法是一种替代方法,并且是一种使用 OLE DB 连接并访问远程数据的一次性的临时方法。This method is an alternative to accessing tables in a linked server and is a one-time, ad hoc method of connecting and accessing remote data by using OLE DB. Azure SQL 托管实例不支持将 OpenRowSet 用于非 SQL 提供程序。OpenRowSet with non-SQL provider is not supported in Azure SQL Managed Instance.

建议 Recommendation
OPENROWSET 函数只能用于对 SQL Server 实例(托管实例、本地实例或虚拟机中的实例)执行查询。OPENROWSET function can be used to execute queries only on SQL Server instances (either managed, on-premises, or in Virtual Machines). 仅支持将值 SQLNCLI、SQLNCLI11 和 SQLOLEDB 用作提供程序。Only SQLNCLI, SQLNCLI11, and SQLOLEDB values are supported as provider. 因此,建议的操作是确定哪些从属数据库属于非 SQL 远程服务器,并考虑将它们移到要迁移的数据库中。Therefore, the recommendation action is that identify the dependent database(s) from remote non-SQL Servers and consider moving these into the database being migrated.

详细信息:Azure SQL 托管实例中 Bulk Insert 与 OPENROWSET 之间的差异More information: Bulk Insert and OPENROWSET differences in Azure SQL Managed Instance

PowerShell 作业PowerShell job

标题:PowerShell 作业步骤在 Azure SQL 托管实例中不受支持。 Title: PowerShell job step is not supported in Azure SQL Managed Instance.
类别:警告Category: Warning

描述 Description
这是运行 PowerShell 脚本的作业步骤。It is a job step that runs a PowerShell script. PowerShell 作业步骤在 Azure SQL 托管实例中不受支持。PowerShell job step is not supported in Azure SQL Managed Instance.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看所有使用 PowerShell 作业步骤的作业,并评估是否可以删除作业步骤或受影响的对象。Review impacted objects section in Azure Migrate to see all jobs using PowerShell job step and evaluate if the job step or the impacted object can be removed. 评估是否可以使用 Azure 自动化。Evaluate if Azure Automation can be used. 或者,迁移到 Azure 虚拟机上的 SQL ServerAlternatively, migrate to SQL Server on Azure Virtual Machine

详细信息:Azure SQL 托管实例中的 SQL Server 代理差异More information: SQL Server Agent differences in Azure SQL Managed Instance

队列读取器作业Queue Reader job

标题:队列读取器作业步骤在 Azure SQL 托管实例中不受支持。 Title: Queue Reader job step is not supported in Azure SQL Managed Instance.
类别:警告Category: Warning

描述 Description
这是用于激活复制队列读取器代理的作业步骤。It is a job step that activates the replication Queue Reader Agent. 复制队列读取器代理是一个可执行文件,用于读取存储在 Microsoft SQL Server 队列或 Microsoft 消息队列中的消息,然后将这些消息应用于发布服务器。The Replication Queue Reader Agent is an executable that reads messages stored in a Microsoft SQL Server queue or a Microsoft Message Queue and then applies those messages to the Publisher. 队列读取器代理与允许排队更新的快照发布和事务发布一起使用。Queue Reader Agent is used with snapshot and transactional publications that allow queued updating. 队列读取器作业步骤在 Azure SQL 托管实例中不受支持。Queue Reader job step is not supported in Azure SQL Managed Instance.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看所有使用队列读取器作业步骤的作业,并评估是否可以删除作业步骤或受影响的对象。Review impacted objects section in Azure Migrate to see all jobs using Queue Reader job step and evaluate if the job step or the impacted object can be removed. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例中的 SQL Server 代理差异More information: SQL Server Agent differences in Azure SQL Managed Instance

RAISERRORRAISERROR

标题:应将旧式的 RAISERROR 调用替换为等效的新式调用。 Title: Legacy style RAISERROR calls should be replaced with modern equivalents.
类别:警告Category: Warning

描述 Description
类似于以下示例的 RAISERROR 调用称为旧式,因为它们不包含逗号和括号。RAISERROR calls like the below example are termed as legacy-style because they do not include the commas and the parenthesis. RAISERROR 50001 'this is a test'.RAISERROR 50001 'this is a test'. 在 Azure SQL 托管实例中,RAISERROR 的这种调用方法已弃用,并且已被删除。This method of calling RAISERROR is discontinued and removed in Azure SQL Managed Instance.

建议 Recommendation
使用当前的 RAISERROR 语法重新编写语句,或评估 BEGIN TRY { } END TRY BEGIN CATCH { THROW; } END CATCH 的新式方法是否可行。Rewrite the statement using the current RAISERROR syntax, or evaluate if the modern approach of BEGIN TRY { } END TRY BEGIN CATCH { THROW; } END CATCH is feasible.

详细信息:SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine Functionality in SQL Server

服务代理Service broker

标题:Azure SQL 托管实例仅部分支持 Service Broker 功能。 Title: Service Broker feature is partially supported in Azure SQL Managed Instance.
类别:问题Category: Issue

描述 Description
SQL Server Service Broker 在 SQL Server 数据库引擎中为消息传递和队列应用程序提供本机支持。SQL Server Service Broker provides native support for messaging and queuing applications in the SQL Server Database Engine. 此数据库已启用跨实例 Service Broker,这在 Azure SQL 托管实例中不受支持。This database has cross-instance Service Broker enabled which is not supported in Azure SQL Managed Instance.

建议 Recommendation
Azure SQL 托管实例不支持跨实例 Service Broker,即,地址不是本地的。Azure SQL Managed Instance does not support cross-instance service broker, i.e. where the address is not local. 将此数据库迁移到 Azure 之前,需要使用以下命令来禁用 Service Broker:ALTER DATABASE [database_name] SET DISABLE_BROKER;此外,可能还需要删除或停止 Service Broker 终结点,以防止消息到达 SQL 实例。You need to disable Service Broker using the following command before migrating this database to Azure: ALTER DATABASE [database_name] SET DISABLE_BROKER; In addition, you may also need to remove or stop the Service Broker endpoint in order to prevent messages from arriving in the SQL instance. 将数据库迁移到 Azure 后,可以查看 Azure 服务总线功能,以实现基于云的通用消息传递系统,而不是 Service Broker。Once the database has been migrated to Azure, you can look into Azure Service Bus functionality to implement a generic, cloud-based messaging system instead of Service Broker. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例中的 Service Broker 差异More information: Service Broker differences in Azure SQL Managed Instance

SQL MailSQL Mail

标题:SQL Mail 已弃用。 Title: SQL Mail has been discontinued.
类别:警告Category: Warning

描述 Description
在 Azure SQL 托管实例中,SQL Mail 已弃用,并且已被删除。SQL Mail has been discontinued and removed in Azure SQL Managed Instance.

建议 Recommendation
使用数据库邮件。Use Database Mail.

详细信息:SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine Functionality in SQL Server

SystemProcedures110SystemProcedures110

标题:检测到引用已删除的系统存储过程的语句,这些系统存储过程在 Azure SQL 托管实例中不可用。 Title: Detected statements that reference removed system stored procedures that are not available in Azure SQL Managed Instance.
类别:警告Category: Warning

描述 Description
今后不能在 Azure SQL 托管实例中使用不受支持的系统存储过程和扩展存储过程 - sp_dboptionsp_addserversp_dropaliassp_activedirectory_objsp_activedirectory_scpsp_activedirectory_startFollowing unsupported system and extended stored procedures cannot be used in Azure SQL Managed Instance - sp_dboption, sp_addserver, sp_dropalias,sp_activedirectory_obj, sp_activedirectory_scp, and sp_activedirectory_start.

建议 Recommendation
删除对不受支持并且已从 Azure SQL Managed托管实例中删除的系统存储过程的引用。Remove references to unsupported system procedures that have been removed in Azure SQL Managed Instance.

详细信息:SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine Functionality in SQL Server

Transact-SQL 作业Transact-SQL job

标题:TSQL 作业步骤包含 Azure SQL 托管实例不支持的命令 Title: TSQL job step includes unsupported commands in Azure SQL Managed Instance
类别:警告Category: Warning

描述 Description
这是在计划的时间运行 TSQL 脚本的作业步骤。It is a job step that runs TSQL scripts at scheduled time. TSQL 作业步骤包含 Azure SQL 托管实例不支持的命令。TSQL job step includes unsupported commands which are not supported in Azure SQL Managed Instance.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看所有包含 Azure SQL 托管实例不支持的命令的作业,并评估是否可以删除作业步骤或受影响的对象。Review impacted objects section in Azure Migrate to see all jobs that include unsupported commands in Azure SQL Managed Instance and evaluate if the job step or the impacted object can be removed. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例中的 SQL Server 代理差异More information: SQL Server Agent differences in Azure SQL Managed Instance

跟踪标志Trace flags

标题:找到 Azure SQL 托管实例不支持的跟踪标志 Title: Trace flags not supported in Azure SQL Managed Instance were found
类别:警告Category: Warning

描述 Description
Azure SQL 托管实例仅支持有限数量的全局跟踪标志,Azure SQL Managed Instance supports only limited number of global trace flags. 不支持会话跟踪标志。Session trace flags aren't supported.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看 Azure SQL 托管实例不支持的所有跟踪标志,并评估是否可以删除这些跟踪标志。Review impacted objects section in Azure Migrate to see all trace flags that are not supported in Azure SQL Managed Instance and evaluate if they can be removed. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:跟踪标志More information: Trace flags

Windows 身份验证Windows authentication

标题:通过 Windows 身份验证映射的数据库用户(集成安全性)在 Azure SQL 托管实例中不受支持 Title: Database users mapped with Windows authentication (integrated security) are not supported in Azure SQL Managed Instance
类别:警告Category: Warning

描述 Description
Azure SQL 托管实例支持以下两种类型的身份验证:Azure SQL Managed Instance supports two types of authentication:

  • SQL 身份验证,使用用户名和密码SQL Authentication, which uses a username and password
  • Azure Active Directory 身份验证,使用 Azure Active Directory 管理的标识,支持托管域和集成域。Azure Active Directory Authentication, which uses identities managed by Azure Active Directory and is supported for managed and integrated domains.

通过 Windows 身份验证映射的数据库用户(集成安全性)在 Azure SQL 托管实例中不受支持。Database users mapped with Windows authentication (integrated security) are not supported in Azure SQL Managed Instance.

建议 Recommendation
将本地 Active Directory 与 Azure Active Directory 联合。Federate the local Active Directory with Azure Active Directory. 然后,可以将 Windows 标识替换为等效的 Azure Active Directory 标识。The Windows identity can then be replaced with the equivalent Azure Active Directory identities. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:SQL 托管实例安全功能More information: SQL Managed Instance security capabilities

XP_cmdshellXP_cmdshell

标题:xp_cmdshell 在 Azure SQL 托管实例中不受支持。 Title: xp_cmdshell is not supported in Azure SQL Managed Instance.
类别:问题Category: Issue

描述 Description
xp_cmdshell 会生成 Windows 命令 shell 并传入要执行的字符串,它在 Azure SQL 托管实例中不受支持。Xp_cmdshell which spawns a Windows command shell and passes in a string for execution is not supported in Azure SQL Managed Instance.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看所有使用 xp_cmdshell 的作业,并评估是否可以删除对 xp_cmdshell 的引用或受影响的对象。Review impacted objects section in Azure Migrate to see all objects using xp_cmdshell and evaluate if the reference to xp_cmdshell or the impacted object can be removed. 考虑了解 Azure 自动化,它提供基于云的自动化和配置服务。Consider exploring Azure Automation that delivers cloud-based automation and configuration service. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例中的存储过程差异More information: Stored Procedure differences in Azure SQL Managed Instance

后续步骤Next steps

若要开始将 SQL Server 迁移到 Azure SQL 托管实例,请参阅 SQL Server 到 SQL 托管实例的迁移指南To start migrating your SQL Server to Azure SQL Managed Instance, see the SQL Server to SQL Managed Instance migration guide.