Stretch DatabaseStretch Database

适用对象: 是SQL Server 2016 及更高版本(仅限 Windows)否Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库APPLIES TO: YesSQL Server 2016 and later (Windows only) NoAzure SQL Database NoAzure Synapse Analytics (SQL DW) NoParallel Data Warehouse

Stretch Database 可以既透明又安全地将冷数据迁移到 Microsoft Azure 云。Stretch Database migrates your cold data transparently and securely to the Microsoft Azure cloud.

如果你想立即开始使用 Stretch Database,请参阅 通过运行“启用数据库延伸向导”开始If you just want to get started with Stretch Database right away, see Get started by running the Enable Database for Stretch Wizard.

Stretch Database 的优点是什么?What are the benefits of Stretch Database?

延伸数据库提供以下优势:Stretch Database provides the following benefits:

可以通过经济高效的方式来使用冷数据Provides cost-effective availability for cold data
使用 SQL Server Stretch Database 将冷暖事务数据从 SQL Server 动态延伸到 Microsoft Azure。Stretch warm and cold transactional data dynamically from SQL Server to Microsoft Azure with SQL Server Stretch Database. 与典型的冷数据存储不同,数据将始终联机且可供查询。Unlike typical cold data storage, your data is always online and available to query. 可以提供更长的数据保留时限,而不会破坏大型表(如客户订单历史记录)的存储库。You can provide longer data retention timelines without breaking the bank for large tables like Customer Order History. 受益于 Azure 的低成本,无需扩展价格不菲的本地存储。Benefit from the low cost of Azure rather than scaling expensive, on-premises storage. 你可以在 Azure 门户中选择定价层并配置设置,因此始终能够对价格和成本进行控制。You choose the pricing tier and configure settings in the Azure Portal to maintain control over price and costs. 根据需要扩展或缩减。Scale up or down as needed. 有关详细信息,请访问 SQL Server Stretch Database 定价Visit SQL Server Stretch Database Pricing for details.

无需更改查询或应用程序Doesn't require changes to queries or applications
无缝访问 SQL Server 数据,不管这些数据是位于本地还是延伸到云中。Access your SQL Server data seamlessly regardless of whether it's on-premises or stretched to the cloud. 可以设置策略来确定数据的存储位置,SQL Server 会在后台处理数据移动。You set the policy that determines where data is stored, and SQL Server handles the data movement in the background. 整个表始终处于联机状态,始终可供查询。The entire table is always online and queryable. 而且,Stretch Database 无需对现有查询或应用程序进行任何更改,数据的位置对应用程序来说是完全透明的。And, Stretch Database doesn't require any changes to existing queries or applications - the location of the data is completely transparent to the application.

简化了本地数据维护过程Streamlines on-premises data maintenance
降低了数据的本地维护和存储成本Reduce on-premises maintenance and storage for your data. 对本地数据的备份运行速度更快,并在维护时段内完成。Backups for your on-premises data run faster and finish within the maintenance window. 自动运行对数据的云部分的备份。Backups for the cloud portion of your data run automatically. 你对本地存储的需求大大减少。Your on-premises storage needs are greatly reduced. 与在本地 SSD 中添加数据相比,使用 Azure 存储可将费用较低 80%。Azure storage can be 80% less expensive than adding to on-premises SSD.

即使在迁移过程中,也会确保数据的安全性Keeps your data secure even during migration
可以高枕无忧地将最重要的应用程序安全延伸到云中。Enjoy peace of mind as you stretch your most important applications securely to the cloud. SQL Server 的 Always Encrypted 功能为数据提供动态加密。SQL Server's Always Encrypted provides encryption for your data in motion. 行级别安全性 (RLS) 和其他高级 SQL Server 安全功能也能配合延伸数据库来保护数据。Row Level Security (RLS) and other advanced SQL Server security features also work with Stretch Database to protect your data.

延伸数据库的作用是什么?What does Stretch Database do?

为 SQL Server 实例、数据库启用 Stretch Database 并且选择至少一个表以后,Stretch Database 就会开始以静默方式将你的冷数据迁移到 Azure。After you enable Stretch Database for a SQL Server instance and a database, and select at least one table, Stretch Database silently begins to migrate your cold data to Azure.

  • 如果在单独的某个表中存储了冷数据,可以迁移整个表。If you store cold data in a separate table, you can migrate the entire table.

  • 如果表同时包含热数据和冷数据,可以指定筛选器函数来选择要迁移的行。If your table contains both hot and cold data, you can specify a filter function to select the rows to migrate.

不需更改现有查询和客户端应用。You don't have to change existing queries and client apps. 即使在数据迁移过程中,也可以持续顺畅访问本地数据和远程数据。You continue to have seamless access to both local and remote data, even during data migration. 远程查询会出现轻微的延迟,但仅查询冷数据时,才会遇到这种延迟。There is a small amount of latency for remote queries, but you only encounter this latency when you query the cold data.

