备份已启用延伸的数据库 (Stretch Database)Backup Stretch-enabled databases (Stretch Database)

本主题适用于:yesSQL Server(仅从 2016 开始的 Windows)noAzure SQL 数据库noAzure SQL 数据仓库no并行数据仓库THIS TOPIC APPLIES TO: yesSQL Server (Windows only starting with 2016)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

数据库备份有助于你从许多类型的故障、错误和灾难中恢复。Database backups help you to recover from many types of failures, errors, and disasters.

  • 必须对已启用延伸的 SQL Server 数据库进行备份。You have to back up your Stretch-enabled SQL Server databases.

  • Microsoft Azure 将自动备份 Stretch Database 已从 SQL Server 迁移到 Azure 的远程数据。Microsoft Azure automatically backs up the remote data that Stretch Database has migrated from SQL Server to Azure.

提示

备份仅仅是完整的高可用性和业务连续性解决方案的一部分。Backup is only one part of a complete high availability and business continuity solution. 有关高可用性的详细信息,请参阅 高可用性解决方案For more info about high availability, see High Availability Solutions.

备份 SQL Server 数据Back up your SQL Server data

若要备份已启用延伸的 SQL Server 数据库,可以继续使用目前所用的 SQL Server 备份方法。To back up your Stretch-enabled SQL Server databases, you can continue to use the SQL Server backup methods that you currently use. 有关详细信息,请参阅 SQL Server 数据库的备份和还原For more info, see Back Up and Restore of SQL Server Databases.

已启用延伸的 SQL Server 数据库备份只包含该备份运行时所处时间点的本地数据和符合迁移条件的数据。Backups of a Stretch-enabled SQL Server database contain only local data and data eligible for migration at the point in time when the backup runs. (符合条件的数据是指尚未迁移,但会根据表的迁移设置迁移到 Azure 的数据。)这称为浅表备份,这种备份不会包括已迁移到 Azure 的数据。(Eligible data is data that has not yet been migrated, but will be migrated to Azure based on the migration settings of the tables.) This is known as a shallow backup and does not include the data already migrated to Azure.

备份远程 Azure 数据Back up your remote Azure data

Microsoft Azure 将自动备份 Stretch Database 已从 SQL Server 迁移到 Azure 的远程数据。Microsoft Azure automatically backs up the remote data that Stretch Database has migrated from SQL Server to Azure.

Azure 可降低自动备份时数据丢失的风险Azure reduces the risk of data loss with automatic backup

Azure 上的 SQL Server Stretch Database 服务通过自动存储快照(至少每隔 8 小时)保护你的远程数据库。The SQL Server Stretch Database service on Azure protects your remote databases with automatic storage snapshots at least every 8 hours. 每张快照将保留 7 天,为你提供一系列可能的还原点。It retains each snapshot for 7 days to provide you with a range of possible restore points.

Azure 可降低地域冗余带来的数据丢失的风险Azure reduces the risk of data loss with geo-redundancy

Azure 数据库备份存储在地域冗余 Azure 存储 (RA-GRS) 上,因此默认为地域冗余。Azure database backups are stored on geo-redundant Azure Storage (RA-GRS) and are therefore geo-redundant by default. 地域冗余存储会将你的数据复制到距主要区域数百英里的次要区域。Geo-redundant storage replicates your data to a secondary region that is hundreds of miles away from the primary region. 你的数据会在主要区域和次要区域中跨单独的容错域和升级域分别复制三次。In both primary and secondary regions, your data is replicated three times each, across separate fault domains and upgrade domains. 这可确保即使遇到整个区域停电或致使 Azure 其中一个区域不可用的灾难时,你的数据仍是持久的。This ensures that your data is durable even in the case of a complete regional outage or disaster that renders one of the Azure regions unavailable.

Stretch Database 通过暂时保留已迁移行来降低 Azure 数据的数据丢失风险Stretch Database reduces the risk of data loss for your Azure data by retaining migrated rows temporarily

Stretch Database 将符合条件的行从 SQL Server 迁移至 Azure 后,其会将这些行保留到临时表中(至少 8 小时)。After Stretch Database migrates eligible rows from SQL Server to Azure, it retains those rows in the staging table for a minimum of 8 hours. 如果还原 Azure 数据库的备份,Stretch Database 将使用保存在临时表中的行来协调 SQL Server 和 Azure 的数据库。If you restore a backup of your Azure database, Stretch Database uses the rows saved in the staging table to reconcile the SQL Server and the Azure databases.

还原 Azure 数据的备份后,必须运行 sys.sp_rda_reauthorize_db 存储过程,重新将已启用延伸的 SQL Server 数据库连接至远程 Azure 数据库。After you restore a backup of your Azure data, you have to run the stored procedure sys.sp_rda_reauthorize_db to reconnect the Stretch-enabled SQL Server database to the remote Azure database. 当你运行 sys.sp_rda_reauthorize_db时,Stretch Database 将自动协调 SQL Server 和 Azure 的数据库。When you run sys.sp_rda_reauthorize_db, Stretch Database automatically reconciles the SQL Server and the Azure databases.

若要增加 Stretch Database 暂时保留到临时表中的已迁移数据的小时数,运行 sys.sp_rda_set_rpo_duration 存储过程并指定大于 8 的小时数。To increase the number of hours of migrated data that Stretch Database retains temporarily in the staging table, run the stored procedure sys.sp_rda_set_rpo_duration and specify a number of hours greater than 8. 若要确定要保留数据的数量,请考虑以下因素:To decide how much data to retain, consider the following factors:

  • Azure 自动备份的频率(至少每隔 8 小时)。The frequency of automatic Azure backups (at least every 8 hours).
  • 出现问题后识别问题和决定恢复备份所需的时间。The time required after a problem to recognize the problem and to decide to restore a backup.
  • Azure 还原操作的持续时间。The duration of the Azure restore operation.

备注

增加 Stretch Database 暂时保留到临时表中的已迁移数据的数量会增加 SQL Server 所需的空间大小。Increasing the amount of data that Stretch Database retains temporarily in the staging table increases the amount of space required on the SQL Server.

若要查看 Stretch Database 暂时保留到临时表中的数据的小时数,请运行 sys.sp_rda_set_rpo_duration存储过程。To check the number of hours of data that Stretch Database currently retains temporarily in the staging table, run the stored procedure sys.sp_rda_get_rpo_duration.

另请参阅See Also

还原已启用延伸的数据库Restore Stretch-enabled databases
对 Stretch Database 进行管理和故障排除Manage and troubleshoot Stretch Database