Skip to content

Commit 1f36c10

Browse files
authored
Merge pull request #188366 from WilliamDAssafMSFT/20220120-ADR-new-objects
20220211 ADR add linkage and best practices
2 parents c62c658 + 8876fae commit 1f36c10

File tree

1 file changed

+36
-13
lines changed

1 file changed

+36
-13
lines changed

articles/azure-sql/accelerated-database-recovery.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ ms.devlang:
99
ms.topic: conceptual
1010
author: kfarlee
1111
ms.author: kfarlee
12-
ms.reviewer: mathoma, kendralittle, nvraparl
13-
ms.date: 05/19/2020
12+
ms.reviewer: mathoma, kendralittle, nvraparl, wiassaf
13+
ms.date: 02/18/2022
1414
---
1515
# Accelerated Database Recovery in Azure SQL
1616
[!INCLUDE[appliesto-sqldb-sqlmi](includes/appliesto-sqldb-sqlmi.md)]
1717

1818
**Accelerated Database Recovery (ADR)** is a SQL Server database engine feature that greatly improves database availability, especially in the presence of long running transactions, by redesigning the SQL Server database engine recovery process.
1919

20-
ADR is currently available for Azure SQL Database, Azure SQL Managed Instance, databases in Azure Synapse Analytics, and SQL Server on Azure VMs starting with SQL Server 2019.
20+
ADR is currently available for Azure SQL Database, Azure SQL Managed Instance, databases in Azure Synapse Analytics, and SQL Server on Azure VMs starting with SQL Server 2019. For information on ADR in SQL Server, see [Manage accelerated database recovery](/sql/relational-databases/accelerated-database-recovery-management).
2121

2222
> [!NOTE]
23-
> ADR is enabled by default in Azure SQL Database and Azure SQL Managed Instance and disabling ADR for either product is not supported.
23+
> ADR is enabled by default in Azure SQL Database and Azure SQL Managed Instance. Disabling ADR in Azure SQL Database and Azure SQL Managed Instance is not supported.
2424
2525
## Overview
2626

@@ -77,22 +77,22 @@ The ADR recovery process has the same three phases as the current recovery proce
7777

7878
- **Analysis phase**
7979

80-
The process remains the same as before with the addition of reconstructing sLog and copying log records for non-versioned operations.
80+
The process remains the same as before with the addition of reconstructing SLOG and copying log records for non-versioned operations.
8181

8282
- **Redo** phase
8383

8484
Broken into two phases (P)
8585
- Phase 1
8686

87-
Redo from sLog (oldest uncommitted transaction up to last checkpoint). Redo is a fast operation as it only needs to process a few records from the sLog.
87+
Redo from SLOG (oldest uncommitted transaction up to last checkpoint). Redo is a fast operation as it only needs to process a few records from the SLOG.
8888

8989
- Phase 2
9090

9191
Redo from Transaction Log starts from last checkpoint (instead of oldest uncommitted transaction)
9292

9393
- **Undo phase**
9494

95-
The Undo phase with ADR completes almost instantaneously by using sLog to undo non-versioned operations and Persisted Version Store (PVS) with Logical Revert to perform row level version-based Undo.
95+
The Undo phase with ADR completes almost instantaneously by using SLOG to undo non-versioned operations and Persisted Version Store (PVS) with Logical Revert to perform row level version-based Undo.
9696

9797
## ADR recovery components
9898

@@ -110,9 +110,9 @@ The four key components of ADR are:
110110
- Performing rollback by using PVS for all user transactions, rather than physically scanning the transaction log and undoing changes one at a time.
111111
- Releasing all locks immediately after transaction abort. Since abort involves simply marking changes in memory, the process is very efficient and therefore locks do not have to be held for a long time.
112112

113-
- **sLog**
113+
- **SLOG**
114114

