您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

Azure 虚拟机上的 SQL Server (Windows) 概述Overview of SQL Server on Azure Virtual Machines (Windows)

本主题介绍在 Azure Windows 虚拟机 (VM) 上运行 SQL Server 的选项,提供了门户映像链接,同时概述了常见任务This topic describes your options for running SQL Server on Azure Windows virtual machines (VMs), along with links to portal images and an overview of common tasks.

备注

如果已经熟悉 SQL Server,并且只是想了解如何部署 SQL Server Windows VM,请参阅在 Azure 中预配 Windows SQL Server VMIf you're already familiar with SQL Server and just want to see how to deploy a SQL Server Windows VM, see Provision a Windows SQL Server VM in the Azure. 或者,若要创建带 SQL Server 的 Linux VM,请参阅在 Azure 中预配 Linux SQL Server VMOr if you want to create a Linux VM with SQL Server, see Provision a Linux SQL Server VM in the Azure

如果用户是数据库管理员或开发人员,则可通过 Azure VM 将本地 SQL Server 工作负荷和应用程序移到云中。If you are a database administrator or a developer, Azure VMs provide a way to move your on-premises SQL Server workloads and applications to the Cloud.

方案Scenarios

用户选择在 Azure 中托管数据有许多原因。There are many reasons that you might choose to host your data in Azure. 如果将应用程序转移至 Azure,则同时转移数据会改善性能。If your application is moving to Azure, it improves performance to also move the data. 此外还有其他好处。But there are other benefits. 用户可以自动获得多个数据中心的访问权限,从而获得全局支持和灾难恢复能力。You automatically have access to multiple data centers for a global presence and disaster recovery. 另外,数据的安全性和持久性也得到了高度保障。The data is also highly secured and durable.

在 Azure VM 中运行 SQL Server 是在 Azure 中存储关系数据的一个选项。SQL Server running on Azure VMs is one option for storing your relational data in Azure. 它适用于多种方案。It is good choice for several scenarios. 例如,用户可能需要将 Azure VM 配置为与本地 SQL Server 计算机类似,越类似越好,For example, you might want to configure the Azure VM as similarly as possible to an on-premises SQL Server machine. 或者可能需要在同一数据库服务器上运行其他的应用程序和服务。Or you might want to run additional applications and services on the same database server. 如需了解更多方案和考虑事项,可以参考两大主要资源:There are two main resources that can help you think through even more scenarios and considerations:

创建新的 SQL VMCreate a new SQL VM

以下部分提供了有关 SQL Server 虚拟机库映像到 Azure 门户的直接链接。The following sections provide direct links to the Azure portal for the SQL Server virtual machine gallery images. 根据所选的映像,可以基于分钟支付 SQL Server 许可费用,也可以自带许可 (BYOL)。Depending on the image you select, you can either pay for SQL Server licensing costs on a per-minute basis, or you can bring your own license (BYOL).

在以下教程中查找创建新 SQL VM 的分步指南:在 Azure 门户中预配 SQL Server 虚拟机Find step-by-step guidance for creating a new SQL VM in the tutorial, Provision a SQL Server virtual machine in the Azure portal. 另外,请查看 SQL Server VM 的性能最佳实践,其中介绍了如何选择适当的虚拟机大小和预配期间其他可用的功能。Also, review the Performance best practices for SQL Server VMs, which explains how to select the appropriate machine size and other features available during provisioning.

选项 1:创建具有每分钟许可的 SQL 虚拟机Option 1: Create a SQL VM with per-minute licensing

下表提供了虚拟机库中最新 SQL Server 映像的矩阵。The following table provides a matrix of the latest SQL Server images in the virtual machine gallery. 单击任何链接,即可开始创建具有指定版本和操作系统的新 SQL VM。Click on any link to begin creating a new SQL VM with your specified version, edition, and operating system.

提示

若要了解这些映像的 VM 和 SQL 定价,请参阅 SQL Server Azure VM 的定价指南To understand the VM and SQL pricing for these images, see Pricing guidance for SQL Server Azure VMs.

