Академический Документы
Профессиональный Документы
Культура Документы
Overview
Limitations and blocking issues
Get Started
Identify databases and tables
Run the wizard
Configure compatible features
How To
Enable
Enable a database
Enable a table
Select rows to migrate
Manage
Monitor migration
Pause and resume migration
Manage and troubleshoot
Back up
Restore
Disable and bring back data
Extended events
Resources
Pricing
Blog
Service updates
Videos
Stretch Database
4/12/2017 • 4 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
Stretch Database migrates your cold data transparently and securely to the Microsoft Azure cloud.
If you just want to get started with Stretch Database right away, see Get started by running the Enable Database for
Stretch Wizard.
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. 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 targets transactional databases with large amounts of cold data, typically stored in a small
number of tables. These tables may contain more than a billion rows.
If you use the temporal table feature of SQL 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.
Use Stretch Database Advisor, a feature of SQL Server 2016 Upgrade Advisor, to identify databases and tables for
Stretch Database. For more info, see Identify databases and tables for Stretch Database by running Stretch
Database Advisor. To learn more about potential blocking issues, see Limitations for Stretch Database.
Next step
Identify databases and tables that are candidates for Stretch Database. Download SQL Server 2016
Upgrade Advisor and run the Stretch Database Advisor to identify databases and tables that are candidates for
Stretch Database. Stretch Database Advisor also identifies blocking issues. For more info, see Identify databases
and tables for Stretch Database by running Stretch Database Advisor.
Limitations for Stretch Database
4/12/2017 • 1 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
Learn about limitations for Stretch-enabled tables, and about limitations that currently prevent you from enabling
Stretch for a table.
Limitations that currently prevent you from enabling Stretch for a table
The following items currently prevent you from enabling Stretch for a table.
Table properties
Tables that have more than 1,023 columns or more than 998 indexes
FileTables or tables that contain FILESTREAM data
Tables that are replicated, or that are actively using Change Tracking or Change Data Capture
Memory-optimized tables
Data types
text, ntext and image
timestamp
sql_variant
XML
CLR data types including geometry, geography, hierarchyid, and CLR user-defined types
Column types
COLUMN_SET
Computed columns
Constraints
Default constraints and check constraints
Foreign key constraints that reference the table. In a parent-child relationship (for example, Order and
Order_Detail), you can enable Stretch for the child table (Order_Detail) but not for the parent table (Order).
Indexes
Full text indexes
XML indexes
Spatial indexes
Indexed views that reference the table
See Also
Identify databases and tables for Stretch Database by running Stretch Database Advisor
Enable Stretch Database for a database
Enable Stretch Database for a table
Stretch Database databases and tables - Stretch
Database Advisor
4/12/2017 • 1 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
To identify databases and tables that are candidates for Stretch Database, download SQL Server 2016 Upgrade
Advisor and run the Stretch Database Advisor. Stretch Database Advisor also identifies blocking issues.
Next step
Enable Stretch Database.
To enable Stretch Database on a database, see Enable Stretch Database for a database.
To enable Stretch Database on another table, when Stretch is already enabled on the database, see Enable
Stretch Database for a table.
See Also
Limitations for Stretch Database
Enable Stretch Database for a database
Enable Stretch Database for a table
Get started by running the Enable Database for
Stretch Wizard
4/12/2017 • 6 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
To configure a database for Stretch Database, run the Enable Database for Stretch Wizard. This topic describes the
info that you have to enter and the choices that you have to make in the wizard.
To learn more about Stretch Database, see Stretch Database.
NOTE
Later, if you disable Stretch Database, remember that disabling Stretch Database for a table or for a database does not
delete the remote object. If you want to delete the remote table or the remote database, you have to drop it by using the
Azure management portal. The remote objects continue to incur Azure costs until you delete them manually.
Introduction
Review the purpose of the wizard and the prerequisites.
The important prerequisites include the following.
You have to be an administrator to change database settings.
You have to have a Microsoft Azure subscription.
Your SQL Server has to be able to communicate with the remote Azure server.
Select tables
Select the tables that you want to enable for Stretch.
Tables with lots of rows appear at the top of the sorted list. Before the Wizard displays the list of tables, it analyzes
them for data types that are not currently supported by Stretch Database.
COLUMN DESCRIPTION
(no title) Check the check box in this column to enable the selected
table for Stretch.
(no title) A symbol in this column may represent a warning that doesn't
prevent you from enabling the selected table for Stretch. It
may also represent a blocking issue that prevents you from
enabling the selected table for Stretch - for example, because
the table uses an unsupported data type. Hover over the
symbol to display more info in a tooltip. For more info, see
Limitations for Stretch Database.
COLUMN DESCRIPTION
Migrate You can migrate an entire table (Entire Table) or you can
specify a filter on an existing column in the table. If you want
to use a different filter function to select rows to migrate, run
the ALTER TABLE statement to specify the filter function after
you exit the wizard. For more info about the filter function, see
Select rows to migrate by using a filter function. For more info
about how to apply the function, see Enable Stretch Database
for a table or ALTER TABLE (Transact-SQL).
NOTE
The textbox that displays the filter query is read-only. You can't edit the query in the textbox.
1. Click Done to return to the Select tables page.
The filter function is created in SQL Server only when you finish the wizard. Until then, you can return to the Select
tables page to change or rename the filter function.
If you want to use a different type of filter function to select rows to migrate, do one of the following things.
Exit the wizard and run the ALTER TABLE statement to enable Stretch for the table and to specify a filter
function. For more info, see Enable Stretch Database for a table.
Run the ALTER TABLE statement to specify a filter function after you exit the wizard. For the required steps,
see Add a filter function after running the Wizard.
Configure Azure
1. Sign in to Microsoft Azure with a Microsoft account.
NOTE
To enable Stretch on a database you must have administrator rights to the subscription you are using. Stretch Database
wizard will only show subscriptions where the user has administrator rights.
Existing server
a. Select the existing Azure server.
b. Select the authentication method.
If you select SQL Server Authentication, provide the administrator login and
password.
Select Active Directory Integrated Authentication to use a federated service
account for SQL Server to communicate with the remote Azure server. If the selected
server is not integrated with Azure Active Directory, this option doesn't appear.
Secure credentials
You have to have a database master key to secure the credentials that Stretch Database uses to connect to the
remote database.
If a database master key already exists, enter the password for it.
If the database does not have an existing master key, enter a strong password to create a database master key.
For more info about the database master key, see CREATE MASTER KEY (Transact-SQL) and Create a Database
Master Key. For more info about the credential that the wizard creates, see CREATE DATABASE SCOPED
CREDENTIAL (Transact-SQL).
Select IP address
Use the subnet IP address range (recommended), or the public IP address of your SQL Server, to create a firewall
rule on Azure that lets SQL Server communicate with the remote Azure server.
The IP address or addresses that you provide on this page tell the Azure server to allow incoming data, queries,
and management operations initiated by SQL Server to pass through the Azure firewall. The wizard doesn't change
anything in the firewall settings on the SQL Server.
Summary
Review the values that you entered and the options that you selected in the wizard and the estimated costs on
Azure. Then select Finish to enable Stretch.
Results
Review the results.
To monitor the status of data migration, see Monitor and troubleshoot data migration (Stretch Database).
Troubleshooting the wizard
The Stretch Database wizard failed.
If Stretch Database is not yet enabled at the server level, and you run the wizard without the system administrator
permissions to enable it, the wizard fails. Ask the system administrator to enable Stretch Database on the local
server instance, and then run the wizard again. For more info, see Prerequisite: Permission to enable Stretch
Database on the server.
Next steps
Enable additional tables for Stretch Database. Monitor data migration and manage Stretch-enabled databases and
tables.
Enable Stretch Database for a table to enable additional tables.
Monitor and troubleshoot data migration (Stretch Database) to see the status of data migration.
Pause and resume data migration (Stretch Database)
Manage and troubleshoot Stretch Database
Backup Stretch-enabled databases
Restore Stretch-enabled databases
See Also
Enable Stretch Database for a database
Enable Stretch Database for a table
Configure compatible SQL Server features with
Stretch Database
4/12/2017 • 1 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
Take simple steps to configure the following SQL Server features to work with Stretch Database.
Always On
Always Encrypted
Transparent Data Encryption (TDE)
Temporal tables
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
To configure an existing database for Stretch Database, select Tasks | Stretch | Enable for a database in SQL
Server Management Studio to open the Enable Database for Stretch wizard. You can also use Transact-SQL to
enable Stretch Database for a database.
If you select Tasks | Stretch | Enable for an individual table, and you have not yet enabled the database for
Stretch Database, the wizard configures the database for Stretch Database and lets you select tables as part of the
process. Follow the steps in this topic instead of the steps in Enable Stretch Database for a table.
Enabling Stretch Database on a database or a table requires db_owner permissions. Enabling Stretch Database on
a database also requires CONTROL DATABASE permissions.
NOTE
Later, if you disable Stretch Database, remember that disabling Stretch Database for a table or for a database does not
delete the remote object. If you want to delete the remote table or the remote database, you have to drop it by using the
Azure management portal. The remote objects continue to incur Azure costs until you delete them manually.
RECONFIGURE;
GO
For more info, see Configure the remote data archive Server Configuration Option and sp_configure (Transact-
SQL).
3. To configure a SQL Server database for Stretch Database, the database has to have a database master key.
The database master key secures the credentials that Stretch Database uses to connect to the remote
database. Here's an example that creates a new database master key.
USE <database>;
GO
For more info about the database master key, see CREATE MASTER KEY (Transact-SQL) and Create a
Database Master Key.
4. When you configure a database for Stretch Database, you have to provide a credential for Stretch Database
to use for communication between the on premises SQL Server and the remote Azure server. You have two
options.
You can provide an administrator credential.
If you enable Stretch Database by running the wizard, you can create the credential at that
time.
If you plan to enable Stretch Database by running ALTER DATABASE, you have to create the
credential manually before you run ALTER DATABASE to enable Stretch Database.
Here's an example that creates a new credential.
For more info about the credential, see CREATE DATABASE SCOPED CREDENTIAL (Transact-SQL).
Creating the credential requires ALTER ANY CREDENTIAL permissions.
You can use a federated service account for the SQL Server to communicate with the remote Azure
server when the following conditions are all true.
The service account under which the instance of SQL Server is running is a domain account.
The domain account belongs to a domain whose Active Directory is federated with Azure
Active Directory.
The remote Azure server is configured to support Azure Active Directory authentication.
The service account under which the instance of SQL Server is running must be configured as
a dbmanager or sysadmin account on the remote Azure server.
5. To configure a database for Stretch Database, run the ALTER DATABASE command.
a. For the SERVER argument, provide the name of an existing Azure server, including the
.database.windows.net portion of the name - for example,
MyStretchDatabaseServer.database.windows.net .
Next steps
Enable Stretch Database for a table to enable additional tables.
Monitor and troubleshoot data migration (Stretch Database) to see the status of data migration.
Pause and resume data migration (Stretch Database)
Manage and troubleshoot Stretch Database
Backup Stretch-enabled databases
Restore Stretch-enabled databases
See Also
Identify databases and tables for Stretch Database by running Stretch Database Advisor
ALTER DATABASE SET Options (Transact-SQL)
Enable Stretch Database for a table
4/12/2017 • 4 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
To configure a table for Stretch Database, select Stretch | Enable for a table in SQL Server Management Studio
to open the Enable Table for Stretch wizard. You can also use Transact-SQL to enable Stretch Database on an
existing table, or to create a new table with Stretch Database enabled.
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.
Prerequisites. If you select Stretch | Enable for a table, and you have not yet enabled Stretch Database
for the database, the wizard first configures the database for Stretch Database. Follow the steps in Get
started by running the Enable Database for Stretch Wizard instead of the steps in this topic.
Permissions. Enabling Stretch Database on a database or a table requires db_owner permissions.
Enabling Stretch Database on a table also requires ALTER permissions on the table.
NOTE
Later, if you disable Stretch Database, remember that disabling Stretch Database for a table or for a database does
not delete the remote object. If you want to delete the remote table or the remote database, you have to drop it
by using the Azure management portal. The remote objects continue to incur Azure costs until you delete them
manually.
IMPORTANT
If you provide a filter function that performs poorly, data migration also performs poorly. Stretch Database applies
the filter function to the table by using the CROSS APPLY operator.
Here's an example that migrates only the rows identified by the dbo.fn_stretchpredicate inline table-valued
function and postpones data migration. For more info about the filter function, see Select rows to migrate by
using a filter function.
Here's an example that migrates only the rows identified by the dbo.fn_stretchpredicate inline table-valued
function and postpones data migration. For more info about the filter function, see Select rows to migrate by
using a filter function.
See Also
ALTER TABLE (Transact-SQL)
CREATE TABLE (Transact-SQL)
Select rows to migrate by using a filter function
(Stretch Database)
4/12/2017 • 13 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
If you store cold data in a separate table, you can configure Stretch Database to migrate the entire table. If your
table contains both hot and cold data, on the other hand, you can specify a filter predicate to select the rows to
migrate. The filter predicate is an inline table-valued function. This topic describes how to write an inline table-
valued function to select rows to migrate.
IMPORTANT
If you provide a filter function that performs poorly, data migration also performs poorly. Stretch Database applies the filter
function to the table by using the CROSS APPLY operator.
The parameters for the function have to be identifiers for columns from the table.
Schema binding is required to prevent columns that are used by the filter function from being dropped or altered.
Return value
If the function returns a non-empty result, the row is eligible to be migrated. Otherwise - that is, if the function
doesn't return a result - the row is not eligible to be migrated.
Conditions
The <predicate> can consist of one condition, or of multiple conditions joined with the AND logical operator.
<predicate> ::= <condition> [ AND <condition> ] [ ...n ]
Each condition in turn can consist of one primitive condition, or of multiple primitive conditions joined with the
OR logical operator.
Primitive conditions
A primitive condition can do one of the following comparisons.
<primitive_condition> ::=
{
<function_parameter> <comparison_operator> constant
| <function_parameter> { IS NULL | IS NOT NULL }
| <function_parameter> IN ( constant [ ,...n ] )
}
Compare a function parameter to a constant expression. For example, @column1 < 1000 .
Here's an example that checks whether the value of a date column is < 1/1/2016.
Comparison operators
The following comparison operators are supported.
<, <=, >, >=, =, <>, !=, !<, !>
Constant expressions
The constants that you use in a filter function can be any deterministic expression that can be evaluated when you
define the function. Constant expressions can contain the following things.
Literals. For example, N’abc’, 123 .
Algebraic expressions. For example, 123 + 456 .
Deterministic functions. For example, SQRT(900) .
Deterministic conversions that use CAST or CONVERT. For example, CONVERT(datetime, '1/1/2016', 101) .
Other expressions
You can use the BETWEEN and NOT BETWEEN operators if the resulting function conforms to the rules described
here after you replace the BETWEEN and NOT BETWEEN operators with the equivalent AND and OR expressions.
You can't use subqueries or non-deterministic functions such as RAND() or GETDATE().
After you bind the function to the table as a predicate, the following things are true.
The next time data migration occurs, only the rows for which the function returns a non-empty value are
migrated.
The columns used by the function are schema bound. You can't alter these columns as long as a table is
using the function as its filter predicate.
You can't drop the inline table-valued function as long as a table is using the function as its filter predicate.
TIP
To improve the performance of the filter function, create an index on the columns used by the function.
Instead, specify the filter function with a one-part column name as shown in the following example.
2. Wait for migration to finish. You can check the status in Stretch Database Monitor from SQL Server
Management Studio, or you can query the sys.dm_db_rda_migration_status view. For more info, see
Monitor and troubleshoot data migration or sys.dm_db_rda_migration_status.
3. Create the filter function that you want to apply to the table.
4. Add the function to the table and restart data migration to Azure.
When you want to update the sliding window, do the following things.
1. Create a new function that specifies the new sliding window. The following example selects dates earlier
than January 2, 2016, instead of January 1, 2016.
2. Replace the previous filter function with the new one by calling ALTER TABLE, as shown in the following
example.
3. Optionally, drop the previous filter function that you're no longer using by calling DROP FUNCTION. (This
step is not shown in the example.)
BEGIN TRAN
GO
/*(1) Create new predicate function definition */
CREATE FUNCTION dbo.fn_StretchBySystemEndTime20160102(@systemEndTime datetime2)
RETURNS TABLE
WITH SCHEMABINDING
AS
RETURN SELECT 1 AS is_eligible
WHERE @systemEndTime < CONVERT(datetime2,'2016-01-02T00:00:00', 101)
GO
The following example uses several conditions and a deterministic conversion with CONVERT.
The following example uses the BETWEEN and NOT BETWEEN operators. This usage is valid because the
resulting function conforms to the rules described here after you replace the BETWEEN and NOT BETWEEN
operators with the equivalent AND and OR expressions.
The preceding function is equivalent to the following function after you replace the BETWEEN and NOT
BETWEEN operators with the equivalent AND and OR expressions.
The following function isn't valid because it contains a non-deterministic function call.
The following functions aren't valid because expressions that use algebraic operators or built-in functions
must evaluate to a constant when you define the function. You can't include column references in algebraic
expressions or function calls.
The following function isn't valid because it violates the rules described here after you replace the
BETWEEN operator with the equivalent AND expression.
The preceding function is equivalent to the following function after you replace the BETWEEN operator with
the equivalent AND expression. This function isn't valid because primitive conditions can only use the OR
logical operator.
If the function returns a non-empty result for the row, the row is eligible to be migrated.
The following function is a valid replacement because the new date constant (which specifies a later cutoff date)
makes the function less restrictive.
The following function isn't a valid replacement because one of the comparison operators has been removed.
The following function isn't a valid replacement because a new condition has been added with the AND logical
operator.
After you remove the filter function, all rows in the table are eligible for migration. As a result, you cannot specify
a filter function for the same table later unless you bring back all the remote data for the table from Azure first.
This restriction exists to avoid the situation where rows that are not eligible for migration when you provide a new
filter function have already been migrated to Azure.
See Also
ALTER TABLE (Transact-SQL)
Monitor and troubleshoot data migration (Stretch
Database)
4/12/2017 • 1 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
To monitor data migration in Stretch Database Monitor, select Tasks | Stretch | Monitor for a database in SQL
Server Management Studio .
See Also
Manage and troubleshoot Stretch Database
Pause and resume data migration (Stretch Database)
4/12/2017 • 1 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
To pause or resume data migration to Azure, select Stretch for a table in SQL Server Management Studio, and
then select Pause to pause data migration or Resume to resume data migration. You can also use Transact-SQL
to pause or resume data migration.
Pause data migration on individual tables when you want to troubleshoot problems on the local server or to
maximize the available network bandwidth.
See Also
ALTER TABLE (Transact-SQL)
Monitor and troubleshoot data migration
Manage and troubleshoot Stretch Database
4/12/2017 • 5 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
To manage and troubleshoot Stretch Database, use the tools and methods described in this topic .
IMPORTANT
When sp_rda_reconcile_columns recreates columns that you accidentally deleted from the remote table, it does not
restore the data that was previously in the deleted columns.
sp_rda_reconcile_columns does not delete columns from the remote table that exist in the remote table but not
in the Stretch-enabled SQL Server table. If there are columns in the remote Azure table that no longer exist in the
Stretch-enabled SQL Server table, these extra columns do not prevent Stretch Database from operating normally.
You can optionally remove the extra columns manually.
See Also
Monitor and troubleshoot data migration (Stretch Database)
Backup Stretch-enabled databases (Stretch Database)
Restore Stretch-enabled databases (Stretch Database)
Backup Stretch-enabled databases (Stretch
Database)
4/12/2017 • 3 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
Database backups help you to recover from many types of failures, errors, and disasters.
You have to back up your Stretch-enabled SQL Server databases.
Microsoft Azure automatically backs up the remote data that Stretch Database has migrated from SQL
Server to Azure.
TIP
Backup is only one part of a complete high availability and business continuity solution. For more info about high availability,
see High Availability Solutions.
NOTE
Increasing the amount of data that Stretch Database retains temporarily in the staging table increases the amount of space
required on the SQL Server.
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
Manage and troubleshoot Stretch Database
Restore Stretch-enabled databases (Stretch
Database)
4/12/2017 • 2 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
Restore a backed up database when necessary to recover from many types of failures, errors, and disasters.
For more info about backup, see Backup Stretch-enabled databases.
TIP
Backup is only one part of a complete high availability and business continuity solution. For more info about high availability,
see High Availability Solutions.
Restore the connection between the SQL Server database and the
remote Azure database
1. If you're going to connect to a restored Azure database with a different name or in a different region, run
the stored procedure sys.sp_rda_deauthorize_db to disconnect from the previous Azure database.
2. Run the stored procedure sys.sp_rda_reauthorize_db to reconnect the local Stretch-enabled database to the
Azure database.
Provide the existing database scoped credential as a sysname or a varchar(128) value. (Don't use
varchar(max).) You can look up the credential name in the view sys.database_scoped_credentials.
Specify whether to make a copy of the remote data and connect to the copy (recommended).
See Also
Backup Stretch-enabled databases
Manage and troubleshoot Stretch Database
sys.sp_rda_reauthorize_db sys.sp_rda_deauthorize_db
Back Up and Restore of SQL Server Databases
Disable Stretch Database and bring back remote data
4/12/2017 • 4 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
To disable Stretch Database for a table, select Stretch for a table in SQL Server Management Studio. Then select
one of the following options.
Disable | Bring data back from Azure. Copy the remote data for the table from Azure back to SQL Server,
then disable Stretch Database for the table. This operation incurs data transfer costs, and it can't be canceled.
Disable | Leave data in Azure. Disable Stretch Database for the table. Abandon the remote data for the
table in Azure.
You can also use Transact-SQL to disable Stretch Database for a table or for a database.
After you disable Stretch Database for a table, data migration stops and query results no longer include
results from the remote table.
If you simply want to pause data migration, see Pause and resume data migration (Stretch Database).
NOTE
Disabling Stretch Database for a table or for a database does not delete the remote object. If you want to delete the remote
table or the remote database, you have to drop it by using the Azure management portal. The remote objects continue to
incur Azure costs until you delete them. For more info, see SQL Server Stretch Database Pricing.
NOTE
Copying the remote data for the table from Azure back to SQL Server incurs data transfer costs. For more
info, see Data Transfers Pricing Details.
After all the remote data has been copied from Azure back to SQL Server, Stretch is disabled for the
table.
Disable | Leave data in Azure. Disable Stretch Database for the table. Abandon the remote data for
the table in Azure.
NOTE
Disabling Stretch Database for a table does not delete the remote data or the remote table. If you want to delete the
remote table, you have to drop it by using the Azure management portal. The remote table continues to incur Azure
costs until you delete it. For more info, see SQL Server Stretch Database Pricing.
NOTE
Copying the remote data for the table from Azure back to SQL Server incurs data transfer costs. For more info, see
Data Transfers Pricing Details.
To disable Stretch for a table and abandon the remote data, run the following command.
NOTE
Disabling Stretch Database for a table does not delete the remote data or the remote table. If you want to delete the remote
table, you have to drop it by using the Azure management portal. The remote table continues to incur Azure costs until you
delete it. For more info, see SQL Server Stretch Database Pricing.
NOTE
Disabling Stretch Database for a database does not delete the remote database. If you want to delete the remote database,
you have to drop it by using the Azure management portal. The remote database continues to incur Azure costs until you
delete it. For more info, see SQL Server Stretch Database Pricing.
See Also
ALTER DATABASE SET Options (Transact-SQL)
Pause and resume data migration (Stretch Database)
Extended Events for Stretch Database
3/24/2017 • 3 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
Stretch Database provides a set of extended events for troubleshooting.
For more info, see Extended Events. For info about how to start an extended events session for troubleshooting, see
Create an Extended Events Session
remote_data_archive_db_ddl Occurs when the database T-SQL ddl for stretching data is
processed.
remote_data_archive_table_ddl Occurs when the table T-SQL ddl for stretching data is
processed.
stretch_schema_task_skipped Reports the stretch schema task is skipped during the stretch
schema function.
stretch_schema_task_start Reports the start of stretch schema function during the stretch
schema task.
stretch_table_validation_error Reports the completion of validation for a table when the user
enables stretch
See Also
Manage and troubleshoot Stretch Database