115-
sLog is a secondary in-memory log stream that stores log records for non-versioned operations (such as metadata cache invalidation, lock acquisitions, and so on). The sLog is:
115+
SLOG is a secondary in-memory log stream that stores log records for non-versioned operations (such as metadata cache invalidation, lock acquisitions, and so on). The SLOG is:
116116

117117
- Low volume and in-memory
118118
- Persisted on disk by being serialized during the checkpoint process
@@ -124,10 +124,33 @@ The four key components of ADR are:
124124

125125
The cleaner is the asynchronous process that wakes up periodically and cleans page versions that are not needed.
126126

127-
## Accelerated Database Recovery Patterns
127+
## Accelerated Database Recovery (ADR) patterns
128128

129129
The following types of workloads benefit most from ADR:
130130

131-
- Workloads with long-running transactions.
132-
- Workloads that have seen cases where active transactions are causing the transaction log to grow significantly.
133-
- Workloads that have experienced long periods of database unavailability due to long running recovery (such as unexpected service restart or manual transaction rollback).
131+
- ADR is recommended for workloads with long running transactions.
132+
- ADR is recommended for workloads that have seen cases where active transactions are causing the transaction log to grow significantly.
133+
- ADR is recommended for workloads that have experienced long periods of database unavailability due to long running recovery (such as unexpected service restart or manual transaction rollback).
134+
135+
## Best practices for Accelerated Database Recovery
136+
137+
- Avoid long-running transactions in the database. Though one objective of ADR is to speed up database recovery due to redo long active transactions, long-running transactions can delay version cleanup and increase the size of the PVS.
138+
139+
- Avoid large transactions with data definition changes or DDL operations. ADR uses a SLOG (system log stream) mechanism to track DDL operations used in recovery. The SLOG is only used while the transaction active. SLOG is checkpointed, so avoiding large transactions that use SLOG can help overall performance. These scenarios can cause the SLOG to take up more space:
140+
141+
- Many DDLs are executed in one transaction. For example, in one transaction, rapidly creating and dropping temp tables.
142+
143+
- A table has very large number of partitions/indexes that are modified. For example, a DROP TABLE operation on such table would require a large reservation of SLOG memory, which would delay truncation of the transaction log and delay undo/redo operations. The workaround can be drop the indexes individually and gradually, then drop the table. For more information on the SLOG, see [ADR recovery components](/sql/relational-databases/accelerated-database-recovery-conceptsadr-recovery-components).
144+
145+
- Prevent or reduce unnecessary aborted situations. A high abort rate will put pressure on the PVS cleaner and lower ADR performance. The aborts may come from a high rate of deadlocks, duplicate keys, or other constraint violations.
146+
147+
- The `sys.dm_tran_aborted_transactions` DMV shows all aborted transactions on the SQL Server instance. The `nested_abort` column indicates that the transaction committed but there are portions that aborted (savepoints or nested transactions) which can block the PVS cleanup process. For more information, see [sys.dm_tran_aborted_transactions (Transact-SQL)](/sql/relational-databases/system-dynamic-management-views/sys-dm-tran-aborted-transactions).
148+
149+
- To activate the PVS cleanup process manually between workloads or during maintenance windows, use `sys.sp_persistent_version_cleanup`. For more information, see [sys.sp_persistent_version_cleanup](/sql/relational-databases/system-stored-procedures/sys-sp-persistent-version-cleanup-transact-sql).
150+
151+
- If you observe issues either with storage usage, high abort transaction and other factors, see [Troubleshooting Accelerated Database Recovery (ADR) on SQL Server](/sql/relational-databases/accelerated-database-recovery-troubleshooting).
152+
153+
## Next steps
154+
155+
- [Accelerated database recovery](/sql/relational-databases/accelerated-database-recovery-concepts)
156+
- [Troubleshooting Accelerated Database Recovery (ADR) on SQL Server](/sql/relational-databases/accelerated-database-recovery-troubleshooting).

0 commit comments

Comments
 (0)