You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**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.
19
19
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).
21
21
22
22
> [!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.
24
24
25
25
## Overview
26
26
@@ -77,22 +77,22 @@ The ADR recovery process has the same three phases as the current recovery proce
77
77
78
78
-**Analysis phase**
79
79
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.
81
81
82
82
-**Redo** phase
83
83
84
84
Broken into two phases (P)
85
85
- Phase 1
86
86
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.
88
88
89
89
- Phase 2
90
90
91
91
Redo from Transaction Log starts from last checkpoint (instead of oldest uncommitted transaction)
92
92
93
93
-**Undo phase**
94
94
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.
96
96
97
97
## ADR recovery components
98
98
@@ -110,9 +110,9 @@ The four key components of ADR are:
110
110
- Performing rollback by using PVS for all user transactions, rather than physically scanning the transaction log and undoing changes one at a time.
111
111
- 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.
112
112
113
-
-**sLog**
113
+
-**SLOG**
114
114
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:
116
116
117
117
- Low volume and in-memory
118
118
- Persisted on disk by being serialized during the checkpoint process
@@ -124,10 +124,33 @@ The four key components of ADR are:
124
124
125
125
The cleaner is the asynchronous process that wakes up periodically and cleans page versions that are not needed.
126
126
127
-
## Accelerated Database Recovery Patterns
127
+
## Accelerated Database Recovery (ADR) patterns
128
128
129
129
The following types of workloads benefit most from ADR:
130
130
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).
0 commit comments