什么是 Azure SQL 托管实例?What is Azure SQL Managed Instance?

适用于: Azure SQL 托管实例

Azure SQL 托管实例是一种智能、可缩放的云数据库服务;它将最广泛的 SQL Server 数据库引擎兼容性与完全托管且经久不衰的平台即服务的所有优势相结合。Azure SQL Managed Instance is the intelligent, scalable cloud database service that combines the broadest SQL Server database engine compatibility with all the benefits of a fully managed and evergreen platform as a service. SQL 托管实例具有与最新 SQL Server (Enterprise Edition) 数据库引擎近 100% 的兼容性,提供解决常见安全问题的本机虚拟网络 (VNet) 实现,并提供现有 SQL Server 客户惯用的业务模型SQL Managed Instance has near 100% compatibility with the latest SQL Server (Enterprise Edition) database engine, providing a native virtual network (VNet) implementation that addresses common security concerns, and a business model favorable for existing SQL Server customers. SQL 托管实例允许现有 SQL Server 客户将其本地应用程序即时转移到云中,而只需对应用程序和数据库做出极少量的更改。SQL Managed Instance allows existing SQL Server customers to lift and shift their on-premises applications to the cloud with minimal application and database changes. 同时,SQL 托管实例保留了所有 PaaS 功能(自动修补和版本更新、自动备份高可用性),可大幅降低管理开销和总拥有成本。At the same time, SQL Managed Instance preserves all PaaS capabilities (automatic patching and version updates, automated backups, high availability) that drastically reduce management overhead and TCO.


若要查看 SQL 托管实例当前可用的区域列表,请参阅支持区域For a list of regions where SQL Managed Instance is currently available, see Supported regions.

下图概括描绘了 SQL 托管实例的主要功能:The following diagram outlines key features of SQL Managed Instance:


Azure SQL 托管实例面向想要以最少的迁移工作量,将大量应用从本地或 IaaS、自我构建的或 ISV 提供的环境迁移到完全托管的 PaaS 云环境的客户。Azure SQL Managed Instance is designed for customers looking to migrate a large number of apps from an on-premises or IaaS, self-built, or ISV provided environment to a fully managed PaaS cloud environment, with as low a migration effort as possible. 使用完全自动化的 Azure 数据迁移服务,客户可将其现有的 SQL Server 实例直接迁移到 SQL 托管实例,从而实现与 SQL Server 的兼容,并通过本机 VNet 支持实现客户实例的完全隔离。Using the fully automated Azure Data Migration Service, customers can lift and shift their existing SQL Server instance to SQL Managed Instance, which offers compatibility with SQL Server and complete isolation of customer instances with native VNet support. 若要详细了解迁移选项和工具,请参阅迁移概述:SQL Server 到 Azure SQL 托管实例For more information on migration options and tools, see Migration overview: SQL Server to Azure SQL Managed Instance.
借助软件保障,可以使用适用于 SQL Server 的 Azure 混合权益交换现有许可证,以获得 SQL 托管实例的折扣价格。With Software Assurance, you can exchange your existing licenses for discounted rates on SQL Managed Instance using the Azure Hybrid Benefit for SQL Server. SQL 托管实例是 SQL Server 实例在云中的最佳迁移目标,需要很高的安全性和丰富的编程接口。SQL Managed Instance is the best migration destination in the cloud for SQL Server instances that require high security and a rich programmability surface.

主要特性和功能Key features and capabilities

SQL 托管实例结合了 Azure SQL 数据库和 SQL Server 数据库引擎提供的最佳功能。SQL Managed Instance combines the best features that are available both in Azure SQL Database and the SQL Server database engine.


SQL 托管实例使用最新版 SQL Server 的所有功能(包括联机操作、自动计划更正和其他企业性能增强功能)运行。SQL Managed Instance runs with all of the features of the most recent version of SQL Server, including online operations, automatic plan corrections, and other enterprise performance enhancements. 功能比较:Azure SQL 托管实例与 SQL Server 中对可用功能进行了比较。A comparison of the features available is explained in Feature comparison: Azure SQL Managed Instance versus SQL Server.

