将 SQL Server 备份到 Azure 作为 DPM 工作负荷Back up SQL Server to Azure as a DPM workload

本文将引导你使用 Azure 备份完成 SQL Server 数据库的备份配置步骤。This article leads you through the configuration steps to back up SQL Server databases by using Azure Backup.

若要将 SQL Server 数据库备份到 Azure,需要一个 Azure 帐户。To back up SQL Server databases to Azure, you need an Azure account. 如果没有帐户,只需花费几分钟就能创建一个免费帐户。If you don't have one, you can create a free account in just a few minutes. 有关详细信息,请参阅创建 Azure 免费帐户For more information, see Create your Azure free account.

若要将 SQL Server 数据库备份到 Azure 并从 Azure 恢复该数据库:To back up a SQL Server database to Azure and to recover it from Azure:

  1. 创建一个备份策略用于保护 Azure 中的 SQL Server 数据库。Create a backup policy to protect SQL Server databases in Azure.
  2. 在 Azure 中创建按需备份副本。Create on-demand backup copies in Azure.
  3. 从 Azure 恢复数据库。Recover the database from Azure.

开始之前Before you start

在开始之前,请确保符合使用 Azure 备份保护工作负荷的先决条件Before you begin, ensure you've met the prerequisites for using Azure Backup to protect workloads. 下面是一些前提任务:Here are some of the prerequisite tasks:

  • 创建备份保管库。Create a backup vault.
  • 下载保管库凭据。Download vault credentials.
  • 安装 Azure 备份代理。Install the Azure Backup agent.
  • 将服务器注册到保管库。Register the server with the vault.

创建备份策略Create a backup policy