版本Version 操作系统Operating System 版本Edition
SQL Server 2017SQL Server 2017 Windows Server 2016Windows Server 2016 EnterpriseStandardWebExpressDeveloperEnterprise, Standard, Web, Express, Developer
SQL Server 2016 SP1SQL Server 2016 SP1 Windows Server 2016Windows Server 2016 EnterpriseStandardWebExpressDeveloperEnterprise, Standard, Web, Express, Developer
SQL Server 2014 SP2SQL Server 2014 SP2 Windows Server 2012 R2Windows Server 2012 R2 EnterpriseStandardWebExpressEnterprise, Standard, Web, Express
SQL Server 2012 SP3SQL Server 2012 SP3 Windows Server 2012 R2Windows Server 2012 R2 EnterpriseStandardWebExpressEnterprise, Standard, Web, Express

备注

若要查看可用的 Linux SQL Server 虚拟机映像,请参阅 Azure 虚拟机上的 SQL Server 概述 (Linux)To see the available Linux SQL Server virtual machine images, see Overview of SQL Server on Azure Virtual Machines (Linux).

选项 2:使用现有许可创建 SQL VM Option 2: Create a SQL VM with an existing license

也可以自带许可 (BYOL)。You can also bring your own license (BYOL). 在此方案中,只需支付 VM 费用,SQL Server 许可不需要任何额外的费用。In this scenario, you only pay for the VM without any additional charges for SQL Server licensing. 若要使用自己的许可证,请参考下面的 SQL Server 版本和操作系统对照表。To use your own license, use the matrix of SQL Server versions, editions, and operating systems below. 在门户中,这些映像名称带有 {BYOL}前缀。In the portal, these image names are prefixed with {BYOL}.

提示

自带许可证长时间会节省资金,因为可以持续使用生产型工作负荷。Bringing your own license can save you money over time for continuous production workloads. 有关详细信息,请参阅 SQL Server Azure VM 定价指南For more information, see Pricing guidance for SQL Server Azure VMs.

版本Version 操作系统Operating system 版本Edition
SQL Server 2016 SP1SQL Server 2016 SP1 Windows Server 2016Windows Server 2016 Enterprise BYOLStandard BYOLEnterprise BYOL, Standard BYOL
SQL Server 2014 SP2SQL Server 2014 SP2 Windows Server 2012 R2Windows Server 2012 R2 Enterprise BYOLStandard BYOLEnterprise BYOL, Standard BYOL
SQL Server 2012 SP2SQL Server 2012 SP2 Windows Server 2012 R2Windows Server 2012 R2 Enterprise BYOLStandard BYOLEnterprise BYOL, Standard BYOL

除了此列表,也可使用 SQL Server 版本和操作系统的其他组合。In addition to this list, other combinations of SQL Server versions and operating systems are available. 在 Azure 门户中通过应用商店搜索查找其他映像(搜索“{BYOL} SQL Server”)。Find other images through a marketplace search in the Azure portal (search for "{BYOL} SQL Server").

重要

若要使用 BYOL VM 映像,必须具有包含 Azure 上通过软件保障实现的许可移动性的企业协议。To use BYOL VM images, you must have an Enterprise Agreement with License Mobility through Software Assurance on Azure. 此外,还需要有所要使用的 SQL Server 版本的有效许可证。You also need a valid license for the version/edition of SQL Server you want to use. 必须在预配 VM 的 10 天内 向 Microsoft 提供必要的 BYOL 信息You must provide the necessary BYOL information to Microsoft within 10 days of provisioning your VM.

备注

无法更改按分钟付费的 SQL Server VM 的许可模式来使用自己的许可证。It is not possible to change the licensing model of a pay-per-minute SQL Server VM to use your own license. 要使用自己的许可证,必须创建新的 BYOL VM,并将数据库迁移到新 VM。In this case, you must create a new BYOL VM and migrate your databases to the new VM.

管理 SQL VMManage your SQL VM

预配 SQL Server VM 之后,有几项可选的管理任务。After provisioning your SQL Server VM, there are several optional management tasks. 在许多方面,完全可以像管理本地 SOL Server 实例一样配置和管理 SQL Server。In many aspects, you configure and manage SQL Server exactly like you would manage an on-premises SQL Server instance. 但某些任务是 Azure 特有的。However, some tasks are specific to Azure. 下列各节重点介绍上述某些领域并提供详细信息链接。The following sections highlight some of these areas with links to more information.

连接到 VMConnect to the VM