PaaS 优势PaaS benefits 业务连续性Business continuity
无需采购和管理硬件No hardware purchasing and management
不产生底层基础结构的管理开销No management overhead for managing underlying infrastructure
快速预配和服务缩放Quick provisioning and service scaling
自动修补和版本升级Automated patching and version upgrade
与其他 PaaS 数据服务集成Integration with other PaaS data services
99.99% 的运行时间 SLA99.99% uptime SLA
内置高可用性Built-in high availability
使用自动备份保护数据Data protected with automated backups
客户可配置的备份保留期Customer configurable backup retention period
用户发起的备份User-initiated backups
数据库时间点还原功能Point-in-time database restore capability
安全性和符合性Security and compliance ManagementManagement
隔离的环境(VNet 集成、单租户服务、专用的计算和存储资源)Isolated environment (VNet integration, single tenant service, dedicated compute and storage)
透明数据加密 (TDE)Transparent data encryption (TDE)
Azure Active Directory (Azure AD) 身份验证、单一登录支持Azure Active Directory (Azure AD) authentication, single sign-on support
Azure AD 服务器主体(登录名)Azure AD server principals (logins)
遵循与 Azure SQL 数据库相同的合规性标准Adheres to compliance standards same as Azure SQL Database
SQL 审核SQL auditing
高级威胁防护Advanced Threat Protection
用于自动预配和缩放服务的 Azure 资源管理器 APIAzure Resource Manager API for automating service provisioning and scaling
用于手动预配和缩放服务的 Azure 门户功能Azure portal functionality for manual service provisioning and scaling
数据迁移服务Data Migration Service


Azure SQL 托管实例已通过了多项合规性标准认证。Azure SQL Managed Instance has been certified against a number of compliance standards. 有关详细信息,请参阅 Microsoft Azure 信任中心,可以从中找到 SQL 数据库合规认证的最新列表。For more information, see the Azure Trust Center where you can find the most current list of SQL Database compliance certifications.

下表显示 SQL 托管实例的主要功能:The key features of SQL Managed Instance are shown in the following table:

功能Feature 说明Description
SQL Server 版本/内部版本SQL Server version/build SQL Server 数据库引擎(最新稳定版)SQL Server database engine (latest stable)
受管理的自动备份Managed automated backups Yes
内置的实例和数据库监视与指标Built-in instance and database monitoring and metrics Yes
自动软件修补Automatic software patching Yes
最新的数据库引擎功能The latest database engine features Yes
每个数据库的数据文件 (ROWS) 数目Number of data files (ROWS) per the database 多个Multiple
每个数据库的日志文件 (LOG) 数目Number of log files (LOG) per database 11
VNet - Azure 资源管理器部署VNet - Azure Resource Manager deployment Yes
VNet - 经典部署模型VNet - Classic deployment model No
门户支持Portal support Yes
内置集成服务 (SSIS)Built-in Integration Service (SSIS) 否 - SSIS 属于 Azure 数据工厂 PaaSNo - SSIS is a part of Azure Data Factory PaaS
内置分析服务 (SSAS)Built-in Analysis Service (SSAS) 否 - SSAS 是单独的 PaaSNo - SSAS is separate PaaS
内置报表服务 (SSRS)Built-in Reporting Service (SSRS) 否 - 请改用 Power BI 分页报表或在 Azure VM 上托管 SSRS。No - use Power BI paginated reports instead or host SSRS on an Azure VM. 虽然 SQL 托管实例不能将 SSRS 作为服务运行,但它可以使用 SQL Server 身份验证为安装在 Azure 虚拟机上的报表服务器托管 SSRS 目录数据库While SQL Managed Instance cannot run SSRS as a service, it can host SSRS catalog databases for a reporting server installed on Azure Virtual Machine, using SQL Server authentication.

基于 vCore 的购买模型vCore-based purchasing model

SQL 托管实例基于 vCore 的购买模型提供了灵活性、控制力和透明度,并且还提供了一种简单明了的方法来将本地工作负载要求转换到云。The vCore-based purchasing model for SQL Managed Instance gives you flexibility, control, transparency, and a straightforward way to translate on-premises workload requirements to the cloud. 此模型允许根据工作负荷需求来更改计算、内存和存储。This model allows you to change compute, memory, and storage based upon your workload needs. 此外,借助适用于 SQL Server 的 Azure SQL Server 混合权益,还能使用 vCore 模型节省高达 55% 的费用。The vCore model is also eligible for up to 55 percent savings with the Azure Hybrid Benefit for SQL Server.

