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
Copy file name to clipboardExpand all lines: azure-sql/managed-instance/transact-sql-tsql-differences-sql-server.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -487,7 +487,7 @@ Service broker is enabled by default and cannot be disabled. The following ALTER
487
487
-`scan for startup procs`
488
488
- The following [sp_configure](/sql/relational-databases/system-stored-procedures/sp-configure-transact-sql) options are ignored and have no effect:
489
489
-`Ole Automation Procedures`
490
-
-`sp_execute_external_scripts`isn't supported. See [sp_execute_external_scripts](/sql/relational-databases/system-stored-procedures/sp-execute-external-script-transact-sql#examples).
490
+
-`sp_execute_external_scripts`is only supported for [Machine Learning Services for SQL MI](machine-learning-services-overview.md), otherwise **sp_execute_external_scripts** is not supported for SQL Managed Instance. See [sp_execute_external_scripts](/sql/relational-databases/system-stored-procedures/sp-execute-external-script-transact-sql#examples).
491
491
-`xp_cmdshell` isn't supported. See [xp_cmdshell](/sql/relational-databases/system-stored-procedures/xp-cmdshell-transact-sql).
492
492
-`Extended stored procedures` aren't supported, and this includes `sp_addextendedproc` and `sp_dropextendedproc`. This functionality won't be supported because it's on a deprecation path for SQL Server. For more information, see [Extended Stored Procedures](/sql/relational-databases/extended-stored-procedures-programming/database-engine-extended-stored-procedures-programming).
493
493
-`sp_attach_db`, `sp_attach_single_file_db`, and `sp_detach_db` aren't supported. See [sp_attach_db](/sql/relational-databases/system-stored-procedures/sp-attach-db-transact-sql), [sp_attach_single_file_db](/sql/relational-databases/system-stored-procedures/sp-attach-single-file-db-transact-sql), and [sp_detach_db](/sql/relational-databases/system-stored-procedures/sp-detach-db-transact-sql).
Copy file name to clipboardExpand all lines: docs/relational-databases/accelerated-database-recovery-management.md
+28-12Lines changed: 28 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
description: "Best practices for managing and configuring accelerated database recovery (ADR)."
3
3
title: "Manage accelerated database recovery | Microsoft Docs"
4
-
ms.date: 06/10/2022
4
+
ms.date: 07/12/2022
5
5
ms.prod: sql
6
6
ms.prod_service: backup-restore
7
7
ms.technology: backup-restore
@@ -27,7 +27,7 @@ This article contains information on best practices for managing and configuring
27
27
28
28
Many customers find accelerated database recovery (ADR) a valuable technology to improve recovery time. An accumulation of the factors below should be considered before deciding which databases should use ADR, evaluate the factors below and if the accumulation of factors weighs in favor or against using ADR.
29
29
30
-
- ADR is recommended for workloads with long running transactions.
30
+
- ADR is recommended for workloads with long running transactions that cannot be avoided. For example, in cases where long-running transactions are at risk of being rolled back, ADR can help.
31
31
32
32
- ADR is recommended for workloads that have seen cases where active transactions are causing the transaction log to grow significantly.
33
33
@@ -59,7 +59,7 @@ This section contains guidance and recommendations for ADR.
59
59
60
60
- Ensure there is sufficient space on the database to account for PVS usage. If the database does not have enough room for the PVS to grow, ADR will fail to generate versions. ADR saves space in the version store compared to `tempdb` version store.
61
61
62
-
- 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.
62
+
- Avoid multiple long-running transactions in the database. Though one objective of ADR is to speed up database recovery due to redo, multiple long-running transactions can delay version cleanup and increase the size of the PVS.
63
63
64
64
- 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:
65
65
@@ -79,8 +79,7 @@ This section contains guidance and recommendations for ADR.
79
79
ADR is off by default in [!INCLUDE[sql-server-2019](../includes/sssql19-md.md)], and can be controlled using DDL syntax:
80
80
81
81
```syntaxsql
82
-
ALTER DATABASE [DB] SET ACCELERATED_DATABASE_RECOVERY = {ON | OFF}
83
-
[(PERSISTENT_VERSION_STORE_FILEGROUP = { filegroup name }) ];
82
+
ALTER DATABASE [DB] SET ACCELERATED_DATABASE_RECOVERY = {ON | OFF};
84
83
```
85
84
86
85
Use this syntax to control whether the feature is on or off, and designate a specific filegroup for the *persistent version store* (PVS) data. If no filegroup is specified, the PVS will be stored in the PRIMARY filegroup.
@@ -89,25 +88,42 @@ An exclusive lock is necessary on the database to change this state. That means
89
88
90
89
## Managing the persistent version store filegroup
91
90
92
-
The ADR feature is based on having changes versioned, with different versions of a data element kept in the PVS.
93
-
There are considerations to locating where the PVS is located and in how to manage the size of the data in the PVS.
91
+
The ADR feature is based on having changes versioned, with different versions of a data element kept in the PVS. There are considerations to locating where the PVS is located and in how to manage the size of the data in the PVS.
94
92
95
93
### To enable ADR without specifying a filegroup
96
94
95
+
This operation requires exclusive access to the database.
96
+
97
97
```sql
98
98
ALTERDATABASE [MyDatabase] SET ACCELERATED_DATABASE_RECOVERY =ON;
99
99
GO
100
100
```
101
101
102
102
In this case, when the PVS filegroup is not specified, the `PRIMARY` filegroup holds the PVS data.
103
103
104
-
### To enable ADR and specify that the PVS should be stored in the [VersionStoreFG] filegroup
104
+
### To enable ADR and specify that the PVS should be stored in a filegroup
105
+
106
+
You can configure ADR to use another filegroup, aside from the default `PRIMARY` filegroup, to hold PVS data.
107
+
108
+
Before enabling ADR in a filegroup besides `PRIMARY`, you must create the filegroup and data file.
109
+
110
+
Create the `VersionStoreFG` filegroup and create a new data file in the filegroup. For example:
ALTERDATABASE [MyDatabase] ADD FILE ( NAME = N'VersionStoreFG'
116
+
, FILENAME = N'E:\DATA\VersionStore.ndf'
117
+
, SIZE = 8192KB , FILEGROWTH = 65536KB )
118
+
TO FILEGROUP [VersionStoreFG];
119
+
GO
120
+
```
105
121
106
-
Before running this script, create the filegroup.
122
+
Only after the filegroup and a secondary data file have been created, enable ADR and specify that the PVS should be stored in a specific filegroup. This operation requires exclusive access to the database.
107
123
108
124
```sql
109
125
ALTERDATABASE [MyDatabase] SET ACCELERATED_DATABASE_RECOVERY =ON
@@ -132,7 +148,7 @@ Changing the location of the PVS is a three-step process.
132
148
GO
133
149
```
134
150
135
-
2. Wait until all of the versions stored in the PVS can be freed
151
+
2. Wait until all of the versions stored in the PVS can be freed.
136
152
137
153
In order to be able to turn on ADR with a new location for the persistent version store, you must first make sure that all of the version information has been purged from the previous PVS location. In order to force that cleanup to happen, run the command:
138
154
@@ -147,7 +163,7 @@ Changing the location of the PVS is a three-step process.
When the value of `persistent_version_store_size_kb` is 0, you can re-enable the ADR feature, configuring the PVS to be located in the new filegroup.
166
+
When the value of `persistent_version_store_size_kb` is `0`, you can re-enable the ADR feature, configuring the PVS to be located in the new filegroup.
151
167
152
168
3. Turn on ADR, specifying the new location for the PVS:
@@ -57,7 +57,7 @@ WHERE pvss.database_id = DB_ID();
57
57
58
58
1. Check `pvs_pct_of_database_size` size, note any difference from the typical, compared to baselines during other periods of application activity. PVS is considered large if it's significantly larger than baseline or if it is close to 50% of the size of the database. Use the following steps as a troubleshooting aid for a PVS that is large.
59
59
60
-
2. Activetransactions prevent cleaning up the PVS. Retrieve `oldest_active_transaction_id` and check whether this transaction has been active for a long time by querying `sys.dm_tran_database_transactions` based on the transaction ID. Check for long-running, active transactions with a query like the below sample, which declares variables to set thresholds for duration or log amount:
60
+
2. Active, long-running transactions in any database where ADR is enabled can prevent cleanup of the PVS. Retrieve `oldest_active_transaction_id` and check whether this transaction has been active for a long time by querying `sys.dm_tran_database_transactions` based on the transaction ID. Check for long-running, active transactions with a query like the below sample, which declares variables to set thresholds for duration or log amount:
61
61
62
62
```sql
63
63
DECLARE @longTxThreshold int=1800; --number of seconds to use as a duration threshold for long-running transactions
@@ -108,7 +108,7 @@ WHERE pvss.database_id = DB_ID();
108
108
109
109
To prevent delays to PVS cleanup:
110
110
111
-
1. Consider killing the long active transaction session that is delaying PVS cleanup, if possible.
111
+
1. Consider killing the long active transaction session that is delaying PVS cleanup, if possible. Long-running transactions in any database where ADR is enabled may delay ADR PVS cleanup.
112
112
1. Tune long-running queries to reduce query duration and locks required. For more information and guidance, see [Understand and resolve blocking in SQL Server](/troubleshoot/sql/performance/understand-resolve-blocking) or [Understand and resolve Azure SQL Database blocking problems](/azure/azure-sql/database/understand-resolve-blocking).
113
113
1. Review the application to determine the nature of the problematic active snapshot scan. Consider a different isolation level, such as READ COMMITTED, instead of SNAPSHOT or READ COMMITTED SNAPSHOT for long-running queries that are delaying ADR PVS cleanup. This problem occurs more frequently with SNAPSHOT isolation level.
114
114
1. This issue can occur in SQL Server, Azure SQL Managed Instance, and elastic pools of Azure SQL Database, but not in singleton Azure SQL databases. In Azure SQL Database elastic pools, consider moving databases out of the elastic pool that have long-running queries using READ COMMIT SNAPSHOT or SNAPSHOT isolation levels.
[!INCLUDE [SQL Server Azure SQL Database](../../includes/applies-to-version/sql-asdb.md)]
21
+
[!INCLUDE [SQL Server Azure SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
22
22
23
23
This article describes the `tempdb` system database, a global resource available to all users connected to an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], Azure SQL Database, or Azure SQL Managed Instance.
24
24
@@ -203,7 +203,8 @@ Metadata contention in `tempdb` has historically been a bottleneck to scalabilit
203
203
204
204
This feature effectively removes this bottleneck and unlocks a new level of scalability for tempdb-heavy workloads. In [!INCLUDE[sql-server-2019](../../includes/sssql19-md.md)], the system tables involved in managing temporary table metadata can be moved into latch-free, non-durable, memory-optimized tables.
205
205
206
-
Currently the memory-optimized tempdb metadata feature is not available in Azure SQL Database or Azure SQL Managed Instance.
206
+
> [!NOTE]
207
+
> Currently the memory-optimized tempdb metadata feature is not available in Azure SQL Database or Azure SQL Managed Instance.
207
208
208
209
Watch this seven-minute video for an overview of how and when to use memory-optimized tempdb metadata:
[!INCLUDE [SQL Server - ASDB](../../includes/applies-to-version/sql-asdb.md)]
18
+
[!INCLUDE [SQL Server Azure SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
19
19
The **Audit Login GDR** event class occurs whenever a [!INCLUDE[msCoName](../../includes/msconame-md.md)] Windows login right is added or removed. This event class is for the **sp_grantlogin**, **sp_revokelogin**, and **sp_denylogin** stored procedures.
20
20
21
21
This event class may be removed in a future version of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. It is recommended that you use the **Audit Server Principal Management** event class instead.
[!INCLUDE [SQL Server - ASDB](../../includes/applies-to-version/sql-asdb.md)]
18
+
[!INCLUDE [SQL Server Azure SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
19
19
The **Audit Logout** event class indicates that a user has logged out of (logged off) [!INCLUDE[msCoName](../../includes/msconame-md.md)][!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Events in this class are fired by new connections or by connections that are reused from a connection pool.
[!INCLUDE [SQL Server - ASDB](../../includes/applies-to-version/sql-asdb.md)]
18
+
[!INCLUDE [SQL Server Azure SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
19
19
The **Audit Object Derived Permission** event class records when a CREATE, ALTER, or DROP command is issued for a specified object. This event only occurs if the object does not have permissions or owners directly associated with it.
20
20
21
21
This event class may be removed in a future version of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. It is recommended that you use the **Audit Schema Object Management** event class instead.
[!INCLUDE [SQL Server - ASDB](../../includes/applies-to-version/sql-asdb.md)]
18
+
[!INCLUDE [SQL Server Azure SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
19
19
The **Audit Schema Object GDR** event class occurs whenever a GRANT, REVOKE, or DENY is issued for a schema object permission by any user in [!INCLUDE[msCoName](../../includes/msconame-md.md)][!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
20
20
21
21
## Audit Schema Object GDR Event Class Data Columns
0 commit comments