Skip to content

Commit f089e31

Browse files
committed
Updated trace flag 3895 info
1 parent 6431fc9 commit f089e31

File tree

2 files changed

+55
-5
lines changed

2 files changed

+55
-5
lines changed

SQL Server Trace Flag.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Microsoft SQL Server Trace Flags
2-
Detailed list of all discovered (documented and undocumented) Microsoft SQL Server trace flags (**602** trace flags).
2+
Detailed list of all discovered (documented and undocumented) Microsoft SQL Server trace flags (**603** trace flags).
33

44
**REMEMBER: Be extremely careful with trace flags, test in your development environment first.
55
And consult professionals first if you are the slightest uncertain about the effects of your changes.**
@@ -280,7 +280,7 @@ Use this trace flag if SQL Server is experiencing high number of [QDS_LOADDB](ht
280280

281281
<a id="trace-flags-list"></a>
282282
## Trace Flags List
283-
Summary: **602 trace flags**
283+
Summary: **603 trace flags**
284284

285285

286286
<a id="-1"></a>
@@ -2735,14 +2735,19 @@ Link: None
27352735

27362736
<a id="3861"></a>
27372737
#### Trace Flag: 3861
2738-
Function: This flag allows the SQL Server DB startup code to move system tables to the primary filegroup. Introduced due to behavior in the SQL 2014 upgrade process, where system tables could be created in a secondary filegroup (if that FG was the default).<br />
2738+
Function: This flag allows the SQL Server DB startup code to move system tables to the primary filegroup.
2739+
Introduced due to behavior in the SQL 2014 upgrade process, where system tables could be created in a secondary filegroup (if that FG was the default).<br />
27392740
Link: https://support.microsoft.com/help/3003760/
27402741

27412742

27422743
<a id="3895"></a>
27432744
#### Trace Flag: 3895
2744-
Function: In SQL Server 2019, when you enable the Memory-Optimized TempDB Metadata feature, this trace flag is automatically enabled after the next restart. When you disable that feature, the trace flag is automatically removed after the next restart.<br />
2745-
Link: None
2745+
**Undocumented trace flag**<br />
2746+
Function: In SQL Server 2019, when you enable the [Memory-Optimized TempDB Metadata](https://docs.microsoft.com/en-us/sql/relational-databases/databases/tempdb-database) feature, this trace flag is automatically enabled after the next restart.
2747+
When you disable that feature, the trace flag is automatically removed after the next restart.
2748+
Also if you add race flag 3895 to startup parameters after restarting SQL Server option `IsTempdbMetadataMemoryOptimized` will be enabled.<br />
2749+
Link: https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Trace_Flag/Trace_Flag_3895.sql<br />
2750+
Scope: global only
27462751

27472752

27482753
<a id="3913"></a>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
https://docs.microsoft.com/en-us/sql/relational-databases/databases/tempdb-database
3+
*/
4+
5+
/* Check is it session trace flag? */
6+
DBCC TRACEON (3895);
7+
GO
8+
/* Answer - no
9+
Ignoring trace flag 3895. It is either an invalid trace flag or a trace flag that can only be specified during server startup.
10+
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
11+
*/
12+
13+
/* Check current working flags */
14+
DBCC TRACESTATUS(-1);
15+
GO
16+
17+
ALTER SERVER CONFIGURATION SET MEMORY_OPTIMIZED TEMPDB_METADATA = ON;
18+
19+
/* RESTART SQL SERVER */
20+
DBCC TRACESTATUS(-1);
21+
GO
22+
23+
SELECT SERVERPROPERTY('IsTempdbMetadataMemoryOptimized') AS IsTempdbMetadataMemoryOptimized;
24+
/* Return 1 (enabled) */
25+
26+
ALTER SERVER CONFIGURATION SET MEMORY_OPTIMIZED TEMPDB_METADATA = OFF;
27+
28+
/* RESTART SQL SERVER */
29+
30+
SELECT SERVERPROPERTY('IsTempdbMetadataMemoryOptimized') AS IsTempdbMetadataMemoryOptimized;
31+
/* Return 0 (disabled) */
32+
33+
34+
/* Add trace flag 3894 in SQL Server startup parameteres using SQL Server Configuration Manager
35+
RESTART SQL SERVER
36+
*/
37+
38+
SELECT SERVERPROPERTY('IsTempdbMetadataMemoryOptimized') AS IsTempdbMetadataMemoryOptimized;
39+
/* Return 1 (enabled) */
40+
41+
/* Remoce trace flag 3894 in SQL Server startup parameteres using SQL Server Configuration Manager
42+
RESTART SQL SERVER
43+
*/
44+
SELECT SERVERPROPERTY('IsTempdbMetadataMemoryOptimized') AS IsTempdbMetadataMemoryOptimized;
45+
/* Return 0 (disabled) */

0 commit comments

Comments
 (0)