在 vCore 模型中,可在以下两代硬件中进行选择。In the vCore model, you can choose between generations of hardware.

  • Gen4 逻辑 CPU 基于 Intel® E5-2673 v3 (Haswell) 2.4 GHz 处理器,采用附加 SSD 和物理核心(每个核心 7 GB RAM),计算大小为 8 到 24 个 vCore。Gen4 logical CPUs are based on Intel® E5-2673 v3 (Haswell) 2.4 GHz processors, attached SSD, physical cores, 7-GB RAM per core, and compute sizes between 8 and 24 vCores.
  • Gen5 逻辑 CPU 基于 Intel® E5-2673 v4 (Broadwell) 2.3 GHz、Intel® SP-8160 (Skylake) 和 Intel® 8272CL (Cascade Lake) 2.5 GHz 处理器,采用快速 NVMe SSD 和超线程逻辑核心,计算大小为 4 到 80 个核心。Gen5 logical CPUs are based on Intel® E5-2673 v4 (Broadwell) 2.3 GHz, Intel® SP-8160 (Skylake), and Intel® 8272CL (Cascade Lake) 2.5 GHz processors, fast NVMe SSD, hyper-threaded logical core, and compute sizes between 4 and 80 cores.

若要详细了解两代硬件之间的区别,请参阅 SQL 托管实例资源限制Find more information about the difference between hardware generations in SQL Managed Instance resource limits.

服务层Service tiers

SQL 托管实例可在两个服务层级中提供:SQL Managed Instance is available in two service tiers:

  • 常规用途:适用于具有典型性能和 I/O 延迟要求的应用程序。General purpose: Designed for applications with typical performance and I/O latency requirements.
  • 业务关键:适用于具有低 I/O 延迟要求,对工作负载中基础维护操作影响最低的应用程序。Business critical: Designed for applications with low I/O latency requirements and minimal impact of underlying maintenance operations on the workload.

这两个服务层级保证 99.99% 的可用性,可让你独立选择存储大小和计算容量。Both service tiers guarantee 99.99% availability and enable you to independently select storage size and compute capacity. 有关 Azure SQL 托管实例高可用性体系结构的详细信息,请参阅高可用性和 Azure SQL 托管实例For more information on the high availability architecture of Azure SQL Managed Instance, see High availability and Azure SQL Managed Instance.

“常规用途”服务层级General Purpose service tier

以下列表描述了“常规用途”服务层级的主要特征:The following list describes key characteristics of the General Purpose service tier:

  • 适用于具有典型性能要求的大多数业务应用程序Designed for the majority of business applications with typical performance requirements
  • 高性能 Azure Blob 存储 (8 TB)High-performance Azure Blob storage (8 TB)
  • 基于可靠的 Azure Blob 存储和 Azure Service Fabric 的内置高可用性Built-in high availability based on reliable Azure Blob storage and Azure Service Fabric

有关详细信息,请参阅常规用途层中的存储层SQL 托管实例(常规用途)的存储性能最佳做法和注意事项For more information, see Storage layer in the General Purpose tier and Storage performance best practices and considerations for SQL Managed Instance (General Purpose).

若要详细了解两种服务层级之间的区别,请参阅 SQL 托管实例资源限制Find more information about the difference between service tiers in SQL Managed Instance resource limits.

“业务关键”服务层级Business Critical service tier

“业务关键”服务层级适用于具有高 I/O 要求的应用程序。The Business Critical service tier is built for applications with high I/O requirements. 它使用多个独立副本,提供最高级别的故障恢复能力。It offers the highest resilience to failures using several isolated replicas.

以下列表概述了“业务关键”服务层级的主要特征:The following list outlines the key characteristics of the Business Critical service tier:

若要详细了解两种服务层级之间的区别,请参阅 SQL 托管实例资源限制Find more information about the differences between service tiers in SQL Managed Instance resource limits.

管理操作Management operations

