Skip to content

Commit d10a124

Browse files
committed
Add recommended section, great thanks to Erin Stellato
1 parent 78d0108 commit d10a124

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

SQL Server Trace Flag.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Headers:
99
- [How do I turn Trace Flags on and off?](#how-do-i-turn-trace-flags-on-and-off)
1010
- [How do I know what Trace Flags are turned on at the moment?](#how-do-i-know-what-trace-flags-are-turned-on-at-the-moment)
1111
- [What Are the Optimizer Rules?](#what-are-the-optimizer-rules)
12+
- [Recommended Trace Flags](#recommended-trace-flags)
1213
- [Trace flags list](#trace-flags-list)
1314

1415
Source links:
@@ -25,6 +26,7 @@ A lowercase "t" is accepted by SQL Server, but this sets other internal trace fl
2526
(Parameters specified in the Control Panel startup window are not read.)**: https://technet.microsoft.com/en-us/en-en/library/ms190737%28v=sql.120%29.aspx
2627
- [Enabling SQL Server Trace Flag for a Poor Performing Query Using QUERYTRACEON](https://www.mssqltips.com/sqlservertip/3320/enabling-sql-server-trace-flag-for-a-poor-performing-query-using-querytraceon/)
2728
- [Disabling SQL Server Optimizer Rules with QUERYRULEOFF](https://www.mssqltips.com/sqlservertip/4175/disabling-sql-server-optimizer-rules-with-queryruleoff/)
29+
- [SQLskills SQL101: Trace Flags](https://www.sqlskills.com/blogs/erin/sqlskills-101-trace-flags/)
2830

2931
**Great thanks to:**
3032
- Aaron Morelli ([blog](https://sqlcrossjoin.wordpress.com) | [@sqlcrossjoin](https://twitter.com/sqlcrossjoin))
@@ -41,6 +43,7 @@ A lowercase "t" is accepted by SQL Server, but this sets other internal trace fl
4143
- Alexander Titenko ([gtihub](https://github.com/AlexTitenko))
4244
- Albert van der Sel
4345
- Amit Banerjee
46+
- Erin Stellato ([blog](http://www.sqlskills.com/blogs/erin/) | [@erinstellato](https://twitter.com/erinstellato))
4447

4548

4649
## What are Microsoft SQL Server Trace Flags? <a id="what-are-microsoft-sql-server-trace-flags"></a>
@@ -112,7 +115,27 @@ GO
112115
| LASJNtoSM | Left Anti Semi Join to Sort Merge |
113116

114117

115-
## Trace flags list <a id="trace-flags-list"></a>
118+
## Recommended Trace Flags
119+
<a id="recommended-trace-flags"></a>
120+
121+
- [Trace Flag 1118](#1118) (for versions prior to SQL Server 2016)
122+
- [Trace Flag 3023](#3023) (for versions prior to SQL Server 2014)
123+
- [Trace Flag 3226](#3226)
124+
125+
Trace flag 1118 addresses contention that can exist on a particular type of page in a database, the SGAM page.
126+
This trace flag typically provides benefit for customers that make heavy use of the tempdb system database.
127+
In SQL Server 2016, you change this behavior using the MIXED_PAGE_ALLOCATION database option, and there is no need for TF 1118.
128+
129+
Trace flag 3023 is used to enable the CHECKSUM option, by default, for all backups taken on an instance.
130+
With this option enabled, page checksums are validated during a backup, and a checksum for the entire backup is generated.
131+
Starting in SQL Server 2014, this option can be set instance-wide through sp_configure (‘backup checksum default’).
132+
133+
The last trace flag, 3226, prevents the writing of successful backup messages to the SQL Server ERRORLOG.
134+
Information about successful backups is still written to msdb and can be queried using T-SQL.
135+
For servers with multiple databases and regular transaction log backups, enabling this option means the ERRORLOG is no longer bloated with BACKUP DATABASE and Database backed up messages. As a DBA, this is a good thing because when I look in my ERRORLOG, I really only want to see errors, I don’t want to scroll through hundreds or thousands of entries about successful backups.
136+
137+
## Trace Flags List
138+
<a id="trace-flags-list"></a>
116139
Summary: **510 trace flags**
117140

118141

@@ -591,6 +614,7 @@ Scope: global only
591614

592615

593616
**Trace Flag: 1118**<br />
617+
<a id="1118"></a>
594618
Function: Removes most single page allocations on the server, reducing contention on the SGAM page.
595619
When a new object is created, by default, the first eight pages are allocated from different extents (mixed extents).
596620
Afterwards, when more pages are needed, those are allocated from that same extent (uniform extent).
@@ -1396,6 +1420,7 @@ Link: https://blogs.msdn.microsoft.com/psssql/2008/02/06/how-it-works-how-does-s
13961420

13971421

13981422
**Trace Flag: 3023**<br />
1423+
<a id="3023"></a>
13991424
Function: Enables CHECKSUM option as default for BACKUP command<br />
14001425
**Note: Beginning with SQL Server 2014 this behavior is controlled by setting the backup checksum default configuration option.
14011426
For more information, see [Server Configuration Options (SQL Server)](https://msdn.microsoft.com/en-us/library/ms189631.aspx)**.<br />
@@ -1515,6 +1540,7 @@ Link: [TECHNET List Of SQL Server Trace Flags]
15151540

15161541

15171542
**Trace Flag: 3226**<br />
1543+
<a id="3226"></a>
15181544
Function: By default, every successful backup operation adds an entry in the SQL Server error log and in the system event log.
15191545
If you create very frequent log backups, these success messages accumulate quickly, resulting in huge error logs in which finding other messages is problematic.
15201546
With this trace flag, you can suppress these log entries. This is useful if you are running frequent log backups and if none of your scripts depend on those entries.<br />
@@ -1523,8 +1549,6 @@ Link: http://www.sqlskills.com/blogs/paul/fed-up-with-backup-success-messages-bl
15231549
Link: https://blogs.msdn.microsoft.com/sqlserverstorageengine/2007/10/30/when-is-too-much-success-a-bad-thing<br />
15241550
Scope: global only
15251551

1526-
*Thanks to: @lwiederstein (https://twitter.com/lwiederstein)*
1527-
15281552

15291553
**Trace Flag: 3422**<br />
15301554
Function: Log record auditing<br />

0 commit comments

Comments
 (0)