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
This statement enables several database configuration settings at the **individual database** level. This statement is available in both [!INCLUDE[sqldbesa](../../includes/sqldbesa-md.md)] and in [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)]. Those settings are:
36
+
This statement enables several database configuration settings at the **individual database** level. This statement is available in [!INCLUDE[sqldbesa](../../includes/sqldbesa-md.md)] and in SQL Server beginning with[!INCLUDE[ssSQL15](../../includes/sssql15-md.md)]. Those settings are:
37
37
38
38
- Clear procedure cache.
39
39
40
-
- Set the MAXDOP parameter to an arbitrary value (1,2, ...) for the primary database based on what works best for that particular database and set a different value (e.g. 0) for all secondary database used (e.g. for reporting queries).
40
+
- Set the MAXDOP parameter to an arbitrary value (1,2, ...) for the primary database based on what works best for that particular database and set a different value (e.g. 0) for all secondary database used (such as for reporting queries).
41
41
42
42
- Set the query optimizer cardinality estimation model independent of the database to compatibility level.
43
43
@@ -47,7 +47,7 @@ ms.workload: "On Demand"
47
47
48
48
- Enable or disable the identity cache at the database level.
49
49
50
-
[Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
Specifies the default MAXDOP setting that should be used for statements. 0 is the default value and indicates that the server configuration will be used instead. The MAXDOP at the database scope overrides (unless it is set to 0) the **max degree of parallelism** set at the server level by sp_configure. Query hints can still override the DB scoped MAXDOP in order to tune specific queries that need different setting. All these settings are limited by the MAXDOP set for the Workload Group.
83
83
84
-
You can use the max degree of parallelism option to limit the number of processors to use in parallel plan execution. SQL Server considers parallel execution plans for queries, index data definition language (DDL) operations, parallel insert, online alter column, parallel stats collectiion, and static and keyset-driven cursor population.
84
+
You can use the max degree of parallelism option to limit the number of processors to use in parallel plan execution. SQL Server considers parallel execution plans for queries, index data definition language (DDL) operations, parallel insert, online alter column, parallel stats collection, and static and keyset-driven cursor population.
85
85
86
86
To set this option at the instance level, see [Configure the max degree of parallelism Server Configuration Option](../../database-engine/configure-windows/configure-the-max-degree-of-parallelism-server-configuration-option.md).
87
87
@@ -90,7 +90,7 @@ To set this option at the instance level, see [Configure the max degree of paral
90
90
91
91
PRIMARY
92
92
93
-
Can only be set for the secondaries, while the database in on the primary, and indicates that the configuration will be the one set for the primary. If the configuration for the primary changes, the value on the secondaries will change accordingly without the need to set the secondaries value explicitely. **PRIMARY** is the default setting for the secondaries.
93
+
Can only be set for the secondaries, while the database in on the primary, and indicates that the configuration will be the one set for the primary. If the configuration for the primary changes, the value on the secondaries will change accordingly without the need to set the secondaries value explicitly. **PRIMARY** is the default setting for the secondaries.
94
94
95
95
LEGACY_CARDINALITY_ESTIMATION **=** { ON | **OFF** | PRIMARY }
96
96
@@ -114,7 +114,7 @@ Enables or disables [parameter sniffing](../../relational-databases/query-proces
114
114
115
115
PRIMARY
116
116
117
-
This value is only valid on secondaries while the database in on the primary, and specifies that the value for this setting on all secondaries will be the value set for the primary. If the configuration on the primary for using [parameter sniffing](../../relational-databases/query-processing-architecture-guide.md#ParamSniffing) changes, the value on the secondaries will change accordingly without the need to set the secondaries value explicitely. This is the default setting for the secondaries.
117
+
This value is only valid on secondaries while the database in on the primary, and specifies that the value for this setting on all secondaries will be the value set for the primary. If the configuration on the primary for using [parameter sniffing](../../relational-databases/query-processing-architecture-guide.md#ParamSniffing) changes, the value on the secondaries will change accordingly without the need to set the secondaries value explicitly. This is the default setting for the secondaries.
118
118
119
119
QUERY_OPTIMIZER_HOTFIXES **=** { ON | **OFF** | PRIMARY }
120
120
@@ -126,7 +126,7 @@ Enables or disables query optimization hotfixes regardless of the compatibility
126
126
127
127
PRIMARY
128
128
129
-
This value is only valid on secondaries while the database in on the primary, and specifies that the value for this setting on all secondaries will be the value set for the primary. If the configuration for the primary changes, the value on the secondaries will change accordingly without the need to set the secondaries value explicitely. This is the default setting for the secondaries.
129
+
This value is only valid on secondaries while the database in on the primary, and specifies that the value for this setting on all secondaries is the value set for the primary. If the configuration for the primary changes, the value on the secondaries changes accordingly without the need to set the secondaries value explicitly. This is the default setting for the secondaries.
130
130
131
131
CLEAR PROCEDURE_CACHE
132
132
@@ -146,11 +146,11 @@ Enables or disables identity cache at the database level. The default is **ON**.
146
146
on the database. This permission can be granted by a user with CONTROL permission on a database.
147
147
148
148
## General Remarks
149
-
While you can configure secondary databases to have different scoped configuration settings from their primary, all secondary databases will use the same configuration. Different settings cannot be configured for individual secondaries.
149
+
While you can configure secondary databases to have different scoped configuration settings from their primary, all secondary databases use the same configuration. Different settings cannot be configured for individual secondaries.
150
150
151
-
Executing this statement will clear the procedure cache in the current database, which means that all queries will have to recompile.
151
+
Executing this statement clears the procedure cache in the current database, which means that all queries have to recompile.
152
152
153
-
For 3-part name queries, the settings for the current database connection for the query will be honored, other than for SQL modules (e.g. procedures, functions, and triggers) that are compiled in the current database context and therefore will use the options of the database in which they reside.
153
+
For 3-part name queries, the settings for the current database connection for the query is honored, other than for SQL modules (such as procedures, functions, and triggers) that are compiled in the current database context and therefore uses the options of the database in which they reside.
154
154
155
155
The ALTER_DATABASE_SCOPED_CONFIGURATION event is added as a DDL event that can be used to fire a DDL trigger. This is a child of the ALTER_DATABASE_EVENTS trigger group.
156
156
@@ -161,7 +161,7 @@ on the database. This permission can be granted by a user with CONTROL permissio
161
161
162
162
- Query hint overrides both the sp_configure and the database scoped setting. If the resource group MAXDOP is set for the workload group:
163
163
164
-
- If the query hint is set to 0 it is overridden by the resource governor setting.
164
+
- If the query hint is set to 0, it is overridden by the resource governor setting.
165
165
166
166
- If the query hint is not 0, it is capped by the resource governor setting.
167
167
@@ -171,15 +171,15 @@ on the database. This permission can be granted by a user with CONTROL permissio
171
171
172
172
**QUERY_OPTIMIZER_HOTFIXES**
173
173
174
-
When QUERYTRACEON hint is used to enable the legacy query optimizer or query optimizer hotfixes, it would be an OR condition between the query hint and the database scoped configuration setting, meaning if either is enabled, the options will apply.
174
+
When QUERYTRACEON hint is used to enable the legacy query optimizer or query optimizer hotfixes, it would be an OR condition between the query hint and the database scoped configuration setting, meaning if either is enabled, the options apply.
175
175
176
176
**GeoDR**
177
177
178
-
Readable secondary databases, e.g. Always On Availability Groups and GeoReplication, use the secondary value by checking the state of the database. Even though we don’t recompile on failover and technically the new primary has queries that are using the secondary settings, the idea is that the setting between primary and secondary will only vary when the workload is different and therefore the cached queries are using the optimal settings, whereas new queries will pick the new settings which are appropriate for them.
178
+
Readable secondary databases, e.g. Always On Availability Groups and GeoReplication, use the secondary value by checking the state of the database. Even though recompile does not occur on failover and technically the new primary has queries that are using the secondary settings, the idea is that the setting between primary and secondary only vary when the workload is different and therefore the cached queries are using the optimal settings, whereas new queries pick the new settings that are appropriate for them.
179
179
180
180
**DacFx**
181
181
182
-
Since ALTER DATABASE SCOPED CONFIGURATION is a new feature in Azure SQL Database and SQL Server 2016 that affects the database schema, exports of the schema (with or without data) will not be able to be imported into an older version of SQL Server e.g. [!INCLUDE[ssSQL11](../../includes/sssql11-md.md)] or [!INCLUDE[ssSQLv14](../../includes/sssqlv14-md.md)]. For example, an export to a [DACPAC](https://msdn.microsoft.com/library/ee210546.aspx#Anchor_3) or a [BACPAC](https://msdn.microsoft.com/library/ee210546.aspx#Anchor_4) from an [!INCLUDE[ssSDS](../../includes/sssds-md.md)] or [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)] database that used this new feature would not be able to be imported into a down-level server.
182
+
Since ALTER DATABASE SCOPED CONFIGURATION is a new feature in Azure SQL Database and SQL Server beginning with SQL Server 2016 that affects the database schema, exports of the schema (with or without data) are not be able to be imported into an older version of SQL Server e.g. [!INCLUDE[ssSQL11](../../includes/sssql11-md.md)] or [!INCLUDE[ssSQLv14](../../includes/sssqlv14-md.md)]. For example, an export to a [DACPAC](https://msdn.microsoft.com/library/ee210546.aspx#Anchor_3) or a [BACPAC](https://msdn.microsoft.com/library/ee210546.aspx#Anchor_4) from an [!INCLUDE[ssSDS](../../includes/sssds-md.md)] or [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)] database that used this new feature would not be able to be imported into a down-level server.
183
183
184
184
## Metadata
185
185
@@ -240,17 +240,15 @@ This example sets PARAMETER_SNIFFING to OFF for a primary database in a geo-repl
240
240
ALTERDATABASE SCOPED CONFIGURATION FOR SECONDARY SET PARAMETER_SNIFFING=OFF ;
241
241
```
242
242
243
-
This example sets PARAMETER_SNIFFING for secondary database as it is on primary database
244
-
in a geo-replication scenario.
243
+
This example sets PARAMETER_SNIFFING for secondary database as it is on primary database in a geo-replication scenario.
245
244
246
245
```sql
247
246
ALTERDATABASE SCOPED CONFIGURATION FOR SECONDARY SET PARAMETER_SNIFFING=PRIMARY ;
248
247
```
249
248
250
249
### E. Set QUERY_OPTIMIZER_HOTFIXES
251
250
252
-
Set QUERY_OPTIMIZER_HOTFIXES to ON for a primary database
253
-
in a geo-replication scenario.
251
+
Set QUERY_OPTIMIZER_HOTFIXES to ON for a primary database in a geo-replication scenario.
254
252
255
253
```sql
256
254
ALTERDATABASE SCOPED CONFIGURATION SET QUERY_OPTIMIZER_HOTFIXES=ON ;
@@ -289,14 +287,13 @@ ALTER DATABASE SCOPED CONFIGURATION SET IDENTITY_CACHE=OFF ;
289
287
*["I smell a parameter!"](https://blogs.msdn.microsoft.com/queryoptteam/2006/03/31/i-smell-a-parameter/)
0 commit comments