Azure SQL 托管实例提供管理操作,你可以使用这些操作来自动部署新的托管实例、更新实例属性,以及删除不再需要的实例。Azure SQL Managed Instance provides management operations that you can use to automatically deploy new managed instances, update instance properties, and delete instances when no longer needed. 可以在托管实例管理操作概述页上找到管理操作的详细说明。Detailed explanation of management operations can be found on managed instance management operations overview page.

高级安全性和符合性Advanced security and compliance

SQL 托管实例附带了 Azure 平台和 SQL Server 数据库引擎提供的高级安全功能。SQL Managed Instance comes with advanced security features provided by the Azure platform and the SQL Server database engine.

安全隔离Security isolation

使用 SQL 托管实例可以进一步实现与 Azure 平台上其他租户的安全隔离。SQL Managed Instance provides additional security isolation from other tenants on the Azure platform. 安全隔离包括:Security isolation includes:

  • 使用 Azure ExpressRoute 或 VPN 网关实现本机虚拟网络并连接到本地环境。Native virtual network implementation and connectivity to your on-premises environment using Azure ExpressRoute or VPN Gateway.
  • 在默认部署中,仅通过专用 IP 地址公开 SQL 终结点,以便从专用 Azure 或混合网络建立安全连接。In a default deployment, the SQL endpoint is exposed only through a private IP address, allowing safe connectivity from private Azure or hybrid networks.
  • 具有专用底层基础结构(计算、存储)的单一租户。Single-tenant with dedicated underlying infrastructure (compute, storage).

下图概述了应用程序的各种连接选项:The following diagram outlines various connectivity options for your applications:


若要详细了解子网级别的 VNet 集成和网络策略实施情况,请参阅托管实例的 VNet 体系结构将应用程序连接到托管实例To learn more details about VNet integration and networking policy enforcement at the subnet level, see VNet architecture for managed instances and Connect your application to a managed instance.


只要安全要求允许,就将多个托管实例放在同一子网中,因为这会带来额外的好处。Place multiple managed instances in the same subnet, wherever that is allowed by your security requirements, as that will bring you additional benefits. 在同一子网中并置实例,将显著简化网络基础结构维护,还会减少预配时间,因为预配持续时间长与在子网中部署第一个托管实例的成本相关。Co-locating instances in the same subnet will significantly simplify networking infrastructure maintenance and reduce instance provisioning time, since a long provisioning duration is associated with the cost of deploying the first managed instance in a subnet.

安全功能Security features