最基本的管理步骤之一是,通过 SQL Server Management Studio (SSMS) 之类的工具连接到 SQL Server VM。One of the most basic management steps is to connect to your SQL Server VM through tools, such as SQL Server Management Studio (SSMS). 有关如何连接到新 SQL Server VM 的说明,请参阅连接到 Azure 上的 SQL Server 虚拟机For instructions on how to connect to your new SQL Server VM, see Connect to a SQL Server Virtual Machine on Azure.

迁移数据Migrate your data

如果已有数据库,会想要将该数据库移至新预配的 SQL VM。If you have an existing database, you'll want to move that to the newly provisioned SQL VM. 有关迁移选项的列表和指导,请参阅将数据库迁移到 Azure VM 上的 SQL ServerFor a list of migration options and guidance, see Migrating a Database to SQL Server on an Azure VM.

配置高可用性Configure high availability

如果需要高可用性,请考虑配置 SQL Server 可用性组。If you require high availability, consider configuring SQL Server Availability Groups. 这涉及虚拟网络中的多个 Azure VM。This involves multiple Azure VMs in a virtual network. Azure 门户提供了一个模板用于设置此配置。The Azure portal has a template that sets up this configuration for you. 有关详细信息,请参阅 在 Azure Resource Manager 虚拟机中配置 AlwaysOn 可用性组For more information, see Configure an AlwaysOn availability group in Azure Resource Manager virtual machines. 如果想要手动配置可用性组和关联的侦听器,请参阅在 Azure VM 中配置 AlwaysOn 可用性组If you want to manually configure your Availability Group and associated listener, see Configure AlwaysOn Availability Groups in Azure VM.

有关其他高可用性注意事项,请参阅 Azure 虚拟机中 SQL Server 的高可用性和灾难恢复For other high availability considerations, see High Availability and Disaster Recovery for SQL Server in Azure Virtual Machines.

备份数据Back up your data

Azure VM 可以利用 自动备份,定期创建数据库到 Blob 存储的备份。Azure VMs can take advantage of Automated Backup, which regularly creates backups of your database to blob storage. 也可以手动使用此技术。You can also manually use this technique. 有关详细信息,请参阅 使用 Azure 存储进行 SQL Server 备份和还原For more information, see Use Azure Storage for SQL Server Backup and Restore. 有关所有备份和还原选项的概述,请参阅 Azure 虚拟机中 SQL Server 的备份和还原For an overview of all backup and restore options, see Backup and Restore for SQL Server in Azure Virtual Machines.

自动更新Automate updates

Azure VM 可以使用 自动修补 来安排维护时段,以便自动安装重要的 Windows 和 SQL Server 更新。Azure VMs can use Automated Patching to schedule a maintenance window for installing important windows and SQL Server updates automatically.

客户体验改善计划 (CEIP)Customer experience improvement program (CEIP)

客户体验改善计划 (CEIP) 默认情况下已启用。The Customer Experience Improvement Program (CEIP) is enabled by default. 这样会定期将报告发送至 Microsoft,帮助改进 SQL Server。This periodically sends reports to Microsoft to help improve SQL Server. CEIP 不需要执行管理任务,除非用户想要在预配后将其禁用。There is no management task required with CEIP unless you want to disable it after provisioning. 可以通过远程桌面连接到 VM,以自定义或禁用 CEIP。You can customize or disable the CEIP by connecting to the VM with remote desktop. 然后运行“SQL Server 错误和使用情况报告”实用工具。Then run the SQL Server Error and Usage Reporting utility. 请按照说明禁用报告功能。Follow the instructions to disable reporting.

有关数据收集的详细信息,请参阅 SQL Server 隐私声明For more information about data collection, see the SQL Server Privacy Statement.

后续步骤Next steps

有关定价的问题,请参阅 SQL Server Azure VM 的定价指南Azure 定价页For questions about pricing, see Pricing guidance for SQL Server Azure VMs and the Azure pricing page. 在“OS/软件”列表中选择 SQL Server 的目标版本。Select your target edition of SQL Server in the OS/Software list. 然后,查看不同大小虚拟机的价格。Then view the prices for differently sized virtual machines.

其他问题?More question? 请先参阅 Azure 虚拟机中的 SQL Server 常见问题解答First, see the SQL Server on Azure Virtual Machines FAQ. 同时将问题或看法添加在任何 SQL VM 主题的底部,以便与 Microsoft 和社区互动。But also add your questions or comments to the bottom of any SQL VM topics to interact with Microsoft and the community.