有关 Linux 虚拟机上的 SQL Server 的常见问题解答Frequently asked questions for SQL Server on Linux virtual machines

适用于:是Azure VM 上的 SQL ServerAPPLIES TO: yesSQL Server on Azure VM

本文提供有关在 Linux 虚拟机上运行 SQL Server 时出现的一些最常见问题的解答。This article provides answers to some of the most common questions about running SQL Server on Linux virtual machines.

如果本文未解决你的 Azure 问题,请访问 MSDN 和 CSDN 上的 Azure 论坛。If your Azure issue is not addressed in this article, visit the Azure forums on MSDN and CSDN. 可以在这些论坛上发布问题。You can post your issue in these forums. 还可提交 Azure 支持请求。You also can submit an Azure support request. 若要提交支持请求,请在 Azure 支持页上提交。To submit a support request, on the Azure support page.

映像Images

  1. 有哪些 SQL Server 虚拟机库映像可用?What SQL Server virtual machine gallery images are available?

    Azure 为所有 Linux 和 Windows 版本中所有受支持的 SQL Server 主要发行版维护虚拟机 (VM) 映像。Azure maintains virtual machine (VM) images for all supported major releases of SQL Server on all editions for both Linux and Windows. 有关更多详细信息,请参阅 Linux VM 映像Windows VM 映像的完整列表。For more details, see the complete list of Linux VM images and Windows VM images.

  2. 现有的 SQL Server 虚拟机库映像是否会更新?Are existing SQL Server virtual machine gallery images updated?

    每隔两个月,都会使用最新的 Linux 和 Windows 更新对虚拟机库中的 SQL Server 映像进行更新。Every two months, SQL Server images in the virtual machine gallery are updated with the latest Linux and Windows updates. 对于 Linux 映像,这包括最新的系统更新。For Linux images, this includes the latest system updates. 对于 Windows 映像,这包括 Windows 更新中标记为重要的任何更新,以及重要的 SQL Server 安全更新和服务包。For Windows images, this includes any updates that are marked as important in Windows Update, including important SQL Server security updates and service packs. Linux 和 Windows 的 SQL Server 累积更新以不同的方式进行处理。SQL Server cumulative updates are handled differently for Linux and Windows. 对于 Linux,SQL Server 累积更新也包含在刷新中。For Linux, SQL Server cumulative updates are also included in the refresh. 但目前,Windows VM 不会连同 SQL Server 或 Windows Server 累积更新一起更新。But at this time, Windows VMs are not updated with SQL Server or Windows Server cumulative updates.

  3. 还会安装哪些相关的 SQL Server 包?What related SQL Server packages are also installed?

    若要查看默认情况下在 Linux VM 上的 SQL Server 中安装的 SQL Server 包,请参阅已安装的包To see the SQL Server packages that are installed by default on SQL Server on Linux VMs, see Installed packages.

  4. 是否可以从库中删除 SQL Server 虚拟机映像?Can SQL Server virtual machine images get removed from the gallery?

    是的。Yes. Azure 只为每个主要版本维护一个映像。Azure only maintains one image per major version and edition. 例如,发布新的 SQL Server Service Pack 时,Azure 会将新映像添加到该 Service Pack 的库。For example, when a new SQL Server service pack is released, Azure adds a new image to the gallery for that service pack. 先前 Service Pack 的 SQL Server 映像将立即从 Azure 门户中删除。The SQL Server image for the previous service pack is immediately removed from the Azure portal. 但是,在接下来的三个月,仍可以通过 PowerShell 预配该映像。However, it is still available for provisioning from PowerShell for the next three months. 三个月之后,先前的 Service Pack 映像不再可用。After three months, the previous service pack image is no longer available. 如果 SQL Server 版本由于生命周期结束而不受支持,则也会应用此删除策略。This removal policy would also apply if a SQL Server version becomes unsupported when it reaches the end of its lifecycle.

创建Creation

  1. 如何创建装有 SQL Server 的 Linux 虚拟机?How do I create a Linux virtual machine with SQL Server?

    最简单的解决方法是创建包含 SQL Server 的 Linux 虚拟机。The easiest solution is to create a Linux virtual machine that includes SQL Server. 有关注册 Azure 并从门户创建 SQL Server VM 的教程,请参阅在 Azure 门户中预配运行 SQL Server 的 Linux 虚拟机For a tutorial on signing up for Azure and creating a SQL Server VM from the portal, see Provision a Linux virtual machine running SQL Server in the Azure portal. 此外,你也可以选用免费许可版(开发人员版或速成版),或通过重新使用本地许可证在 VM 上手动安装 SQL Server。You also have the option of manually installing SQL Server on a VM with either a freely licensed edition (Developer or Express) or by reusing an on-premises license. 如果自带许可,必须在 Azure 上通过软件保障实现许可证移动性If you bring your own license, you must have License Mobility through Software Assurance on Azure.

  2. 为什么无法使用有支出限制的 Azure 订阅来设置 RHEL 或 SLES SQL Server VM?Why can’t I provision an RHEL or SLES SQL Server VM with an Azure subscription that has a spending limit?

    RHEL 和 SLES 虚拟机需要无支出限制的订阅和与订阅相关联的经验证付款方式(通常为信用卡)。RHEL and SLES virtual machines require a subscription with no spending limit and a verified payment method (usually a credit card) associated with the subscription. 如果你在设置 RHEL 或 SLES VM 时没有删除支出限制,订阅将被禁用,并且所有 VM/服务都将停止。If you provision an RHEL or SLES VM without removing the spending limit, your subscription will get disabled and all VMs/services stopped. 如果你确实进入了此状态,请重新启用订阅删除支出限制If you do run into this state, to re-enable the subscription remove the spending limit. 如果你选择重新启动并继续运行,则剩余信用额度将在当前账单周期恢复,但 RHEL 或 SLES VM 映像附加费将会从你的信用卡中扣除。Your remaining credits will be restored for the current billing cycle but an RHEL or SLES VM image surcharge will go against your credit card if you choose to re-start and continue running it.