Azure SQL 托管实例提供一组可用于保护数据的高级安全功能。Azure SQL Managed Instance provides a set of advanced security features that can be used to protect your data.

  • SQL 托管实例审核可跟踪数据库事件,并将其写入 Azure 存储帐户中的审核日志文件。SQL Managed Instance auditing tracks database events and writes them to an audit log file placed in your Azure storage account. 审核可帮助你一直保持遵从法规、了解数据库活动,以及深入了解可以指明业务考量因素或疑似安全违规的偏差和异常。Auditing can help you maintain regulatory compliance, understand database activity, and gain insight into discrepancies and anomalies that could indicate business concerns or suspected security violations.
  • 动态数据加密 - SQL 托管实例提供动态数据加密,使用传输层安全性保护数据。Data encryption in motion - SQL Managed Instance secures your data by providing encryption for data in motion using Transport Layer Security. 除传输层安全性以外,SQL 托管实例还使用 Always Encrypted 在动态、静态和查询处理期间提供敏感数据的保护。In addition to Transport Layer Security, SQL Managed Instance offers protection of sensitive data in flight, at rest, and during query processing with Always Encrypted. Always Encrypted 可针对涉及关键数据被盗的漏洞提供数据安全性。Always Encrypted offers data security against breaches involving the theft of critical data. 例如,借助 Always Encrypted,信用卡号即使在查询处理期间也始终加密存储在数据库中,允许经授权员工或需要处理该数据的应用程序在使用时进行解密。For example, with Always Encrypted, credit card numbers are stored encrypted in the database always, even during query processing, allowing decryption at the point of use by authorized staff or applications that need to process that data.
  • 高级威胁防护是对审核的补充,它在服务中提供一个内置的附加安全智能层,用于检测企图访问或使用数据库的异常的潜在有害尝试。Advanced Threat Protection complements auditing by providing an additional layer of security intelligence built into the service that detects unusual and potentially harmful attempts to access or exploit databases. 出现可疑活动、潜在漏洞、 SQL 注入攻击和异常数据库访问模式时,它会发出警报。You are alerted about suspicious activities, potential vulnerabilities, and SQL injection attacks, as well as anomalous database access patterns. 可以从 Azure 安全中心查看高级威胁防护警报。Advanced Threat Protection alerts can be viewed from Azure Security Center. 它们可提供可疑活动的详细信息,以及如何调查和缓解威胁的推荐操作。They provide details of suspicious activity and recommend action on how to investigate and mitigate the threat.
  • 动态数据掩码功能通过对非特权用户模糊化敏感数据来限制此类数据的泄漏。Dynamic data masking limits sensitive data exposure by masking it to non-privileged users. 动态数据掩码允许指定在对应用层产生最小影响的前提下可以透露的敏感数据量,从而帮助防止未经授权的用户访问敏感数据。Dynamic data masking helps prevent unauthorized access to sensitive data by enabling you to designate how much of the sensitive data to reveal with minimal impact on the application layer. 它是一种基于策略的安全功能,会在针对指定的数据库字段运行查询后返回的结果集中隐藏敏感数据,同时保持数据库中的数据不变。It's a policy-based security feature that hides the sensitive data in the result set of a query over designated database fields, while the data in the database is not changed.
  • 使用行级别安全性 (RLS) 可根据执行查询的用户特征(例如按组成员身份或执行上下文),控制对数据库表中的行的访问。Row-level security (RLS) enables you to control access to rows in a database table based on the characteristics of the user executing a query (such as by group membership or execution context). RLS 简化了应用程序中的安全性设计和编程。RLS simplifies the design and coding of security in your application. 使用 RLS 可针对数据行访问实施限制。RLS enables you to implement restrictions on data row access. 例如,确保工作人员只能访问与其部门相关的数据行,或者将可访问的数据限制为相关的数据。For example, ensuring that workers can access only the data rows that are pertinent to their department, or restricting a data access to only the relevant data.
  • 透明数据加密 (TDE) 可以加密 SQL 托管实例数据文件,称为静态数据加密。Transparent data encryption (TDE) encrypts SQL Managed Instance data files, known as encrypting data at rest. TDE 针对数据和日志文件执行实时 I/O 加密和解密。TDE performs real-time I/O encryption and decryption of the data and log files. 加密使用数据库加密密钥 (DEK),它存储在数据库引导记录中,可在恢复时使用。The encryption uses a database encryption key (DEK), which is stored in the database boot record for availability during recovery. 可使用透明数据加密保护托管实例中的所有数据库。You can protect all your databases in a managed instance with transparent data encryption. TDE 是 SQL Server 中经验证的静态加密技术,许多符合性标准都需要它来防止存储介质被盗。TDE is proven encryption-at-rest technology in SQL Server that is required by many compliance standards to protect against theft of storage media.

通过 Azure 数据库迁移服务或本机还原来支持将加密数据库迁移到 SQL 托管实例。Migration of an encrypted database to SQL Managed Instance is supported via Azure Database Migration Service or native restore. 如果打算使用本机还原迁移加密数据库,则必须将现有 TDE 证书从 SQL Server 实例迁移到 SQL 托管实例。If you plan to migrate an encrypted database using native restore, migration of the existing TDE certificate from the SQL Server instance to SQL Managed Instance is a required step. 有关迁移选项的详细信息,请参阅将 SQL Server 迁移到 SQL 托管实例For more information about migration options, see SQL Server migration to SQL Managed Instance.

Azure Active Directory 集成Azure Active Directory integration

SQL 托管实例支持传统的 SQL Server 数据库引擎登录名以及与 Azure AD 集成的登录名。SQL Managed Instance supports traditional SQL Server database engine logins and logins integrated with Azure AD. Azure AD 服务器主体(登录名)(公共预览版)是在本地环境中使用的本地数据库登录名的 Azure 云版本。Azure AD server principals (logins) (public preview) are an Azure cloud version of on-premises database logins that you are using in your on-premises environment. 使用 Azure AD 服务器主体(登录名)可将 Azure AD 租户中的用户和组指定为真正的实例范围的主体,能够执行任何实体级操作,包括在同一托管实例内执行跨数据库查询。Azure AD server principals (logins) enable you to specify users and groups from your Azure AD tenant as true instance-scoped principals, capable of performing any instance-level operation, including cross-database queries within the same managed instance.

引入了用来创建 Azure AD 服务器主体(登录名)(公共预览版)的一个新语法:FROM EXTERNAL PROVIDERA new syntax is introduced to create Azure AD server principals (logins), FROM EXTERNAL PROVIDER. 有关该语法的详细信息,请参阅 CREATE LOGIN,并查看为 SQL 托管实例预配 Azure Active Directory 管理员一文。For more information on the syntax, see CREATE LOGIN, and review the Provision an Azure Active Directory administrator for SQL Managed Instance article.

Azure Active Directory 集成和多重身份验证Azure Active Directory integration and multi-factor authentication

借助 SQL 托管实例,可以使用 Azure Active Directory 集成集中管理数据库用户和其他 Microsoft 服务的标识。SQL Managed Instance enables you to centrally manage identities of database users and other Microsoft services with Azure Active Directory integration. 此功能简化了权限管理,增强了安全性。This capability simplifies permission management and enhances security. Azure Active Directory 支持多重身份验证,以便在支持单一登录过程的同时提高数据和应用程序安全性。Azure Active Directory supports multi-factor authentication to increase data and application security while supporting a single sign-on process.


SQL 托管实例身份验证是指用户连接到数据库时如何证明其身份。SQL Managed Instance authentication refers to how users prove their identity when connecting to the database. SQL 托管实例支持两种类型的身份验证:SQL Managed Instance supports two types of authentication:

  • SQL 身份验证SQL Authentication:

    此身份验证方法使用用户名和密码。This authentication method uses a username and password.

  • Azure Active Directory 身份验证Azure Active Directory Authentication:

    此身份验证方法使用由 Azure Active Directory 托管的标识,并且受托管域和集成域支持。This authentication method uses identities managed by Azure Active Directory and is supported for managed and integrated domains. 尽可能使用 Active Directory 身份验证(集成安全性)。Use Active Directory authentication (integrated security) whenever possible.


授权是指用户可以在 Azure SQL 托管实例中的数据库内执行的操作,授权由用户帐户的数据库角色成员身份和对象级权限控制。Authorization refers to what a user can do within a database in Azure SQL Managed Instance, and is controlled by your user account's database role memberships and object-level permissions. SQL 托管实例的授权功能与 SQL Server 2017 相同。SQL Managed Instance has the same authorization capabilities as SQL Server 2017.

数据库迁移Database migration

SQL 托管实例面向需要从本地或 IaaS 数据库实施项目迁移大量数据库的用户方案。SQL Managed Instance targets user scenarios with mass database migration from on-premises or IaaS database implementations. SQL 托管实例支持多种数据库迁移选项,它们将在迁移指南中进行讨论。SQL Managed Instance supports several database migration options that are discussed in the migration guides. 有关详细信息,请参阅迁移概述:SQL Server 到 Azure SQL 托管实例See Migration overview: SQL Server to Azure SQL Managed Instance for more information.

备份和还原Backup and restore

迁移方法利用 Azure Blob 存储的 SQL 备份。The migration approach leverages SQL backups to Azure Blob storage. 可以使用 T-SQL RESTORE 命令将 Azure 存储 Blob 中存储的备份直接还原到托管实例。Backups stored in an Azure storage blob can be directly restored into a managed instance using the T-SQL RESTORE command.

  • 有关介绍如何还原 Wide World Importers - 标准数据库备份文件的快速入门,请参阅将备份文件还原到托管实例For a quickstart showing how to restore the Wide World Importers - Standard database backup file, see Restore a backup file to a managed instance. 本快速入门介绍如何将备份文件上传到 Azure Blob 存储并使用共享访问签名 (SAS) 密钥对其进行保护。This quickstart shows that you have to upload a backup file to Azure Blob storage and secure it using a shared access signature (SAS) key.
  • 有关从 URL 还原的信息,请参阅从 URL 本机还原For information about restore from URL, see Native RESTORE from URL.