若要保护 Azure 中的 SQL Server 数据库,请先创建一个备份策略:To protect SQL Server databases in Azure, first create a backup policy:

  1. 在 Data Protection Manager (DPM) 服务器上选择“保护”工作区。 On the Data Protection Manager (DPM) server, select the Protection workspace.

  2. 选择“新建”以创建保护组。 Select New to create a protection group.

    创建保护组

  3. 在“开始”页上,查看有关创建保护组的指导。On the start page, review the guidance about creating a protection group. 然后,选择“下一步” 。Then select Next.

  4. 选择“服务器”。Select Servers.

    选择“服务器”保护组类型

  5. 展开要备份的数据库所在的 SQL Server 计算机。Expand the SQL Server machine where the databases that you want to back up are located. 将会看到可从该服务器备份的数据源。You see the data sources that can be backed up from that server. 展开“所有 SQL 共享”,然后选择要备份的数据库。 Expand All SQL Shares and then select the databases that you want to back up. 此示例选择了 ReportServer$MSDPM2012 和 ReportServer$MSDPM2012TempDB。In this example, we select ReportServer$MSDPM2012 and ReportServer$MSDPM2012TempDB. 然后,选择“下一步” 。Then select Next.

    选择 SQL Server 数据库

  6. 为保护组命名,然后选择“我需要在线保护”。 Name the protection group and then select I want online protection.

    选择数据保护方法 - 短期磁盘保护,或联机 Azure 保护

  7. 在“指定短期目标”页上,提供在磁盘中创建备份点所需的输入。 On the Specify Short-Term Goals page, include the necessary inputs to create backup points to the disk.

    在此示例中,“保留期”设置为“5 天”。 In this example, Retention range is set to 5 days. 备份“同步频率”设置为每隔“15 分钟”一次。 The backup Synchronization frequency is set to once every 15 minutes. “快速完整备份”设置为“晚上 8:00”。 Express Full Backup is set to 8:00 PM.

    设置备份保护的短期目标

    备注

    在此示例中,将在每天晚上 8:00 创建一个备份点。In this example, a backup point is created at 8:00 PM every day. 将传输自前一天晚上 8:00 的备份点以来修改了的数据。The data that has been modified since the previous day's 8:00 PM backup point is transferred. 此过程称为 快速完整备份This process is called Express Full Backup. 尽管事务日志每隔 15 分钟同步一次,但如果需要在晚上 9:00 恢复数据库,则会重播自上一个快速完整备份点(在本示例中为晚上 8 点)以来的日志,从而创建备份点。Although the transaction logs are synchronized every 15 minutes, if we need to recover the database at 9:00 PM, then the point is created by replaying the logs from the last express full backup point, which is 8:00 PM in this example.

  8. 选择“下一步”。Select Next. DPM 将显示可用的总存储空间。DPM shows the overall storage space available. 它还显示潜在的磁盘空间利用率。It also shows the potential disk space utilization.

    设置磁盘分配

    默认情况下,DPM 将为每个数据源(SQL Server 数据库)创建一个卷。By default, DPM creates one volume per data source (SQL Server database). 该卷用作初始备份副本。The volume is used for the initial backup copy. 在此配置中,逻辑磁盘管理器 (LDM) 会限制 DPM 最多只能保护 300 个数据源(SQL Server 数据库)。In this configuration, Logical Disk Manager (LDM) limits DPM protection to 300 data sources (SQL Server databases). 若要避免此限制,请选择“在 DPM 存储池中共置数据”。 To work around this limitation, select Co-locate data in DPM Storage Pool. 如果使用此选项,DPM 将对多个数据源使用单个卷。If you use this option, DPM uses a single volume for multiple data sources. 这种设置可让 DPM 保护最多 2,000 个 SQL Server 数据库。This setup allows DPM to protect up to 2,000 SQL Server databases.

    如果选择“自动增大卷”,DPM 可以随着生产数据的增长考虑增大备份卷。 If you select Automatically grow the volumes, then DPM can account for the increased backup volume as the production data grows. 如果未选择“自动增大卷”,DPM 会限制保护组中用于备份数据源的备份存储的大小。 If you don't select Automatically grow the volumes, then DPM limits the backup storage to the data sources in the protection group.

  9. 如果你是管理员,可以选择“自动通过网络”传输此初始备份并选择传输时间。 If you're an administrator, you can choose to transfer this initial backup Automatically over the network and choose the time of transfer. 或者选择“手动”传输备份。 Or choose to Manually transfer the backup. 然后,选择“下一步” 。Then select Next.

    选择副本创建方法

    初始备份副本需要传输整个数据源(SQL Server 数据库)。The initial backup copy requires the transfer of the entire data source (SQL Server database). 备份数据从生产服务器(SQL Server 计算机)转移到 DPM 服务器。The backup data moves from the production server (SQL Server machine) to the DPM server. 如果此备份很大,通过网络传输数据可能会造成带宽拥塞。If this backup is large, then transferring the data over the network could cause bandwidth congestion. 出于此原因,管理员可以选择使用可移动媒体以“手动”方式传输初始备份。 For this reason, administrators can choose to use removable media to transfer the initial backup Manually. 或者,他们可以在指定的时间“自动通过网络”传输数据。 Or they can transfer the data Automatically over the network at a specified time.

    初始备份完成后,备份将在初始备份副本的基础上以增量方式继续进行。After the initial backup finishes, backups continue incrementally on the initial backup copy. 增量备份往往比较小,能轻松地通过网络传输。Incremental backups tend to be small and are easily transferred across the network.

  10. 选择何时运行一致性检查。Choose when to run a consistency check. 然后,选择“下一步” 。Then select Next.

    选择何时运行一致性检查

    DPM 可以运行一致性检查来检查备份点的完整性。DPM can run a consistency check on the integrity of the backup point. 它会计算生产服务器(在本示例中为 SQL Server 计算机)上的备份文件和 DPM 中该文件的已备份数据的校验和。It calculates the checksum of the backup file on the production server (the SQL Server machine in this example) and the backed-up data for that file in DPM. 如果检查发现冲突,则认为 DPM 中的备份文件已损坏。If the check finds a conflict, then the backed-up file in DPM is assumed to be corrupt. DPM 通过发送与校验和不匹配部分相对应的块,来修复备份的数据。DPM fixes the backed-up data by sending the blocks that correspond to the checksum mismatch. 由于一致性检查是对性能影响很大的操作,因此管理员可以选择是按计划运行还是自动运行一致性检查。Because the consistency check is a performance-intensive operation, administrators can choose to schedule the consistency check or run it automatically.

  11. 选择要在 Azure 中保护的数据源。Select the data sources to protect in Azure. 然后,选择“下一步” 。Then select Next.

    选择要在 Azure 中保护的数据源

  12. 如果你是管理员,可以选择适合组织策略的备份计划和保留策略。If you're an administrator, you can choose backup schedules and retention policies that suit your organization's policies.

    选择计划和保留策略

    在此示例中,将在每天中午 12:00 和晚上 8:00 创建备份。In this example, backups are taken daily at 12:00 PM and 8:00 PM.

    提示

    若要快速恢复,可在磁盘上设置几个短期恢复点。For quick recovery, keep a few short-term recovery points on your disk. 这些恢复点适用于“操作恢复”。These recovery points are used for operational recovery. Azure 提供很高的 SLA 和有保障的可用性,因此可充当理想的场外位置。Azure serves as a good offsite location, providing higher SLAs and guaranteed availability.

    使用 DPM 将 Azure 备份计划在本地磁盘备份完成之后。Use DPM to schedule Azure Backups after the local disk backups finish. 如果遵循此做法,最新的磁盘备份将复制到 Azure。When you follow this practice, the latest disk backup is copied to Azure.

  13. 选择保留策略计划。Choose the retention policy schedule. 有关保留策略工作原理的详细信息,请参阅使用 Azure 备份来取代磁带基础结构For more information about how the retention policy works, see Use Azure Backup to replace your tape infrastructure.

    选择保留策略

    在本示例中:In this example:

    • 将在每天中午 12:00 和晚上 8:00 创建备份。Backups are taken daily at 12:00 PM and 8:00 PM. 备份保留 180 天。They're kept for 180 days.
    • 在星期六中午 12:00 创建的备份将保留 104 周。The backup on Saturday at 12:00 PM is kept for 104 weeks.
    • 在每月最后一个星期六中午 12:00 创建的备份将保留 60 个月。The backup from the last Saturday of the month at 12:00 PM is kept for 60 months.
    • 在 3 月最后一个星期六中午 12:00 创建的备份将保留 10 年。The backup from the last Saturday of March at 12:00 PM is kept for 10 years.

    选择保留策略后,选择“下一步”。 After you choose a retention policy, select Next.

  14. 选择如何将初始备份副本传输到 Azure。Choose how to transfer the initial backup copy to Azure.

    • “自动通过网络”选项按照备份计划将数据传输到 Azure。 The Automatically over the network option follows your backup schedule to transfer the data to Azure.

    选择传输机制后,选择“下一步”。 After you choose a transfer mechanism, select Next.

  15. 在“摘要”页上复查策略详细信息。 On the Summary page, review the policy details. 然后选择“创建组”。 Then select Create group. 可以选择“关闭”,并在“监视”工作区中监视作业进度。 You can select Close and watch the job progress in the Monitoring workspace.

    保护组的创建进度

