diff --git a/SQL Server Trace Flag.md b/SQL Server Trace Flag.md index a553882e..4a9cd896 100644 --- a/SQL Server Trace Flag.md +++ b/SQL Server Trace Flag.md @@ -27,7 +27,7 @@ Headers: - [Trace flags list](#trace-flags-list) Source links: -- [Docs Trace Flags] +- [Docs Trace Flags](https://learn.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql) - [A Topical Collection of SQL Server Flags](https://sqlcrossjoin.wordpress.com/2013/10/28/a-topical-collection-of-sql-server-flags/) (by Aaron Morelli) - [Steinar Andersen great post](http://www.sqlservice.se/updated-microsoft-sql-server-trace-flag-list/) - [Yusuf Anis trace flag table](http://www.sqlservercentral.com/articles/trace+flags/70131/) @@ -1036,6 +1036,23 @@ Function: Enables support for locked pages for SQL 2000
Link: None + +#### Trace Flag: 890 +Function: Suppress long buffer pool scan complete messages (error 898) in the error log. For more information on buffer pool scan and the message that is logged in the error log, see Operations that trigger a buffer pool scan may run slowly on large-memory computers.
+**Note: Applies to SQL Server 2017 (14.x) and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 898 +Function: Disables the Direct Write behavior of the hybrid buffer pool for troubleshooting or debugging purposes.
+**Note: Applies to SQL Server 2022 (16.x) CU 1 and later versions.**
+Link: [Docs Trace Flags]
+Link: https://support.microsoft.com/help/5022375
+Scope: global only + + #### Trace Flag: 902 Function: Bypasses execution of database upgrade script when installing a Cumulative Update or Service Pack. @@ -1649,6 +1666,13 @@ Function: Aaron: Another one that I stumbled onto. Appears to tie memory info an Link: None + +#### Trace Flag: 2338 +Function: Causes SQL Server to use a narrow plan when executing an UPDATE statement to update indexes in a table. When you do an UPDATE against a clustered index column, SQL Server updates not only the clustered index itself, but also all the nonclustered indexes because the nonclustered indexes contain the cluster key. This trace flag forces a narrow plan update (Per-Row Update).
+Link: [Docs Trace Flags]
+Scope: global or session or query + + #### Trace Flag: 2340 Function: Causes SQL Server not to use a sort operation (batch sort) for optimized Nested Loops joins when generating a plan. @@ -1851,6 +1875,15 @@ Function: SQL 10 - Parallel query execution strategy on partitioned tables. SQL Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/dc010af9-afa0-4c87-937c-4343b4e1119a/trace-flag-2440 + +#### Trace Flag: 2446 +Function: Causes SQL Server to generate a Showplan XML fragment with the ParameterRuntimeValue when using the lightweight query execution statistics profiling infrastructure or executing the sys.dm_exec_query_statistics_xml DMV while troubleshooting long running queries.
+**Note: Applies to SQL Server 2017 (14.x) CU 31, SQL Server 2019 (15.x) CU 19, and SQL Server 2022 (16.x) and later versions.**
+**Warning: Trace flag 2446 is not meant to be enabled continuously in a production environment, but only for time-limited troubleshooting purposes.**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 2451 **Note: This trace flag applies to SQL Server 2019 preview CTP 2.4 and higher builds.** @@ -2233,6 +2266,22 @@ Link: [Docs Trace Flags]
Scope: global or session + +#### Trace Flag: 2610 +Function: Enables memory dump compression and faster dump generation with SQLDumper and via DBCC STACKDUMP.
+**Note: Applies to SQL Server 2022 (16.x) CU 8, SQL Server 2019 (15.x) CU 23, and later versions.**
+Link: [Docs Trace Flags]
+Scope: global or session + + + +#### Trace Flag: 2616 +Function: Enables the stack signature feature to make Sqldumper.exe generate a single dump per unique stack signature per hour, which avoids potential dump flooding problems when the same issue repeats frequently within one hour.
+**Note: Applies to SQL Server 2022 (16.x) CU 12 and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 2701 Function: SQL 6.5 - Sets the `@@ERROR` system function to 50000 for `RAISERROR` messages with severity levels of 10 or less. When disabled, sets the @@ERROR system function to 0 for RAISERROR messages with severity levels of 10 or less
@@ -2288,6 +2337,14 @@ Link: https://www.sqlservergeeks.com/sql-server-trace-flag-3014/
Scope: session only + +#### Trace Flag: 3015 +Function: Disables writing backups to Azure immutable storage.
+**Note: Applies to SQL Server 2025 (17.x) and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 3023 @@ -2454,6 +2511,22 @@ Link: http://www.sqlskills.com/blogs/kimberly/understanding-backups-and-log-rela Scope: ? + +#### Trace Flag: 3261 +Function: Disables differential database backups on secondary replica of an Always On availability group.
+**Note: Applies to SQL Server 2025 (17.x).**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 3262 +Function: Disables full database backups on secondary replica of an Always On availability group.
+**Note: Applies to SQL Server 2025 (17.x).**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 3282 **Undocumented trace flag**
@@ -2507,6 +2580,15 @@ Link: [TEMPDB – Files and Trace Flags and Updates]
Scope: global only + +#### Trace Flag: 3428 +Function: The Always On Redo Thread on a secondary replica can sometimes be blocked by T-SQL queries, which can cause delays in synchronization. This trace flag terminates such blocking queries by setting their lock timeout to 60 seconds.
+**Warning: Be sure that you test and understand this option before deploying it in a production environment as queries might be terminated.**
+**Note: Applies to SQL Server 2019 (15.x).**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 3448 Function: Introduced in the KB to fix a race condition leading to a hung database in mirroring failover situations. “ This trace flag forces new connections to keep checking for @@ -2860,6 +2942,21 @@ Function: According to Bob Ward’s PASS 2014 SQL Server IO talk, forces the Eag Link: None + +#### Trace Flag: 3880 +Function: Disable the timer task that checks the state of a resumable index.
+**Note: Applies to SQL Server 2017 (14.x) and later versions and is intended for high-end systems with high performance workloads.**
+Link: [Docs Trace Flags]
+Scope: global or session + + + +#### Trace Flag: 3972 +Function: Disables concurrent Page Free Space (PFS) updates feature.
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 3979 **Undocumented trace flag**
@@ -2966,6 +3063,14 @@ Link: http://www.sqlservergeeks.com/sql-server-trace-flag-4032/
Scope: global only + +#### Trace Flag: 4043 +Function: Fixes an error that occurs when you apply a security policy on PolyBase external table and use Row-Level Security (RLS) in SQL Server 2019 (15.x).
+Link: https://support.microsoft.com/help/4552159
+Link: [Docs Trace Flags]
+Scope: global or session + + #### Trace Flag: 4044 Function: SA account can be unlocked by rebooting server with trace flag. If sa (or sso_role) password is lost, add this to your RUN_serverfile. This will generate new password when server started.
@@ -3460,6 +3565,14 @@ Link: [KB2964518]
Scope: global only + +#### Trace Flag: 6408 +Function: Enables visibility of the estimated execution plan to see the remote query plan of PolyBase pushdown computation.
+**Note: Applies to SQL Server 2019 (15.x) and later versions.**
+Link: [Docs Trace Flags]
+Scope: global or session or query + + #### Trace Flag: 6545 Function: Enables "CLR strict security" behavior (introduced in SQL Server 2017) in SQL Server 2012, SQL Server 2014, and SQL Server 2016. @@ -3522,6 +3635,14 @@ Function: Disable table lock promotion for text columns
Link: None + +#### Trace Flag: 7117 +Function: Mitigates an assertion failure that you might encounter when you have multiple nested inserts. This trace flag enables the persistent version store (PVS) cleaner thread to proceed, if the PVS bit is set for a row that might have been part of an aborted transaction.
+**Note: Applies to SQL Server 2022 (16.x) CU 9 and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 7300 Function: Outputs extra info about linked server errors
@@ -4030,6 +4151,37 @@ Scope: global only +#### Trace Flag: 8086 +Function: Disable NUMA locality check for memory commits.
+**Note: Applies to SQL Server 2019 (15.x) and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 8089 +Function: In SQL Server 2017 (14.x) CU 16, enables the bitmap filtering for reducing the size of filtered memory dumps. Starting with SQL Server 2017 (14.x) CU 20, bitmap filtering is enabled by default and trace flag 8089 no longer applies.
+Link: [Docs Trace Flags]
+Link: https://support.microsoft.com/help/4488943
+Scope: global only + + + +#### Trace Flag: 8095 +Function: Disables the bitmap filtering for filtered memory dumps. This trace flag applies to builds where bitmap filtering is enabled by default.
+**Note: Applies to SQL Server 2016 (13.x) CU 13 and later, SQL Server 2017 (14.x) CU 20 and later, and SQL Server 2019 (15.x).**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 8099 +Function: Enables a spinlock contention fix for high-end systems running SQL Server 2019 (15.x) serving many concurrent users. Starting with SQL Server 2019 (15.x) CU 4, this behavior is enabled by default.
+Link: [Docs Trace Flags]
+Link: https://support.microsoft.com/help/4538688
+Scope: global only + + #### Trace Flag: 8101 Function: Enables a spinlock contention fix for high-end systems running SQL Server 2019 (15.x) serving many concurrent users.
Note: This trace flag applies to SQL Server 2019 (15.x) CU2 and higher builds.
@@ -4037,6 +4189,46 @@ Link: https://support.microsoft.com/kb/4538688
Scope: global only + +#### Trace Flag: 8102 +Function: Addresses a high-CPU scenario caused by spinlock contention on the XVB_LIST spinlock. This trace flag staggers the spinlock backoffs and can be enabled together with trace flag 8101.
+**Note: Applies to SQL Server 2019 (15.x).**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 8121 +Function: Fixes a system-wide low memory issue that occurs when SQL Server commits memory above the maximum server memory under the memory model with the Lock Pages In Memory security policy setting.
+**Note: Applies to SQL Server 2019 (15.x). For SQL Server 2022 (16.x) and later, this functionality is enabled by default.**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 8134 +Function: Enables the tracking of spinlock waits with the SPINLOCK_EXT wait type. You can enable this trace flag when troubleshooting high CPU utilization to confirm or rule out a spinlock contention problem.
+**Note: Applies to SQL Server 2025 (17.x).**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 8142 +Function: Partitions the specific spinlock-protected list by CPU, up to 64 partitions. Should be used only on large-memory machines experiencing SOS_BLOCKALLOCPARTIALLIST spinlock contention with elevated CPU utilization. See also trace flag 8145.
+**Note: Applies to SQL Server 2019 (15.x) CU 21 and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 8145 +Function: Modifies the partitioning enabled by trace flag 8142 to be per soft-NUMA node, instead of per CPU. You must also enable trace flag 8142 for this setting to take effect.
+**Note: Applies to SQL Server 2019 (15.x) CU 21 and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 8202 Function: Used to replicate `UPDATE` as `DELETE/INSERT` pair at the publisher. i.e. UPDATE commands at the publisher can be run as an "on-page DELETE/INSERT" or a "full DELETE/INSERT". @@ -4069,6 +4261,64 @@ Scope: global only +#### Trace Flag: 8239 +Function: When trace flag 8239 is set, a safe_cleanup_version() value less than the cleanup point is ignored, and change tracking cleanup runs. Incorrect use of this trace flag can lead to data corruption.
+**Note: Applies to SQL Server 2022 (16.x) CU 3 and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 8273 +Function: Disables adaptive shallow cleanup for change tracking.
+**Note: Applies to SQL Server 2025 (17.x) and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 8284 +Function: Fixes a manual cleanup issue where repeated lock escalations on the tables cause contention and slowness in cleaning up the expired change tracking metadata.
+**Note: Applies to SQL Server 2019 (15.x) CU 21 and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 8285 +Function: Converts an assertion failure to an exception to prevent a dump issue under certain circumstances when change tracking is enabled on a database that has snapshot isolation turned on.
+**Note: Applies to SQL Server 2022 (16.x) CU 6, SQL Server 2019 (15.x) CU 21, and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 8286 +Function: Forces the change tracking cleanup query to use the FORCE ORDER hint to improve performance. Can be used with trace flag 8287 to use the FORCESEEK hint.
+**Note: Applies to SQL Server 2019 (15.x) CU 19, SQL Server 2022 (16.x) CU 1, and later versions.**
+Link: [Docs Trace Flags]
+Link: https://support.microsoft.com/help/5022375
+Scope: global only + + + +#### Trace Flag: 8287 +Function: Forces the change tracking cleanup query to use the FORCESEEK hint to improve performance. Can be used with trace flag 8286 to use the FORCE ORDER hint.
+**Note: Applies to SQL Server 2019 (15.x) CU 19, SQL Server 2022 (16.x) CU 1, and later versions.**
+Link: [Docs Trace Flags]
+Link: https://support.microsoft.com/help/5022375
+Scope: global only + + + +#### Trace Flag: 8290 +Function: After this trace flag is enabled, the change tracking (CT) auto cleanup process will reset any invalid cleanup version to a cleanup version based on the retention period.
+**Note: Applies to SQL Server 2017 (14.x) CU 19, SQL Server 2019 (15.x) CU 4, SQL Server 2022 (16.x), and later versions.**
+Link: [Docs Trace Flags]
+Link: https://support.microsoft.com/help/4538365
+Scope: global or session + + #### Trace Flag: 8209 Function: Output extra information to error log regarding replication of schema changes in SQL Server Replication
Link: None @@ -4109,6 +4359,13 @@ Link: [SQL Server 2019 CU29 Documentation](https://learn.microsoft.com/en-us/tro +#### Trace Flag: 8558 +Function: Enables a fix to ensure that when RCSI isolation level is enabled, a transaction can always see the latest data from tables modified using DTC transactions after xa_commit returns success.
+**Note: Applies to SQL Server 2019 (15.x) CU 18, SQL Server 2022 (16.x), and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 8599 Function: Allows you to use a save-point within a distributed transaction
Link: None @@ -4570,6 +4827,14 @@ Function: Enables new (in 7.0) code to correct a problem with the SHRINK command Link: None + +#### Trace Flag: 8902 +Function: Disable locked pages for IO operations for high-end systems with high performance workloads.
+**Note: Applies to SQL Server 2019 (15.x) and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 8903 Function: Allows SQL Server to use a specific API (SetFileIoOverlappedRange) when Locked Pages in Memory is enabled.
@@ -4578,6 +4843,15 @@ Link: https://support.microsoft.com/kb/2679255
Link: https://blogs.msdn.microsoft.com/psssql/2013/10/16/every-time-i-attach-database-sql-logs-error-1314-for-setfileiooverlappedrange + +#### Trace Flag: 8904 +Function: Enables a fix to address a parallel redo failure on a secondary replica by disabling inlined log IO, limiting the contention possibility from many workers to the subset of background LogWriter workers.
+**Note: Applies to SQL Server 2019 (15.x) only, starting with CU 12.**
+Link: [Docs Trace Flags]
+Link: https://support.microsoft.com/help/5004649
+Scope: global only + + #### Trace Flag: 9024 Function: Converts a global log pool memory object into NUMA node partitioned memory object
@@ -4711,6 +4985,14 @@ Function: SQL 8 - Does additional reads to test if the page is allocated & linke Link: https://support.microsoft.com/kb/815008 + +#### Trace Flag: 9135 +Function: Prevents the usage of indexed views. To accomplish this at the query level, add the USE HINT 'EXPAND VIEWS' query hint instead of using this trace flag.
+**Note: Applies to SQL Server 2019 (15.x) CU 23, SQL Server 2022 (16.x) CU 19, and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 9136 Function: “PRB: You receive error message 8623 when you try to run a query that joins multiple tables”
@@ -5027,6 +5309,14 @@ Link: [SQL Server 2017: Adaptive Join Internals]
Scope: ? + +#### Trace Flag: 9440 +Function: Disables the fix for outer join cardinality estimation overestimation when join predicates consist of primary keys. The bug fix doesn't apply when using the legacy CE model. This trace flag only applies to databases with a compatibility level of 160 and lower.
+**Note: Applies to SQL Server 2019 (15.x) CU 20, SQL Server 2022 (16.x) CU 9, and later versions.**
+Link: [Docs Trace Flags]
+Scope: global or session or query + + #### Trace Flag: 9424 **Undocumented trace flag**
@@ -5322,6 +5612,22 @@ Function: Software Usage Metrics is disabled.
Link: [Bad Idea Jeans: Finding Undocumented Trace Flags] + +#### Trace Flag: 9708 +Function: Enables collection of event publishing metrics for extended event sessions.
+**Note: Applies to SQL Server 2022 (16.x) and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + + +#### Trace Flag: 9714 +Function: Enables the SQL Server error log to record the start or stop of Extended Events (XEvents) sessions.
+**Note: Applies to SQL Server 2022 (16.x) CU 15 and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 9806 **Undocumented trace flag**
@@ -5343,6 +5649,14 @@ Function: Unknown. Is turned on on SQL Server 2014 CTP1 standard installation in Link: None + +#### Trace Flag: 9810 +Function: Disables the In-Memory OLTP engine from reclaiming Thread Local Storage (TLS) memory. In SQL Server 2022 (16.x), a new memory optimization causes the In-Memory OLTP engine to reclaim TLS memory. This trace flag reverts to the behavior before SQL Server 2022 (16.x).
+**Note: Applies to SQL Server 2022 (16.x) and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 9830 **Undocumented trace flag**
@@ -5375,6 +5689,13 @@ be sure to turn off the trace flag when done testing.
Link: http://gsl.azurewebsites.net/Portals/0/Users/dewitt/talks/HekatonWhitePaper.pdf + +#### Trace Flag: 9898 +Function: Changes the memory partitioning scheme for the In-Memory OLTP engine from per-CPU to per-NUMA node. For existing In-Memory OLTP objects in a database, takes effect only after the server is restarted or when a database is brought online.
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 9929 Function: Enables an update that reduces the “disk footprint [of In-Memory OLTP] by reducing the In-Memory checkpoint files to 1 MB (megabytes) each.” @@ -5394,6 +5715,22 @@ Link: [Parallelism in Hekaton (In-Memory OLTP)] Scope: global or session + +#### Trace Flag: 9944 +Function: Enables a non-default fix for slow database recovery time when a database has a large number of memory optimized tables or memory optimized table types, and blocking with PREMPTIVE_OS_FINDFILE or PREEMPTIVE_OS_CREATEDIRECTORY wait types might be observed.
+Link: [Docs Trace Flags]
+Link: https://support.microsoft.com/help/4090789
+Scope: global only + + + +#### Trace Flag: 9953 +Function: Reuses the hidden schedulers used by the Memory Optimized tables.
+**Note: Applies to SQL Server 2019 (15.x) CU 20 and later versions, and SQL Server 2022 (16.x) CU 3 and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 9989 **Undocumented trace flag**
@@ -5409,6 +5746,14 @@ This DMV is not in SQL 2014 RTM and Sunil did not perform this demo during the s Link: None + +#### Trace Flag: 10054 +Function: Disables the SQL Server Query Optimizer rule that decorrelates subqueries in OR predicates into outer joins.
+**Note: Applies to SQL Server 2019 (15.x) and later versions.**
+Link: [Docs Trace Flags]
+Scope: global or session or query + + #### Trace Flag: 10204 Function: Disables merge/recompress during columnstore index reorganization. @@ -5455,6 +5800,14 @@ Link: https://blogs.msdn.microsoft.com/sqlcat/2016/12/08/improve-query-performan Scope: global or session + +#### Trace Flag: 10460 +Function: Causes the SQL Server Stretch Database feature to provision a stretched table within the Azure SQL Database Hyperscale service tier.
+**Note: Applies to SQL Server 2017 (14.x) CU 31, SQL Server 2019 (15.x) CU 18, and SQL Server 2022 (16.x) and later versions.**
+Link: [Docs Trace Flags]
+Scope: global only + + #### Trace Flag: 10809 **Undocumented trace flag**