来自托管实例的备份只能还原到另一个托管实例。Backups from a managed instance can only be restored to another managed instance. 它们不能还原到 SQL Server 实例或 Azure SQL 数据库。They cannot be restored to a SQL Server instance or to Azure SQL Database.

数据库迁移服务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. 此服务简化了将现有的第三方数据库和 SQL Server 数据库移到 Azure SQL 数据库、Azure SQL 托管实例以及 Azure VM 上的 SQL Server 时需要执行的任务。This service streamlines the tasks required to move existing third-party and SQL Server databases to Azure SQL Database, Azure SQL Managed Instance, and SQL Server on Azure VM. 请参阅如何使用数据库迁移服务将本地数据库迁移到 SQL 托管实例See How to migrate your on-premises database to SQL Managed Instance using Database Migration Service.

支持的 SQL 功能SQL features supported

SQL 托管实例旨在通过分阶段的发布计划,实现外围应用与最新 SQL Server 版本的近乎 100% 的兼容性。SQL Managed Instance aims to deliver close to 100% surface area compatibility with the latest SQL Server version through a staged release plan. 有关功能和比较列表,请参阅 SQL 托管实例功能比较;有关 SQL 托管实例与 SQL Server 中 T-SQL 差异的列表,请参阅 SQL 托管实例与 SQL Server 的 T-SQL 差异For a features and comparison list, see SQL Managed Instance feature comparison, and for a list of T-SQL differences in SQL Managed Instance versus SQL Server, see SQL Managed Instance T-SQL differences from SQL Server.

SQL 托管实例支持与 SQL Server 2008 数据库的向后兼容。SQL Managed Instance supports backward compatibility to SQL Server 2008 databases. 支持从 SQL Server 2005 数据库服务器直接迁移,迁移后的 SQL Server 2005 数据库的兼容性级别将更新为 SQL Server 2008。Direct migration from SQL Server 2005 database servers is supported, and the compatibility level for migrated SQL Server 2005 databases is updated to SQL Server 2008.

下图概括描绘了 SQL 托管实例中外围应用的兼容性:The following diagram outlines surface area compatibility in SQL Managed Instance:


本地 SQL Server 与 SQL 托管实例之间的主要差异Key differences between SQL Server on-premises and SQL Managed Instance

SQL 托管实例受益于云中的一贯最新状态,这意味着 SQL Server 中的某些功能可能已过时、停用或被取代。SQL Managed Instance benefits from being always-up-to-date in the cloud, which means that some features in SQL Server may be obsolete, be retired, or have alternatives. 在某些情况下,当工具需要识别特定的功能是否以略微不同的方式工作或者服务是否在某个环境中运行时,你无法完全控制这一点。There are specific cases when tools need to recognize that a particular feature works in a slightly different way or that the service is running in an environment you do not fully control.

一些主要区别:Some key differences:

  • 高可用性是通过类似 Always On 可用性组的技术内置和预配的。High availability is built in and pre-configured using technology similar to Always On availability groups.
  • 仅有自动备份和时间点还原。There are only automated backups and point-in-time restore. 客户可以启动 copy-only 备份,而不会干扰自动备份链。Customers can initiate copy-only backups that do not interfere with the automatic backup chain.
  • 不支持指定完整的物理路径,因此必须以不同的方式为相应的方案提供支持:RESTORE DB 不支持 WITH MOVE,CREATE DB 不允许使用物理路径,BULK INSERT 仅适用于 Azure Blob 等。Specifying full physical paths is unsupported, so all corresponding scenarios have to be supported differently: RESTORE DB does not support WITH MOVE, CREATE DB doesn't allow physical paths, BULK INSERT works with Azure blobs only, etc.
  • SQL 托管实例支持使用 Azure AD 身份验证作为 Windows 身份验证的云替代方法。SQL Managed Instance supports Azure AD authentication as a cloud alternative to Windows authentication.
  • 对于包含内存中 OLTP 对象的数据库,SQL 托管实例会自动管理 XTP 文件组和文件。SQL Managed Instance automatically manages XTP filegroups and files for databases containing In-Memory OLTP objects.
  • SQL 托管实例支持 SQL Server Integration Services (SSIS),并且可以托管存储 SSIS 包的 SSIS 目录 (SSISDB),但它们在 Azure 数据工厂中的托管 Azure-SSIS Integration Runtime (IR) 上执行。SQL Managed Instance supports SQL Server Integration Services (SSIS) and can host an SSIS catalog (SSISDB) that stores SSIS packages, but they are executed on a managed Azure-SSIS Integration Runtime (IR) in Azure Data Factory. 请参阅在数据工厂中创建 Azure-SSIS IRSee Create Azure-SSIS IR in Data Factory. 若要比较 SSIS 功能,请参阅比较 SQL 数据库与 SQL 托管实例To compare the SSIS features, see Compare SQL Database to SQL Managed Instance.