授权Licensing

  1. 如何在 Azure VM 上安装 SQL Server 的许可版本?How can I install my licensed copy of SQL Server on an Azure VM?

    首先,创建仅限 Linux OS 的虚拟机。First, create a Linux OS-only virtual machine. 然后,运行适用于 Linux 分发版的 SQL Server 安装步骤Then run the SQL Server installation steps for your Linux distribution. 除非你要安装 SQL Server 的一个免费许可版,否则还必须拥有 SQL Server 许可证和通过 Azure 上的软件保障的许可移动性Unless you are installing one of the freely licensed editions of SQL Server, you must also have a SQL Server license and License Mobility through Software Assurance on Azure.

  2. 是否有适用于 SQL Server 的自带许可 (BYOL) Linux 虚拟机映像?Are there Bring-Your-Own-License (BYOL) Linux virtual machine images for SQL Server?

    目前,没有适用于 SQL Server 的任何 BYOL Linux 虚拟机映像。At this time, there are no BYOL Linux virtual machine images for SQL Server. 但是,可以在仅限 Linux 的 VM 上手动安装 SQL Server ,如前面问题中所述。However, you can manually install SQL Server on a Linux-only VM as discussed in the previous questions.

  3. 如果 VM 是基于一个即用即付库映像创建的,是否可以将它更改为使用我自己的 SQL Server 许可证?Can I change a VM to use my own SQL Server license if it was created from one of the pay-as-you-go gallery images?

    否。No. 无法将按秒付费许可切换为使用自己的许可证。You cannot switch from pay-per-second licensing to using your own license. 你必须创建新的 Linux VM、安装 SQL Server,并迁移数据。You must create a new Linux VM, install SQL Server, and migrate your data. 请参阅前面的问题,了解有关使用自己许可证的详细信息。See the previous question for more details about bringing your own license.

管理Administration

  1. 是否可以使用 SQL Server Management Studio (SSMS) 管理运行 SQL Server 的 Linux 虚拟机?Can I manage a Linux virtual machine running SQL Server with SQL Server Management Studio (SSMS)?

    是的,但 SSMS 目前是仅限 Windows 的工具。Yes, but SSMS is currently a Windows-only tool. 必须从 Windows 计算机建立远程连接才能对运行 SQL Server 的 Linux VM 使用 SSMS。You must connect remotely from a Windows machine to use SSMS with Linux VMs running SQL Server. 在 Linux 本地,新的 mssql-conf 工具可以执行许多管理任务。Locally on Linux, the new mssql-conf tool can perform many administrative tasks. 有关跨平台数据库管理工具,请参阅 Azure Data StudioFor a cross-platform database management tool, see Azure Data Studio.

  2. 是否可从 SQL Server VM 中完全删除 SQL Server?Can I remove SQL Server completely from a SQL Server VM?

    是的,但仍将按照 SQL Server Azure VM 的定价指南收取 SQL Server VM 费用。Yes, but you will continue to be charged for your SQL Server VM as described in Pricing guidance for SQL Server Azure VMs. 如果不再需要 SQL Server,可以部署新的虚拟机并将数据和应用程序迁移到新的虚拟机。If you no longer need SQL Server, you can deploy a new virtual machine and migrate the data and applications to the new virtual machine. 然后可以删除 SQL Server 虚拟机。Then you can remove the SQL Server virtual machine.

更新和修补Updating and patching

  1. 如何将 Azure VM 中的 SQL Server 升级到新版本?How do I upgrade to a new version/edition of the SQL Server in an Azure VM?

    目前,对于在 Azure VM 中运行的 SQL Server,不提供就地升级。Currently, there is no in-place upgrade for SQL Server running in an Azure VM. 因此,请使用所需的 SQL Server 版本创建新的 Azure 虚拟机,然后使用标准数据迁移技术,将数据库迁移到新的服务器。Create a new Azure virtual machine with the desired SQL Server version/edition, and then migrate your databases to the new server using standard data migration techniques.

常规General

  1. Azure VM 是否支持 SQL Server 的高可用性解决方案?Are SQL Server high-availability solutions supported on Azure VMs?

    目前没有。Not at this time. Always On 可用性组和故障转移群集都需要 Linux 中的聚类分析解决方案,例如 Pacemaker。Always On availability groups and Failover Clustering both require a clustering solution in Linux, such as Pacemaker. SQL Server 支持的 Linux 发行版在云中不支持其高可用性加载项。The supported Linux distributions for SQL Server do not support their high availability add-ons in the cloud.

资源Resources

Linux VMLinux VMs:

Windows VMWindows VMs: