使用 Microsoft Azure Blob 存储服务进行 SQL Server 备份和还原SQL Server Backup and Restore with Microsoft Azure Blob Storage Service

适用对象: 是SQL Server 是Azure SQL 数据库(仅限托管实例)否Azure Synapse Analytics (SQL DW) 否并行数据仓库 APPLIES TO: yesSQL Server yesAzure SQL Database (Managed Instance only) noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

“备份到 Azure blob”图Backup to Azure blob graphic

本主题介绍将 SQL ServerSQL Server 备份到 Microsoft Azure Blob 存储服务和从中还原。This topic introduces SQL ServerSQL Server backups to and restoring from the Microsoft Azure Blob storage service. 它还总结了使用 Microsoft Azure Blob 服务存储 SQL ServerSQL Server 备份的好处。It also provides a summary of the benefits of using the Microsoft Azure Blob service to store SQL ServerSQL Server backups.

SQL Server 支持通过以下方式将备份存储到 Microsoft Azure Blob 存储服务:SQL Server supports storing backups to the Microsoft Azure Blob storage service in the following ways:

  • 管理存储到 Microsoft Azure 的备份: 使用与用于备份到磁盘和磁带相同的方法,即可通过将 URL 指定为备份目标立即备份到 Microsoft Azure 存储。Manage your backups to Microsoft Azure: Using the same methods used to backup to DISK and TAPE, you can now back up to Microsoft Azure storage by specifying URL as the backup destination. 可使用此功能手动备份或配置自己的备份策略,如同对于本地存储或其他站点外选项所做的一样。You can use this feature to manually backup or configure your own backup strategy like you would for a local storage or other off-site options. 此功能也称为 SQL Server 备份到 URLThis feature is also referred to as SQL Server Backup to URL. 有关详细信息,请参阅 SQL Server Backup to URLFor more information, see SQL Server Backup to URL. SQL Server 2012 SP1 CU2 或更高版本中提供此功能。This feature is available in SQL Server 2012 SP1 CU2 or later. 此功能在 SQL Server 2016 (13.x)SQL Server 2016 (13.x) 中得到了增强,以便通过使用块 Blob、共享访问签名和条带化提高性能和改进功能。This feature has been enhanced in SQL Server 2016 (13.x)SQL Server 2016 (13.x) to provide increased performance and functionality through the use of block blobs, Shared Access Signatures, and striping.

    备注

    对于版本低于 SQL Server 2012 SP1 CU2 的 SQL Server,可使用外接程序“SQL Server 备份到 Microsoft Azure 工具”快速轻松地向 Microsoft Azure 存储创建备份。For SQL Server versions previous to SQL Server 2012 SP1 CU2, you can use the add-in SQL Server Backup to Microsoft Azure Tool to quickly and easily create backups to Microsoft Azure storage. 有关详细信息,请参阅 下载中心For more information, see download center.

  • Azure Blob 存储中的数据库文件的文件快照备份 通过使用 Azure 快照, SQL ServerSQL Server 文件快照备份可以通过使用 Azure Blob 存储服务为存储的数据库文件提供几乎即时的备份和还原。File-Snapshot Backups for Database Files in Azure Blob Storage Through the use of Azure snapshots, SQL ServerSQL Server File-Snapshot Backups provide nearly instantaneous backups and restores for database files stored using the Azure Blob storage service. 此功能可以简化备份和还原策略,而且它还支持时间点还原。This capability enables you to simplify your backup and restore policies, and it supports for point in time restore. 有关详细信息,请参阅 Azure 中数据库文件的文件快照备份For more information, see File-Snapshot Backups for Database Files in Azure. SQL Server 2016 或更高版本中提供此功能。This feature is available in SQL Server 2016 or later.

  • 使 SQL Server 管理 Microsoft Azure 备份: 通过配置 SQL Server,来管理备份策略并为一个或多个数据库安排备份,或根据实例级别设置默认值。Let SQL Server Manage backups to Microsoft Azure: Configure SQL Server to manage the backup strategy and schedule backups for a single database, or several databases, or set defaults at the instance level. 此功能被称为 Microsoft Azure 的 SQL Server 托管备份SQL Server Managed Backup to Microsoft AzureThis feature is referred to as Microsoft Azure 的 SQL Server 托管备份SQL Server Managed Backup to Microsoft Azure. 有关详细信息,请参阅 Microsoft Azure 的 SQL Server 托管备份For more information see SQL Server Managed Backup to Microsoft Azure. SQL Server 2014 或更高版本中提供此功能。This feature is available in SQL Server 2014 or later.

将 Microsoft Azure Blob 服务用于 SQL ServerSQL Server 备份的好处Benefits of Using the Microsoft Azure Blob Service for SQL ServerSQL Server Backups

  • 灵活、可靠、无限制的站点外存储:在 Microsoft Azure Blob 服务上存储备份是一种既便捷灵活又易于访问的站点外存储方法。Flexible, reliable, and limitless off-site storage: Storing your backups on Microsoft Azure Blob service can be a convenient, flexible, and easy to access off-site option. 为您的 SQL ServerSQL Server 备份创建站点外存储就像修改您的现有脚本/作业一样简单。Creating off-site storage for your SQL ServerSQL Server backups can be as easy as modifying your existing scripts/jobs. 站点外存储位置通常应远离生产数据库位置,以防止出现同时影响站点外和生产数据库位置的一个灾难。Off-site storage should typically be far enough from the production database location to prevent a single disaster that might impact both the off-site and production database locations. 通过选择地理复制 Blob 存储区,您在发生可能影响整个区域的灾难时多了一层额外的保护。By choosing to geo replicate the Blob storage you have an extra layer of protection in the event of a disaster that could affect the whole region. 此外,备份副本随时随地可用,并可以轻松访问它们来执行还原。In addition, backups are available from anywhere and at any time and can easily be accessed for restores.

    重要

    SQL Server 2016 (13.x)SQL Server 2016 (13.x)中使用块 blob 可以条带化备份集,支持对大小高达 12.8 TB 的文件进行备份。Through the use of block blobs in SQL Server 2016 (13.x)SQL Server 2016 (13.x), you can stripe your backup set to support backup files sizes up to 12.8 TB.

  • 备份存档:在对备份进行存档时,Microsoft Azure Blob 存储服务能够提供可替代常用磁带存储方式的更好方式。Backup Archive: The Microsoft Azure Blob Storage service offers a better alternative to the often used tape option to archive backups. 磁带存储可能需要物理传输到站点外设施并采取措施来保护介质。Tape storage might require physical transportation to an off-site facility and measures to protect the media. 在 Microsoft Azure Blob 存储区中存储你的备份可以提供一个即时、高度可用、耐久的存档方案。Storing your backups in Microsoft Azure Blob Storage provides an instant, highly available, and a durable archiving option.

  • 无硬件管理开销:没有有关 Microsoft Azure 服务的硬件管理开销。No overhead of hardware management: There is no overhead of hardware management with Microsoft Azure services. Microsoft Azure 服务管理硬件并支持地理复制以提供冗余和防止硬件故障。Microsoft Azure services manage the hardware and provide geo-replication for redundancy and protection against hardware failures.

  • 当前对于在 Microsoft Azure 虚拟机中运行的 SQL ServerSQL Server 实例,可以通过创建附加的磁盘来备份到 Microsoft Azure Blob 存储服务。Currently for instances of SQL ServerSQL Server running in a Microsoft Azure Virtual Machine, backing up to Microsoft Azure Blob storage services can be done by creating attached disks. 但是,对于可以附加到 Microsoft Azure 虚拟机的磁盘数有限制。However, there is a limit to the number of disks you can attach to a Microsoft Azure Virtual Machine. 限制值为:超大实例最多使用 16 个磁盘,较小的实例可使用的磁盘则更少。This limit is 16 disks for an extra large instance and fewer for smaller instances. 通过允许直接备份到 Microsoft Azure Blob 存储区,你可以绕过 16 个磁盘的限制。By enabling a direct backup to Microsoft Azure Blob Storage, you can bypass the 16 disk limit.

    此外,目前存储在 Microsoft Azure Blob 存储服务中的备份文件直接可用于本地 SQL ServerSQL Server 或在 Microsoft Azure 虚拟机中运行的其他 SQL ServerSQL Server ,而无需进行数据库附加/分离或下载并附加 VHD。In addition, the backup file which now is stored in the Microsoft Azure Blob storage service is directly available to either an on-premises SQL ServerSQL Server or another SQL ServerSQL Server running in a Microsoft Azure Virtual Machine, without the need for database attach/detach or downloading and attaching the VHD.

  • 成本权益:只需要为使用的服务付费。Cost Benefits: Pay only for the service that is used. 可以作为经济合算的站点外备份存档方案。Can be cost-effective as an off-site and backup archive option. 有关详细信息和链接,请参阅 Microsoft Azure 计费注意事项 一节。See the Microsoft Azure Billing Considerations section for more information and links.

Microsoft Azure 计费注意事项:Microsoft Azure Billing Considerations:

了解 Microsoft Azure 存储成本使你能够预测在 Microsoft Azure 中创建和存储备份的成本。Understanding Microsoft Azure storage costs enables you to forecast the cost of creating and storing backups in Microsoft Azure.

Microsoft Azure 价格计算器 可以帮助估算你的成本。The Microsoft Azure pricing calculator can help estimate your costs.

存储: 根据所使用的空间以及分级比例和冗余级别来计算费用。Storage: Charges are based on the space used and are calculated on a graduated scale and the level of redundancy. 有关详细信息和最新信息,请参阅 定价详细信息 文章中的“数据管理” 一节。For more details, and up-to-date information, see the Data Management section of the Pricing Details article.

数据传输: Microsoft Azure 的入站数据传输是免费的。Data Transfers: Inbound data transfers to Microsoft Azure are free. 出站传输要支付带宽使用费用,并根据渐变的区域特定标准来计算费用。Outbound transfers are charged for the bandwidth use and calculated based on a graduated region-specific scale. 有关详细信息,请参阅“定价详细信息”文章中的 数据传输 一节。For more details, see the Data Transfers section of the Pricing Details article.

另请参阅See Also

SQL Server 备份到 URL 最佳实践和故障排除SQL Server Backup to URL Best Practices and Troubleshooting

备份和还原系统数据库 (SQL Server)Back Up and Restore of System Databases (SQL Server)

教程:将 Microsoft Azure Blob 存储服务用于 SQL Server 2016 数据库Tutorial: Using the Microsoft Azure Blob storage service with SQL Server 2016 databases

SQL Server 备份到 URLSQL Server Backup to URL