管理功能Administration features

SQL 托管实例可以减少系统管理员花费在管理任务上的时间,因为该服务可以自行执行这些任务,或者大大简化这些任务。SQL Managed Instance enables system administrators to spend less time on administrative tasks because the service either performs them for you or greatly simplifies those tasks. 例如,OS/RDBMS 安装和修补动态实例大小调整和配置备份数据库复制(包括系统数据库)、高可用性配置,以及运行状况和性能监视数据流的配置。For example, OS/RDBMS installation and patching, dynamic instance resizing and configuration, backups, database replication (including system databases), high availability configuration, and configuration of health and performance monitoring data streams.

有关详细信息,请参阅支持和不支持的 SQL 托管实例功能列表以及 SQL 托管实例和 SQL Server 之间的 T-SQL 差异For more information, see a list of supported and unsupported SQL Managed Instance features, and T-SQL differences between SQL Managed Instance and SQL Server.

以编程方式标识托管实例Programmatically identify a managed instance

下表显示了可通过 Transact-SQL 访问的几个属性。使用这些属性可以检测应用程序是否正在使用 SQL 托管实例以及检索重要属性。The following table shows several properties, accessible through Transact-SQL, that you can use to detect that your application is working with SQL Managed Instance and retrieve important properties.

属性Property Value 注释Comment
@@VERSION Microsoft SQL Azure (RTM) - 12.0.2000.8 2018-03-07 Copyright (C) 2018 Microsoft Corporation.Microsoft SQL Azure (RTM) - 12.0.2000.8 2018-03-07 Copyright (C) 2018 Microsoft Corporation. 此值与 SQL 数据库中的值相同。This value is same as in SQL Database. 此值 并不 表示 SQL 引擎版本 12 (SQL Server 2014)。This does not indicate SQL engine version 12 (SQL Server 2014). SQL 托管实例始终运行最新稳定的 SQL 引擎版本,此版本与最新可用的 SQL Server RTM 版本相同或更高。SQL Managed Instance always runs the latest stable SQL engine version, which is equal to or higher than latest available RTM version of SQL Server.
SERVERPROPERTY ('Edition') SQL AzureSQL Azure 此值与 SQL 数据库中的值相同。This value is same as in SQL Database.
SERVERPROPERTY('EngineEdition') 88 此值唯一标识托管实例。This value uniquely identifies a managed instance.
@@SERVERNAME, SERVERPROPERTY ('ServerName')@@SERVERNAME, SERVERPROPERTY ('ServerName') 采用以下格式的完整实例 DNS 名称:<instanceName>.<dnsPrefix>.database.chinacloudapi.cn,其中,<instanceName> 是客户提供的名称,<dnsPrefix> 是自动生成的名称部分,保证 DNS 名称的全局唯一性(例如“wcus17662feb9ce98”)Full instance DNS name in the following format:<instanceName>.<dnsPrefix>.database.chinacloudapi.cn, where <instanceName> is name provided by the customer, while <dnsPrefix> is autogenerated part of the name guaranteeing global DNS name uniqueness ("wcus17662feb9ce98", for example) 示例:my-managed-instance.wcus17662feb9ce98.database.chinacloudapi.cnExample: my-managed-instance.wcus17662feb9ce98.database.chinacloudapi.cn

后续步骤Next steps