创建 SQL Server 数据库的按需备份副本Create on-demand backup copies of a SQL Server database

首次备份时会创建一个恢复点。A recovery point is created when the first backup occurs. 可以手动触发恢复点的创建,而不必等待计划运行:Rather than waiting for the schedule to run, you can manually trigger the creation of a recovery point:

  1. 在保护组中,确保数据库状态为“正常”。 In the protection group, make sure the database status is OK.

    显示了数据库状态的保护组

  2. 右键单击该数据库并选择“创建恢复点”。 Right-click the database and then select Create recovery point.

    选择创建在线恢复点

  3. 在下拉菜单中选择“在线保护”。 In the drop-down menu, select Online protection. 然后选择“确定”开始在 Azure 中创建恢复点。 Then select OK to start the creation of a recovery point in Azure.

    开始在 Azure 中创建恢复点

  4. 可以在“监视”工作区中查看作业进度。 You can view the job progress in the Monitoring workspace.

    在监视控制台中查看作业进度

从 Azure 恢复 SQL Server 数据库Recover a SQL Server database from Azure

若要从 Azure 恢复受保护的实体(例如某个 SQL Server 数据库):To recover a protected entity, such as a SQL Server database, from Azure:

  1. 打开 DPM 服务器管理控制台。Open the DPM server management console. 转到“恢复”工作区查看 DPM 备份的服务器。 Go to the Recovery workspace to see the servers that DPM backs up. 选择数据库(在本示例中为 ReportServer$MSDPM2012)。Select the database (in this example, ReportServer$MSDPM2012). 选择以 Online 结尾的恢复时间Select a Recovery time that ends with Online.

    选择恢复点

  2. 右键单击数据库名称并选择“恢复”。 Right-click the database name and select Recover.

    从 Azure 恢复数据库

  3. DPM 会显示恢复点的详细信息。DPM shows the details of the recovery point. 选择“下一步”。Select Next. 选择恢复类型“恢复到 SQL Server 的原始实例”。To overwrite the database, select the recovery type Recover to original instance of SQL Server. 然后,选择“下一步” 。Then select Next.

    将数据库恢复到其原始位置

    在本示例中,DPM 允许将数据库恢复到另一个 SQL Server 实例或独立的网络文件夹。In this example, DPM allows the database to be recovered to another SQL Server instance or to a standalone network folder.

  4. 在“指定恢复选项”页上,可以选择恢复选项。 On the Specify Recovery Options page, you can select the recovery options. 例如,可以选择“网络带宽使用限制”,以限制恢复操作所占用的带宽。 For example, you can choose Network bandwidth usage throttling to throttle the bandwidth that recovery uses. 然后,选择“下一步” 。Then select Next.

  5. 在“摘要”页上,可以看到当前的恢复配置。 On the Summary page, you see the current recovery configuration. 选择“恢复”。 Select Recover.

    恢复状态显示数据库正在恢复。The recovery status shows the database being recovered. 可以选择“关闭”来关闭向导,并在“监视”工作区中查看进度。 You can select Close to close the wizard and view the progress in the Monitoring workspace.

    启动恢复过程

    恢复完成后,还原的数据库将与应用程序保持一致。When the recovery is complete, the restored database is consistent with the application.

后续步骤Next steps

有关详细信息,请参阅 Azure 备份常见问题解答For more information, see Azure Backup FAQ.