Stretch Database 可以确保迁移过程中无数据丢失 (即使发生故障)。Stretch Database ensures that no data is lost if a failure occurs during migration. 它还可以通过重试逻辑来处理迁移过程中可能会发生的连接问题。It also has retry logic to handle connection issues that may occur during migration. 动态管理视图提供迁移的状态。A dynamic management view provides the status of migration.

可以暂停数据迁移 以排查本地服务器上的问题或者最大程度地提供可用网络带宽。You can pause data migration to troubleshoot problems on the local server or to maximize the available network bandwidth.

Stretch Database 概述Stretch database overview

Stretch Database 是否适合你?Is Stretch Database for you?

如果与下表中的表述相符,则延伸数据库可以帮助你满足要求和解决问题。If you can make the following statements, Stretch Database may help to meet your requirements and solve your problems.

如果是决策人If you're a decision maker 如果是数据库管理员If you're a DBA
我必须长期保留事务数据。I have to keep transactional data for a long time. 我的表大小正在失控。The size of my tables is getting out of control.
有时候,我必须查询冷数据。Sometimes I have to query the cold data. 我的用户说他们想要访问冷数据,但只是偶尔使用。My users say that they want access to cold data, but they only rarely use it.
我安装了应用(包括较旧的应用),我不想对其进行更新。I have apps, including older apps, that I don't want to update. 我必须不断地购买和添加更多的存储。I have to keep buying and adding more storage.
我想找到一种节省存储费用的方法。I want to find a way to save money on storage. 我不能在 SLA 条件下备份或还原此类大型表。I can't backup or restore such large tables within the SLA.

哪种类型的数据库和表符合延伸数据库条件?What kind of databases and tables are candidates for Stretch Database?

Stretch Database 针对的是包含大量冷数据的事务数据库,这些冷数据通常存储在少量表中。Stretch Database targets transactional databases with large amounts of cold data, typically stored in a small number of tables. 这些表可能包含 10 亿多行。These tables may contain more than a billion rows.

如果你使用 SQL ServerSQL Server的临时表功能,则可使用 Stretch Database 将所有或部分关联的历史表迁移到 Azure 经济高效的存储中。If you use the temporal table feature of SQL ServerSQL Server, use Stretch Database to migrate all or part of the associated history table to cost-effective storage in Azure. 有关详细信息,请参阅 管理版本由系统控制的临时表中历史数据的保留期For more info, see Manage Retention of Historical Data in System-Versioned Temporal Tables.

使用 SQL Server 2016 升级顾问的一项功能 - 延伸数据库顾问 - 可以识别符合延伸数据库条件的数据库和表。Use Stretch Database Advisor, a feature of SQL Server 2016 Upgrade Advisor, to identify databases and tables for Stretch Database. 有关详细信息,请参阅 通过运行 Stretch Database 顾问标识适用于 Stretch Database 的数据库和表For more info, see Identify databases and tables for Stretch Database by running Stretch Database Advisor. 若要了解有关潜在阻滞问题的详细信息,请参阅 Stretch Database 的局限性To learn more about potential blocking issues, see Limitations for Stretch Database.

试用 Stretch DatabaseTest drive Stretch Database

通过 AdventureWorks 示例数据库试用 Stretch Database。Test drive Stretch Database with the AdventureWorks sample database. 若要获取 AdventureWorks 示例数据库,必须从 此处To get the AdventureWorks sample database, download at least the database file and the samples and scripts file from here. 将示例数据库还原到 SQL Server 2016 实例后,解压缩示例文件,然后从 Stretch DB 文件夹打开 Stretch DB Samples 文件。After you restore the sample database to an instance of SQL Server 2016, unzip the samples file and open the Stretch DB Samples file from the Stretch DB folder. 运行此文件中的脚本来检查启用 Stretch Database 之前和之后数据使用的空间、跟踪数据迁移的进度,以及确认你是否可以继续在数据迁移期间和之后查询现有数据和插入新数据。Run the scripts in this file to check the space used by your data before and after you enable Stretch Database, to track the progress of data migration, and to confirm that you can continue to query existing data and insert new data both during and after data migration.

后续步骤Next step

确定适用于 Stretch Database 的数据库和表。Identify databases and tables that are candidates for Stretch Database. 下载数据迁移助手并运行评估,以标识为 Stretch Database 候选项的数据库和表。Download the Data Migration Assistant and run an Assessment to identify databases and tables that are candidates for Stretch Database. 有关详细信息,请参阅 通过运行 Stretch Database 顾问标识适用于 Stretch Database 的数据库和表For more info, see Identify databases and tables for Stretch Database by running Stretch Database Advisor.