Microsoft SQL Serverトレースフラグの完全なリスト

Microsoft SQL Serverトレースフラグ



Microsoft SQL Serverトレースフラグの完全なリスト(現在359トレースフラグ)。







覚えておいてください:トレースフラグには細心の注意を払ってください;まずテスト環境でそれらの影響を確認してください。







定期的に英語で更新されるマークダウンのGithubバージョンは、 SQL Server Trace Flagで入手できます。







更新情報



2016年12月12日更新 :15個のトレースフラグを追加、40個を超えるフラグに関する情報を更新

2016年11月4日更新 :26個のトレースフラグが追加されました。ありがとうございます@EzhovEA

2016年9月9更新 :トレースフラグ9851を追加、 @ JeStoneDevに感謝

2016-08-11更新 :トレースフラグ6533を追加







他のMicrosoft SQL Serverの記事にも興味があるかもしれません。









見出し:









ソース:









どうもありがとう:









Microsoft SQL Serverのトレースフラグとは何ですか?



トレースフラグは、特定のサーバー特性を一時的に設定したり、特定のモードを無効にするために使用されます。

トレースフラグは、パフォーマンスの問題の診断、ストアドプロシージャのデバッグ、または複雑なコンピューターシステムによく使用されます。

MSDN: https : //msdn.microsoft.com/en-us/library/ms188396(v=sql.120).aspx







トレースフラグを有効または無効にする方法





現在有効になっているトレースフラグを確認する方法



DBCC TRACESTATUSコマンドを使用できます







次の例は、現在グローバルに有効になっているすべてのトレースフラグのステータスを示しています。







DBCC TRACESTATUS(-1); GO
      
      





次の例は、トレースフラグ2528および3205のステータスを示しています。







 DBCC TRACESTATUS (2528, 3205); GO
      
      





次の例は、トレースフラグ3205がグローバルに有効になっているかどうかを示しています。







 DBCC TRACESTATUS (3205, -1); GO
      
      





次の例は、現在のセッションで有効になっているすべてのトレースフラグのリストを示しています。







 DBCC TRACESTATUS (); GO
      
      





オプティマイザールールとは何ですか?



SQL Serverは、クエリを実行するたびに、結合や述語などの論理操作をSQL Serverソースコードに実装されている物理操作に変換する実行計画を作成します。

この変換は、オプティマイザールールと呼ばれる特定のルールに基づいています。 たとえば、内部結合の作成方法を決定します。

内部結合から単純な選択演算子を作成すると、クエリオプティマイザーは、統計、インデックス、および関連するルールに基づいて、結合の実行方法(結合結合、ネストされたループまたはハッシュなど)、および結合が結合の可換プロパティを使用できるかどうかを選択します

数学的には、AとBを結合することはBとAを結合することと同等ですが、計算コストは​​原則として大幅に変化する可能性があります。







使用可能なすべてのルールをリストします。



SQL Serverのバージョンのルールを一覧表示するには、文書化されていないDBCC



SHOWONRULES



およびSHOWOFFRULES



使用する必要がありSHOWOFFRULES





これらのコマンドは、サーバー全体の有効なルールと無効なルールを表示します。 ルールの数はバージョンによって異なります。







 USE master; GO DBCC TRACEON(3604); GO DBCC SHOWONRULES; GO DBCC SHOWOFFRULES; GO
      
      





ルール 説明
ジャントン ネストされたループに参加する
JntoHS ハッシュに参加
Jntosm ソートマージに参加
LOJNtoNL ネストされたループへの左外部結合
LSJNtoHS ハッシュへの左半結合
LASJNtoSM マージをソートするための左の反半結合


トレースフラグのリスト



合計:359個のトレースフラグ







トレースフラグのリスト



合計:359個のトレースフラグ







トレースフラグ:-1

目的:単一のクライアント接続ではなく、すべてのクライアント接続にトレースフラグを設定します。 -Tコマンドラインオプションを使用して設定されたトレースフラグはすべての接続に自動的に適用されるため、このトレースフラグは、DBCC TRACEONおよびDBCC TRACEOFFを使用してトレースフラグを設定する場合にのみ使用されます。

リンク: http : //www.sql-server-performance.com/2002/traceflags/







トレースフラグ:101

目的:トラブルシューティングのための冗長マージレプリケーションログ出力

合併replのパフォーマンス

リンク: http : //support.microsoft.com/kb/2892633







トレースフラグ:102

関数:msmerge_historyテーブルへの詳細なマージレプリケーションログ

Merger replパフォーマンスのトラブルシューティング用

リンク: http : //support.microsoft.com/kb/2892633







トレースフラグ:105

機能:SQL Server 6.5で16を超えるテーブルを結合する

リンク: http : //www.databasejournal.com/features/mssql/article.php/1443351/SQL-Server-65-Some-Useful-Trace-Flags.htm







トレースフラグ:106

目的:これにより、Web同期を使用している場合、パブリッシャーとの間で送受信されるメッセージを表示できます。

リンク: http : //technet.microsoft.com/en-us/library/ms151872(v=sql.105).aspx







トレースフラグ:107

目的:SQL 6.5 / 7/8-小数点を使用して数値を小数点ではなく浮動小数点として解釈します

リンク: http : //support.microsoft.com/kb/203787

リンク: https : //support.microsoft.com/en-us/kb/155714







トレースフラグ:110

目的:SQL 6.5-ANSI選択特性をオフにします

リンク: https : //support.microsoft.com/en-us/kb/152032







トレースフラグ:144

目的:サーバー側のバケット化を強制します。

クライアント側コードの変更がオプションではないレガシーアプリケーションの場合

アプリケーションに不適切にパラメーター化されたクエリがある場合、このトレースフラグはサーバー側のバケット化を強制します。

リンク: http : //blogs.msdn.microsoft.com/sqlprogrammability/2007/01/13/6-0-best-programming-practices







トレースフラグ:146

目的:暗号化された接続の設定を回避するために、SQL 8.0でリプレイする際の使用を検討してください。

リンク:いいえ







トレースフラグ:168

予定:ORDER BYのバグ修正

リンク: http : //support.microsoft.com/kb/926292







トレースフラグ:174

目的:64ビットシステムでSQL Serverデータベースエンジンのプランキャッシュバケット数を40,009から160,001に増やします。

注:このオプションを実稼働環境に展開する前に、このオプションを徹底的にテストしてください。

リンク: https : //support.microsoft.com/en-us/kb/3026083

リファレンス: MSDN ms188396

適用方法:グローバルのみ







トレースフラグ:204

目的:SQL 6.5-非ANSI標準動作を有効にする下位互換性スイッチ。 たとえば、以前はSQL Serverはlikeステートメントの末尾の空白を無視し、集計関数を含むクエリでselectリストにないgroup by句にアイテムを含めることができました。

リンク:いいえ







トレースフラグ:205

目的:統計に依存するストアドプロシージャが統計の自動更新の結果として再コンパイルされるときに、エラーログに報告します。

リンク: https : //support.microsoft.com/en-us/kb/195565

リファレンス: MSDN ms188396

適用方法:グローバルのみ







トレースフラグ:206

目的:SQL 6.5-set userステートメントの後方互換性を提供します。 KB 160732

リンク:いいえ







トレースフラグ:208

機能:SET QUOTED IDENTIFIER ON

リンク:いいえ







トレースフラグ:210

目的:SQL 9-ビューに対してクエリを実行するとエラー:「バッチの実行中にエラーが発生しました」

リンク: https : //support.microsoft.com/en-us/kb/945892







トレースフラグ:212

目的:SQL 9-カーソルを使用してクエリを実行する場合、SQL 8と比較すると、クエリの実行がはるかに遅くなることがあります

リンク: https : //support.microsoft.com/en-us/kb/951184







トレースフラグ:237

目的:非ANSI標準下位互換モードで相関サブクエリを使用するようにSQL Serverに指示します

リンク:いいえ







トレースフラグ:242

目的:非ANSI標準の結果が必要な相関サブクエリの下位互換性を提供します

リンク:いいえ







トレースフラグ:243

目的:nullability動作の下位互換性を提供します。 設定すると、SQL Serverのバージョン4.2と同じnullability違反動作が発生します。コンパイル時にnullabilityエラー(NOT NULLフィールドにNULLを挿入)を検出できる場合、バッチ全体の処理が終了します。 問題のある行の処理はスキップされますが、実行時にnullability違反が検出された場合、コマンドは続行されます。実行時にnullabilityチェックが行われ、nullability違反によりコマンドが終了し、バッチまたはトランザクションプロセスが続行します。

リンク:いいえ







トレースフラグ:244

目的:許可された暫定制約違反のチェックを無効にします。 既定では、SQL Serverは暫定的な制約違反をチェックして許可します。 暫定制約違反は、すべて単一のステートメントおよびトランザクション内で制約が満たされるように違反を削除する変更によって引き起こされます。 SQL Serverは、自己参照DELETEステートメント、INSERT、および複数行UPDATEステートメントの暫定制約違反をチェックします。 このチェックには、より多くの作業テーブルが必要です。 このトレースフラグを使用すると、一時的な制約違反を禁止できるため、必要な作業テーブルが少なくなります。

リンク:いいえ







トレースフラグ:246

目的:派生列またはNULL列には、select ... INTOで明示的に名前を付けるか、ビューステートメントを作成しない場合、エラーが発生する必要があります。 このフラグはそれを回避します。

リンク:いいえ







トレースフラグ:253

目的:アドホッククエリプランがキャッシュ内に留まるのを防ぎます

リンク: http : //www.sqlservercentral.com/Forums/Topic837613-146-1.aspx







トレースフラグ:257

目的:返される前にXML出力で印刷アルゴリズムを呼び出し、XML結果を読みやすくします。

リンク:いいえ







トレースフラグ:260

目的:拡張ストアドプロシージャのダイナミックリンクライブラリ(DLL)に関するバージョン情報を出力します。

GetXpVersion()の詳細については、 拡張ストアドプロシージャの作成を参照してください。

リンク: http : //msdn.microsoft.com/en-us/library/ms164627.aspx

リファレンス: MSDN ms188396

適用方法:グローバルまたはセッション







トレースフラグ:262

目的:SQL 7-CASEステートメントのリテラル文字列から末尾のスペースが切り捨てられなくなりました

リンク: https : //support.microsoft.com/en-us/kb/891116







トレースフラグ:272

目的:IDの増分ごとにログレコードを生成します。 ユーザーになることができます

SQL 2012を古いスタイルのID動作に戻す方法

リンク: http : //www.big.info/2013/01/how-to-solve-sql-server-2012-identity.html

リンク: https : //connect.microsoft.com/SQLServer/feedback/details/739013/failover-or-restart-results-in-reseed-of-identity







トレースフラグ:302

目的:出力インデックス選択情報

リンク: http : //www.databasejournal.com/features/mssql/article.php/1443351/SQL-Server-65-Some-Useful-Trace-Flags.htm







トレースフラグ:310

機能:実際の結合順序に関する情報を出力する

リンク: http : //www.databasejournal.com/features/mssql/article.php/1443351/SQL-Server-65-Some-Useful-Trace-Flags.htm







トレースフラグ:320

目的:ANSI結合で使用される結合順序ヒューリスティックを無効にします。 結合順序ヒューリスティックを確認するには、フラグ310を使用します。SQLServerは、結合順序ヒューリスティックを使用して、最適な結合順序を使用するときに順列を減らします。

リンク:いいえ







トレースフラグ:323

目的:更新に関する詳細情報を出力します

リンク: http : //www.databasejournal.com/features/mssql/article.php/1443351/SQL-Server-65-Some-Useful-Trace-Flags.htm







トレースフラグ:325

目的:非クラスター化インデックスまたは並べ替えを使用してORDER BY句を処理するコストに関する情報を出力します

リンク:いいえ







トレースフラグ:326

目的:ソートの推定および実際のコストに関する情報を出力します。 統計の更新時に幾何学的加重平均ではなく、密度の計算時に算術平均を使用するようにサーバーに指示します。 インデックスの先頭列にスキューがある場合、より良い統計を構築するのに役立ちます。 既知の歪んだデータでテーブル/インデックスの統計を更新するためにのみ使用します。

リンク:いいえ







トレースフラグ:330

機能:SET SHOWPLAN_ALLオプションを使用すると、完全な出力が有効になり、結合に関する詳細情報が提供されます。

リンク:いいえ







トレースフラグ:342

目的:疑似マージ結合のコスト計算を無効にして、特定のタイプの大規模な複数テーブル結合の解析に費やされる時間を大幅に削減します。 また、クエリはFROM句で指定された順序を使用するように強制されるため、SET FORCEPLAN ONを使用して擬似マージ結合のコスト計算を無効にすることもできます。

リンク:いいえ







トレースフラグ:345

目的:SQL Server 6.5の結合順序選択ロジックを変更します

リンク: http : //www.databasejournal.com/features/mssql/article.php/1443351/SQL-Server-65-Some-Useful-Trace-Flags.htm







トレースフラグ:445

目的:3605と一緒に使用すると、コンパイルされた各ステートメントのエラーログに「コンパイル発行」メッセージを出力します

リンク:いいえ







トレースフラグ:506

目的:変数とパラメーターを比較するためのNULL値に関するSQL-92標準を適用します。 NULLを含む変数とパラメーターを比較すると、常にNULLになります。

リンク:いいえ







トレースフラグ:610

目的:インデックス付きテーブルへの最小限のログ挿入を制御します。

リンク: http : //msdn.microsoft.com/en-us/library/dd425070%28v=SQL.100%29.aspx

リンク: https : //www.pythian.com/blog/minimally-logged-operations-data-loads/

リンク: https : //msdn.microsoft.com/library/dd425070.aspx

リファレンス: MSDN ms188396

適用方法:グローバルまたはセッション







トレースフラグ:611

目的:SQL 9-オンにすると、各ロックエスカレーションがSQL Serverのハンドル番号とともにエラーログに記録されます。

アーロンは、これがSQL 2014でも機能することを確認しました。

ロック-理由:LOCK_THRESHOLD、モード:S、粒度:TABLE、テーブル:222623836、

HoBt:150:256、HoBt Lock Count:6248、Escalated Lock Count:6249、Line Number:1

開始オフセット:0、SQLステートメント:dbo.BigTableからカウント(*)を選択

リンク:いいえ







トレースフラグ:617

目的:SQL 9-オンにすると、各ロックエスカレーションがSQL Serverのハンドル番号とともにエラーログに記録されます。

「ロック待機リスト」で待機しているSCH_Mロック要求がない限り、

「ロック待機リスト」は、コミットされていない読み取りトランザクション分離レベルで発行されたステートメントによってバイパスされます。

「ロック待機リスト」にSCH_Mロック要求がある場合、コミットされていない読み取りトランザクション分離レベルのクエリ

「ロック待機リスト」をバイパスしませんが、SCH_Sロック要求は「ロック待機リスト」に入ります。

同じリストで待機しているSCH_Mロックの背後にある順番。 その結果、そのようなクエリに対するSCH_S要求の許可

「ロック待機リスト」に入る以前のSCH_Mロック要求の許可と解放に依存します。

リンク: https : //blogs.msdn.microsoft.com/saponsqlserver/2014/01/17/new-functionality-in-sql-server-2014-part-3-low-priority-wait/







トレースフラグ:634

目的:バックグラウンド列ストア圧縮タスクを無効にします。 SQL Serverは、列ストアインデックス行グループを非圧縮データで一度に1つずつ圧縮するTuple Moverバックグラウンドタスクを定期的に実行します。

列ストアの圧縮により、クエリのパフォーマンスが向上しますが、システムリソースも消費します。

トレースフラグ634を使用してバックグラウンド圧縮タスクを無効にしてから、選択時にALTER INDEX REORGANIZEまたはALTER INDEX REBUILDを明示的に呼び出すことにより、列ストア圧縮のタイミングを手動で制御できます。

リンク: Niko Neugebauer Columnstore Indexes-パート35

リファレンス: MSDN ms188396

適用方法:グローバルのみ







トレースフラグ:646

目的:クエリオプティマイザーによって削除されたColumnstoreに関する詳細情報をエラーログに直接取得します。

リンク: Niko Neugebauer Columnstore Indexes-パート35







トレースフラグ:652

機能:ページのプリフェッチスキャンを無効にする

参照: KB920093 ]

リファレンス: MSDN ms188396

適用方法:グローバルのみ







トレースフラグ:653

機能:現在の接続の先読みを無効にします

リンク:いいえ







トレースフラグ:661

目的:ゴーストレコードの削除プロセスを無効にします。

参照: KB920093

リファレンス: MSDN ms188396

適用方法:グローバルのみ







トレースフラグ:662

機能:ゴーストが行った作業に関する詳細情報を出力します

次に実行するときのクリーンアップタスク。 TF 3605を使用して、

エラーログ

リンク: http : //blogs.msdn.com/b/sqljourney/archive/2012/07/28/an-in-depth-look-at-ghost-records-in-sql-server.aspx







トレースフラグ:698

目的:SQL 9-ID列を持つテーブルに対するINSERT操作のパフォーマンスは、SQL 8と比較すると遅い場合があります

リンク: https : //support.microsoft.com/en-gb/kb/940545







トレースフラグ:699

目的:SQLデータサーバー全体のトランザクションロギングをオフにします

リンク:いいえ







トレースフラグ:715

目的:非クラスター化インデックスのないヒープへのバルクロード操作のテーブルロックを有効にします。

このトレースフラグを有効にすると、データをテーブルに一括コピーするときに、一括読み込み操作で一括更新(BU)ロックが取得されます。

一括更新(BU)ロックを使用すると、複数のスレッドがデータを同じテーブルに同時に一括読み込みできると同時に、データを一括読み込みしていない他のプロセスがテーブルにアクセスできなくなります。

動作は、ユーザーがバルクロードの実行中にTABLOCKヒントを明示的に指定した場合、または特定のテーブルでバルクロードのsp_tableoptionテーブルロックが有効になっている場合に似ています。

ただし、このトレースフラグが有効になっている場合、この動作はクエリまたはデータベースの変更なしでデフォルトになります。

リファレンス: MSDN ms188396

適用方法:グローバルまたはセッション







トレースフラグ:806

目的:ページの有効性を検証するために、ページ監査機能をオンにします

リンク: http : //technet.microsoft.com/en-au/library/cc917726.aspx







トレースフラグ:809

目的:SQL 8-遅延書き込みアクティビティの量を制限する

リンク:いいえ







トレースフラグ:815

目的:SQL 8/9-ラッチ強制を有効にします。 SQL Server 8(サービ​​スパック4)およびSQL Server 9は、バッファープールキャッシュで見つかったデータページに対してラッチ強制を実行できます。 データベースページのステータスが「クリーン」から「ダーティ」に変化する間、ラッチ強制により仮想メモリ保護状態が変更されます(「ダーティ」はINSERT、UPDATE、またはDELETE操作によって変更されたことを意味します)。 ラッチ強制が設定されている間にデータページを変更しようとすると、例外が発生し、SQL ServerインストールのLOGディレクトリにミニダンプが作成されます。 マイクロソフトのサポートは、このようなミニダンプの内容を調べて、例外の原因を特定できます。 データページを変更するには、最初に接続が変更ラッチを取得する必要があります。 データ変更ラッチが取得されると、ページ保護は読み取り/書き込みに変更されます。 変更ラッチが解放されると、ページ保護は読み取り専用に戻ります。

リンク:いいえ







トレースフラグ:818

目的:リングバッファをオンにして、IO書き込み操作に関する情報を保存します。

IOの問題のトラブルシューティングに使用

リンク: http : //support.microsoft.com/kb/826433







トレースフラグ:828

目的:SQL 8-チェックポイントを有効にすると、回復間隔のターゲットが無視され、安定したI / Oが維持されます。それ以外の場合、チェックポイントにかかる時間の目標として回復間隔の設定が使用されます

リンク: https : //support.microsoft.com/en-gb/kb/906121







トレースフラグ:830

目的:SQL 9-完了までに15秒以上かかるI / O要求が2回発生したように、SQL ServerエラーログでCPUドリフトエラーのレポートを無効にします

リンク: https : //support.microsoft.com/en-us/kb/897284







トレースフラグ:831

機能:バッファプール内の変更されていないページを保護して、メモリ破損をキャッチ

リンク:いいえ







トレースフラグ:834

宛先:バッファープールにMicrosoft Windowsのラージページ割り当てを使用します。

注:SQL Server 2012からSQL Server 2016の列ストアインデックス機能を使用している場合、トレースフラグ834をオンにすることはお勧めしません。

リンク: http : //www.sqlservice.se/sv/start/blogg/nagra-trace-flags-for-sql-server.aspx

リンク: https : //support.microsoft.com/en-us/kb/920093

リンク: https : //support.microsoft.com/en-us/kb/3210239

リファレンス: MSDN ms188396

適用方法:グローバルのみ







トレースフラグ:835

目的:SQL 9/10-64ビットSQL Serverでは、メモリ内のロックページをオフにします

リンク:いいえ







トレースフラグ:836

機能:バッファープールに最大サーバーメモリオプションを使用する

参照: KB920093







トレースフラグ:840

目的:SQL 9-トレースをオンにすると、SQL Serverが起動するときに、より大きなI / Oエクステント読み取りを実行してバッファープールを作成できます。 さらに、より大きなI / Oエクステントの読み取りにより、最初のクエリのコンパイルとSQL Serverの起動時の応答時間が改善されます。

リンク: https : //support.microsoft.com/en-gb/kb/912322







トレースフラグ:842

目的:sys.dm_os_memory_node_access_statsを使用して、ローカルvs. このフラグをオンにした後のNUMA構成での外部メモリ

リンク:いいえ







トレースフラグ:845

機能:Standard Editionでメモリ内のロックページを有効にする

リンク: http : //www.sqlservice.se/sv/start/blogg/sql-server-performance-with-dynamics-axapta.aspx

リンク: https : //support.microsoft.com/en-gb/kb/970070







トレースフラグ:902

目的:累積的な更新プログラムまたはService Packをインストールするときに、データベースアップグレードスクリプトの実行をバイパスします。

スクリプトアップグレードモード中にエラーが発生した場合は、Microsoft SQLカスタマーサービスとサポート(CSS)に連絡して、詳細なガイダンスを入手することをお勧めします。

警告:このトレースフラグは、スクリプトアップグレードモード中に失敗した更新のトラブルシューティングを目的としており、継続的に実行することはサポートされていません

実稼働環境で。 累積的な更新プログラムとサービスパックを完全にインストールするには、データベースアップグレードスクリプトを正常に実行する必要があります。

そうしないと、SQL Serverインスタンスで予期しない問題が発生する可能性があります。

リンク: http : //www.sqlservice.se/sv/start/blogg/sql-server-2012-cu1-upgrade-step--msdb110_upgrade-sql--encountered-error-547.aspx

リンク: https : //support.microsoft.com/en-us/kb/2163980

リファレンス: MSDN ms188396

適用方法:グローバルのみ







トレースフラグ:1106

目的:SQL 9-tempdbに内部オブジェクトを作成するクエリを実行すると、tempdbの使用領域が継続的に増加する

リンク: https : //support.microsoft.com/en-gb/kb/947204







トレースフラグ:1117

目的:ファイルグループ内のファイルが自動拡張のしきい値に達すると、ファイルグループ内のすべてのファイルがgrow.br />

注:SQL Server 2016以降、この動作はALTER DATABASEのAUTOGROW_SINGLE_FILEおよびAUTOGROW_ALL_FILESオプションによって制御され、トレースフラグ1117は影響しません。 詳細については、「ALTER DATABASEファイルとファイルグループオプション(Transact-SQL)」を参照してください。

リンク: http : //www.sqlservice.se/sv/start/blogg/nagra-trace-flags-for-sql-server.aspx

リンク: http : //blogs.technet.com/technet_blog_images/b/sql_server_sizing_ha_and_performance_hints/archive/2012/02/09/sql-server-2008-trace-flag-t-1117.aspx

リファレンス: MSDN ms188396

適用方法:グローバルのみ







トレースフラグ:1118

目的:サーバー上のほとんどの単一ページの割り当てを削除し、SGAMページでの競合を減らします。

新しいオブジェクトが作成されると、デフォルトでは、最初の8ページは異なるエクステント(混合エクステント)から割り当てられます。

その後、さらに多くのページが必要になると、それらは同じエクステント(均一なエクステント)から割り当てられます。

SGAMページは、これらの混合エクステントを追跡するために使用されるため、多数の混合ページの割り当てが発生すると、すぐにボトルネックになる可能性があります。

このトレースフラグは、新しいオブジェクトを作成するときに同じエクステントから8ページすべてを割り当て、SGAMページをスキャンする必要性を最小限に抑えます。

注:SQL Server 2016以降、この動作はALTER DATABASEのSET MIXED_PAGE_ALLOCATIONオプションによって制御され、トレースフラグ1118は影響しません。 詳細については、「ALTER DATABASE SETオプション(Transact-SQL)」を参照してください。

リンク: http : //www.sqlservice.se/sv/start/blogg/nagra-trace-flags-for-sql-server.aspx

リンク: http : //blogs.msdn.com/b/psssql/archive/2008/12/17/sql-server-2005-and-2008-trace-flag-1118-t1118-usage.aspx

リンク: http : //www.sqlskills.com/blogs/paul/misconceptions-around-tf-1118/

リンク: https : //support.microsoft.com/en-us/kb/328551

リファレンス: MSDN ms188396

適用方法:グローバルのみ







トレースフラグ:1119

機能:混合エクステント割り当てのターン(1118と同様?)

リンク: SQL ServerトレースフラグのTECHNETリスト







トレースフラグ:1124

予定:不明。 Dynamics AXを実行している一部のSQL Serverインスタンスで有効になっていることが報告されています。 また、SQL Serverのパブリックビルドでは無効であると噂されています

リンク:いいえ







トレースフラグ:1140

目的:特別な場合にtempdbを拡張するための修正

リンク: http : //support.microsoft.com/kb/2000471







トレースフラグ:1180

目的:SQL 7-テキストまたは画像データに空きページを使用するように割り当てを強制し、ストレージの効率を維持します。 テキスト、ntext、またはイメージの列がまばらにあるためにDBCC SHRINKFILEおよびSHRINKDATABASEコマンドが機能しない場合に役立ちます。

リンク:いいえ







トレースフラグ:1197

機能:SQL 7-SP3の場合にのみ適用され、トレースフラグ1180と同様

リンク:いいえ







トレースフラグ:1200

目的:ロックのすべての要求が行われると、詳細なロック情報を出力します(要求されたロックのプロセスIDとタイプ)

リンク: SQL ServerトレースフラグのTECHNETリスト







トレースフラグ:1202

目的:ブロックされたロックリクエストをsyslocksに挿入する

リンク:いいえ







トレースフラグ:1204

目的:デッドロックに参加しているリソースとロックの種類、および影響を受ける現在のコマンドを返します。

リンク: https : //support.microsoft.com/en-us/kb/832524

リファレンス: MSDN ms188396

適用方法:グローバルのみ







トレースフラグ:1205

目的:デッドロック時に実行されているコマンドに関する詳細情報。 SQL 7 BOLに記載されています。

リンク:いいえ







トレースフラグ:1206

機能:デッドロックパーティが保持している他のロックを表示することにより、フラグ1204を補完するために使用

リンク:いいえ







トレースフラグ:1211

目的:メモリの負荷、またはロックの数に基づいて、ロックのエスカレーションを無効にします。 SQL Serverデータベースエンジンは、行ロックまたはページロックをテーブルロックにエスカレートしません。

このトレースフラグを使用すると、過剰な数のロックが生成される可能性があります。 これにより、データベースエンジンのパフォーマンスが低下したり、メモリ不足のために1204エラー(ロックリソースを割り当てられない)が発生したりする可能性があります。

トレースフラグ1211と1224の両方が設定されている場合、1211は1224より優先されます。

ただし、トレースフラグ1211は、メモリ不足の場合でもすべての場合にエスカレーションを防ぐため、1224を使用することをお勧めします。

これにより、多くのロックが使用されている場合に「ロック外」エラーを回避できます。

リファレンス: MSDN ms188396

適用方法:グローバルまたはセッション







トレースフラグ:1216

目的:SQL 7-ヘルスレポートを無効にします。 (ワーカースレッド)リソースレベルのブロックシナリオを検出したときにモニターをロックします。 ロックを所有するSPIDが現在スケジューラのキューに入れられている場合、割り当てられたすべてのワーカースレッドが作成され、割り当てられたすべてのワーカースレッドは解決できない待機状態にあるため、次のエラーメッセージがSQL Serverエラーログに書き込まれます:エラー1223:プロセスID%d:%dは、リソース%sでロック "%s"を取得できません。リソースのScheduler%dに潜在的なデッドロックが存在するためです。 プロセスID%d:%dは、このリソースでロック "%h"を保持しています。

リンク:いいえ







トレースフラグ:1222

目的:デッドロックに参加しているリソースとロックの種類、および影響を受ける現在のコマンドを、XSDスキーマに準拠していないXML形式で返します。

リファレンス: MSDN ms188396

適用方法:グローバルのみ







トレースフラグ:1224

目的:ロックの数に基づいてロックのエスカレーションを無効にします。 ただし、メモリのプレッシャーにより、ロックのエスカレーションが有効になる可能性があります。

データベースエンジンは、ロックオブジェクトが使用するメモリ量が次の条件のいずれかを超えると、行またはページロックをテーブル(またはパーティション)ロックにエスカレートします。









詳細については、「 サーバー構成オプション(SQL Server)」を参照してください。

トレースフラグ1211と1224の両方が設定されている場合、1211は1224より優先されます。

ただし、トレースフラグ1211は、メモリ不足の場合でもすべての場合にエスカレーションを防ぐため、1224を使用することをお勧めします。

これにより、多くのロックが使用されている場合に「ロック外」エラーを回避できます。

注:テーブルレベルまたはHoBTレベルの粒度へのロックエスカレーションは、ALTER TABLEステートメントのLOCK_ESCALATIONオプションを使用して制御することもできます。

リファレンス: MSDN ms188396

適用方法:グローバルまたはセッション







トレースフラグ:1228

目的:ロックパーティションを有効にします。

デフォルトでは、サーバーに16個以上のCPUがある場合、ロックパーティションが有効になっています。 それ以外の場合、ロックパーティションは無効になります。

トレースフラグ1228は、2つ以上のCPUのロックパーティションを有効にします。 トレースフラグ1229は、ロックパーティションを無効にします。

トレースフラグ1228も設定されている場合、トレースフラグ1229はトレースフラグ1228を上書きします。

ロックパーティショニングは、一部のテーブルのロックレートが非常に高いマルチCPUサーバーで役立ちます。

起動時にのみトレースフラグ1228とトレースフラグ1229をオンにできます。

参照: トレースフラグ1228および1229

: Microsoft SQL Server 2005 TPC-C Trace Flags







: 1229

: Enable lock partitioning.

By default, lock partitioning is enabled when a server has 16 or more CPUs. Otherwise, lock partitioning is disabled.

Trace flag 1228 enables lock partitioning for 2 or more CPUs. Trace flag 1229 disables lock partitioning.

Trace flag 1229 overrides trace flag 1228 if trace flag 1228 is also set.

Lock partitioning is useful on multiple-CPU servers where some tables have very high lock rates.

You can turn on trace flag 1228 and trace flag 1229 only at startup.

: Trace Flag 1228 and 1229

: Microsoft SQL Server 2005 TPC-C Trace Flags







: 1236

: Enables database lock partitioning. Fixes performance problem in scenarios with high lock activity in SQL 2012 and SQL 2014.

: Beginning with SQL Server 2012 SP3 and SQL Server 2014 SP1 this behavior is controlled by the engine and trace flag 1236 has no effect.

: https://support.microsoft.com/en-us/kb/2926217

: MSDN ms188396

: global only







: 1260

: Disabled mini-dump for non-yield condition.

Disables mini-dump generation for "any of the 17883, 17884, 17887, or 17888 errors.

The trace flag can be used in conjunction with trace flag –T1262. For example, you

could enable –T1262 to get 10- and a 60-second interval reporting and also enable – T1260 to avoid getting mini-dumps."

: A Topical Collection of SQL Server Flags v6

: How To Diagnose and Correct Errors 17883, 17884, 17887, and 17888

: MSDN ms188396

: global only







: 1261

: SQL 8 — Disables Health reporting. Lock monitor when detects a (worker thread) resource level blocking scenario. If a SPID that owns a lock is currently queued to the scheduler, because all the assigned worker threads have been created and all the assigned worker threads are in an un-resolvable wait state, the following error message is written to the SQL Server error log: Error 1229: Process ID %d:%d owns resources that are blocking processes on scheduler %d.

:







: 1262

: The default behavior (for 1788* errors) is for SQL to generate a mini-dump on the first

occurrence, but never after. 1262 changes the behavior: “When –T1262 is enabled, a

mini-dump is generated when the non-yielding condition is declared (15 seconds) and

at subsequent 60-second intervals for the same non-yield occurrence. A new nonDiagCorrect17883etc;

yielding occurrence causes dump captures to occur again.”

In SQL 2000 this was a startup-only flag; in 2005+ it can be enabled via TRACEON.

Note that the flag is also covered in Khen2005, p400, but with no new information.

: A Topical Collection of SQL Server Flags v6

: How To Diagnose and Correct Errors 17883, 17884, 17887, and 17888







: 1264

: Collect process names in non-yielding scenario memory dumps

: A Topical Collection of SQL Server Flags v6

: http://support.microsoft.com/kb/2630458/en-us







: 1400

: SQL 9 RTM – Enables creation of database mirroring endpoint, which is required for setting up and using database mirroring

:







: 1439

: Trace database restart and failover messages to SQL Errorlog for mirrored databases

: Trace flags in sql server from trace flag 902 to trace flag 1462







: 1448

: Enables the replication log reader to move forward even if the async secondaries have not acknowledged the reception of a change.

Even with this trace flag enabled the log reader always waits for the sync secondaries. The log reader will not go beyond the min ack of the sync secondaries.

This trace flag applies to the instance of SQL Server, not just an availability group, an availability database, or a log reader instance.

Takes effect immediately without a restart. This trace flag can be activated ahead of time or when an async secondary fails.

: https://support.microsoft.com/en-us/kb/937041

: MSDN ms188396

: global only







: 1449

: When you use SNAC to connect to an instance of a principal server in a database mirroring session: "The connection attempted to fail over to a server that does not have a failover partner".

: https://support.microsoft.com/en-gb/kb/936179







: 1462

: Disables log stream compression for asynchronous availability groups.

This feature is enabled by default on asynchronous availability groups in order to optimize network bandwidth.

: http://sqlcat.com/sqlcat/b/technicalnotes/archive/2007/09/17/database-mirroring-log-compression-in-sql-server-2008-improves-throughput.aspx

: MSDN mt736907

: MSDN ms188396

: global only







: 1504

: Dynamic memory grant expansion can also help with parallel index build plans where the distribution of rows across threads is uneven.

The amount of memory that can be consumed this way is not unlimited, however.

SQL Server checks each time an expansion is needed to see if the request is reasonable given the resources available at that time.

Some insight to this process can be obtained by enabling undocumented trace flag 1504, together with 3604 (for message output to the console)

or 3605 (output to the SQL Server error log). If the index build plan is parallel, only 3605 is effective because parallel workers cannot send trace messages cross-thread to the console.

: Internals of the Seven SQL Server Sorts – Part 1







: 1603

: Use standard disk I/O (ie turn off asynchronous I/O)

:







: 1604

: Once enabled at start up makes SQL Server output information regarding memory allocation requests

:







: 1609

: Turns on the unpacking and checking of RPC information in Open Data Services. Used only when applications depend on the old behavior.

:







: 1610

: Boot the SQL dataserver with TCP_NODELAY enabled

:







: 1611

: If possible, pin shared memory — check errorlog for success/failure

:







: 1613

: Set affinity of the SQL data server engine's onto particular CPUs — usually pins engine 0 to processor 0, engine 1 to processor 1...

:







: 1704

: Prints information when a temporary table is created or dropped

:







: 1717

: MSShipped bit will be set automatically at Create time when creating stored procedures

:







: 1800

: Enables SQL Server optimization when disks of different sector sizes are used for primary and secondary replica log files, in SQL Server AG and Log Shipping environments.

: https://support.microsoft.com/en-us/kb/3009974

: MSDN ms188396

: global only







: 1802

: SQL 9 — After detaching a database that resides on network-attached storage, you cannot reattach the SQL Server database

: https://support.microsoft.com/en-us/kb/922804







: 1806

: Disable Instant File Initialization

: http://technet.microsoft.com/en-au/library/cc917726.aspx







: 1807

: Enable option to have database files on SMB share for SQL Server 2008 and 2008R2

: http://blogs.msdn.com/b/varund/archive/2010/09/02/create-a-sql-server-database-on-a-network-shared-drive.aspx







: 1810

: Prints the file create/open/close timings

:







: 1903

: SQL 8 — When you capture a SQL Profiler trace in a file and then you try to import the trace files into tables by using the fn_trace_gettable function no rows may be returned

: https://support.microsoft.com/en-us/kb/911678







: 2301

: Enable advanced decision support optimizations

: KB920093

: MSDN ms188396

: global and session and query







: 2312

: Enables you to set the query optimizer cardinality estimation model to the SQL Server 2014 through SQL Server 2016 versions,

dependent of the compatibility level of the database.

: KB2801413

: New Features in SQL Server 2016 Service Pack 1

: MSDN ms188396

: global or session or query







: 2328

: SQL 9+ — Makes cardinality estimates upon resulting selectivity. The reasoning for this is that one or more of the constants may be statement parameters, which would change from one execution of the statement to the next.

:







: 2330

: Query performance decreases when sys.dm_db_index_usage_stats has large number of rows

: https://support.microsoft.com/en-us/kb/2003031

: http://www.brentozar.com/archive/2015/11/trace-flag-2330-who-needs-missing-index-requests/







: 2335

: Causes SQL Server to assume a fixed amount of memory is available during query optimization. It does not limit the memory SQL Server grants to execute the query.

The memory configured for SQL Server will still be used by data cache, query execution and other consumers.

: Please ensure that you thoroughly test this option, before rolling it into a production environment.

: https://support.microsoft.com/en-us/kb/2413549

: MSDN ms188396

: global or session or query







: 2340

: Causes SQL Server not to use a sort operation (batch sort) for optimized nested loop joins when generating a plan.

Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag.

: Please ensure that you thoroughly test this option, before rolling it into a production environment.

: https://support.microsoft.com/en-us/kb/2009160

: New Features in SQL Server 2016 Service Pack 1

: MSDN ms188396

: global or session or query







: 2363

: TF Selectivity

: Cardinality Estimation Framework 2014 First Look







: 2371

: Changes the fixed auto update statistics threshold to dynamic auto update statistics threshold.

: Beginning with SQL Server 2016 this behavior is controlled by the engine and trace flag 2371 has no effect.

: http://www.sqlservice.se/sv/start/blogg/sql-server--auto-update-stats-part-2.aspx

: https://support.microsoft.com/en-us/kb/2754171

: http://blogs.msdn.com/b/saponsqlserver/archive/2011/09/07/changes-to-automatic-update-statistics-in-sql-server-traceflag-2371.aspx

: MSDN ms188396

: global only







: 2372

: Displays memory utilization during the optimization process. Memory for Phases.

: More Undocumented Query Optimizer Trace Flags

: Cardinality Estimation Framework 2014 First Look







: 2373

: Displays memory utilization during the optimization process. Memory for Deriving Properties.

: More Undocumented Query Optimizer Trace Flags

: Cardinality Estimation Framework 2014 First Look







: 2388

: Change DBCC SHOW_STATISTICS output to show stats history and lead key type such as known ascending keys

: http://www.benjaminnevarez.com/2013/02/statistics-on-ascending-keys







: 2389

: Enable automatically generated quick statistics for ascending keys (histogram amendment).

If trace flag 2389 is set, and a leading statistics column is marked as ascending, then the histogram used to estimate cardinality will be adjusted at query compile time.

: KB2801413

: http://www.sqlservice.se/sv/start/blogg/sql-server-statistics--traceflags-2389--2390.aspx

: http://blogs.msdn.com/b/ianjo/archive/2006/04/24/582227.aspx

: http://www.sqlmag.com/article/tsql3/making-the-most-of-automatic-statistics-updating--96767

: http://sqlperformance.com/2016/07/sql-statistics/trace-flag-2389-new-cardinality-estimator

: https://www.sswug.org/sswugresearch/community/trace-flag-2389-and-the-new-cardinality-estimator/

: New Features in SQL Server 2016 Service Pack 1

: MSDN ms188396

: global or session or query







: 2390

: Enable automatically generated quick statistics for ascending or unknown keys (histogram amendment).

If trace flag 2390 is set, and a leading statistics column is marked as ascending or unknown, then the histogram used to estimate cardinality will be adjusted at query compile time

: http://www.sqlservice.se/sv/start/blogg/sql-server-statistics--traceflags-2389--2390.aspx

: http://blogs.msdn.com/b/ianjo/archive/2006/04/24/582227.aspx

: KB2801413

: http://www.sqlmag.com/article/tsql3/making-the-most-of-automatic-statistics-updating--96767

: MSDN ms188396

: global or session or query







: 2430

: Fixes performance problem when using large numbers of locks

: https://support.microsoft.com/en-us/kb/2754301







: 2440

: SQL 10 — Parallel query execution strategy on partitioned tables. SQL 9 used single thread per partition parallel query execution strategy. In SQL 10, multiple threads can be allocated to a single partition by turning on this flag.

:







: 2453

: Allow a table variable to trigger recompile when enough number of rows are changed with may allow the query optimizer to choose a more efficient plan.

: Please ensure that you thoroughly test this option, before rolling it into a production environment.

: http://sqlperformance.com/2014/06/t-sql-queries/table-variable-perf-fix

: https://support.microsoft.com/en-us/kb/2952444

: MSDN ms188396

: global or session or query







: 2470

: Fixes performance problem when using AFTER triggers on partitioned tables

: https://support.microsoft.com/en-us/kb/2606883







: 2505

: SQL 7 — Prevents DBCC TRACEON 208, SPID 10 errors from appearing in the error log

: https://support.microsoft.com/en-us/kb/243352







: 2508

: Disables parallel non-clustered index checking for DBCC CHECKTABLE

:







: 2509

: Used with DBCC CHECKTABLE to see the total count of forward records in a table

:







: 2514

: Verbose Merge Replication logging to msmerge_history table for troubleshooting Merger repl performance

: http://sqlblog.com/blogs/argenis_fernandez/archive/2012/05/29/ghost-records-backups-and-database-compression-with-a-pinch-of-security-considerations.aspx







: 2520

: Forces DBCC HELP to return syntax of undocumented DBCC statements. If 2520 is not turned on, DBCC HELP will refuse to give you the syntax stating: "No help available for DBCC statement 'undocumented statement'". dbcc help ('?')

:







: 2521

: SQL 7 SP2 — Facilitates capturing a Sqlservr.exe user-mode crash dump for postmortem analysis

:







: 2528

: Disables parallel checking of objects by DBCC CHECKDB, DBCC CHECKFILEGROUP, and DBCC CHECKTABLE.

By default, the degree of parallelism is automatically determined by the query processor.

The maximum degree of parallelism is configured just like that of parallel queries.

For more information, see Configure the max degree of parallelism Server Configuration Option .

Parallel DBCC should typically be left enabled.

For DBCC CHECKDB, the query processor reevaluates and automatically adjusts parallelism with each table or batch of tables checked.

Sometimes, checking may start when the server is almost idle.

An administrator who knows that the load will increase before checking is complete may want to manually decrease or disable parallelism.

Disabling parallel checking of DBCC can cause DBCC to take much longer to complete and if DBCC is run with the TABLOCK feature enabled and parallelism set off, tables may be locked for longer periods of time.

: MSDN ms188396

: global or session







: 2529

: Displays memory usage for DBCC commands when used with TF 3604

:







: 2536

: Allows you to see inactive records in transaction log using fn_dblog.

Similar to trace flag 2537 for older version than SQL Server 2008.

: http://www.sqlsoldier.com/wp/sqlserver/day19of31daysofdisasterrecoveryhowmuchlogcanabackuplog







: 2537

: Allows you to see inactive records in transaction log using fn_dblog

: http://www.sqlsoldier.com/wp/sqlserver/day19of31daysofdisasterrecoveryhowmuchlogcanabackuplog







: 2540

: Unknown, but related to controlling the contents of a memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2541

: Unknown, but related to controlling the contents of a memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2542

: Unknown, but related to controlling the contents of a memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2543

: Unknown, but related to controlling the contents of a memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2544

: Produces a full memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2545

: Unknown, but related to controlling the contents of a

memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2546

: Dumps all threads for SQL Server in the dump file

: http://support.microsoft.com/kb/917825/en-us







: 2547

: Unknown, but related to controlling the contents of a

memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2548

: Shrink will run faster with this trace flag if there are LOB pages that need conversion and/or compaction, because that actions will be skipped.

: http://blogs.msdn.com/b/psssql/archive/2008/03/28/how-it-works-sql-server-2005-dbcc-shrink-may-take-longer-than-sql-server-2000.aspx







Thanks to: Andrzej Kukula







: 2549

: Runs the DBCC CHECKDB command assuming each database file is on a unique disk drive.

DBCC CHECKDB command builds an internal list of pages to read per unique disk drive across all database files.

This logic determines unique disk drives based on the drive letter of the physical file name of each file.

: Do not use this trace flag unless you know that each file is based on a unique physical disk.

Although this trace flag improve the performance of the DBCC CHECKDB commands which target usage of the PHYSICAL_ONLY option, some users may not see any improvement in performance.

While this trace flag improves disk I/O resources usage, the underlying performance of disk resources may limit the overall performance of the DBCC CHECKDB command.


: http://www.sqlservice.se/sv/start/blogg/faster-dbcc-checkdb-by-using-trace-flag-2562-and-2549.aspx

: http://blogs.msdn.com/b/saponsqlserver/archive/2011/12/22/faster-dbcc-checkdb-released-in-sql-2008-r2-sp1-traceflag-2562-amp-2549.aspx

: http://support.microsoft.com/kb/2634571

: https://support.microsoft.com/en-us/kb/2732669

: MSDN ms188396

: global only







: 2550

: Unknown, but related to controlling the contents of a

memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2551

: Produces a filtered memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2552

: Unknown, but related to controlling the contents of a

memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2553

: Unknown, but related to controlling the contents of a

memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2554

: Unknown, but related to controlling the contents of a

memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2555

: Unknown, but related to controlling the contents of a

memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2556

: Unknown, but related to controlling the contents of a

memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2557

: Unknown, but related to controlling the contents of a

memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2558

: Unknown, but related to controlling the contents of a

memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2559

: Unknown, but related to controlling the contents of a

memory dump

: http://support.microsoft.com/kb/917825/en-us







: 2562

: Runs the DBCC CHECKDB command in a single "batch" regardless of the number of indexes in the database.

By default, the DBCC CHECKDB command tries to minimize tempdb resources by limiting the number of indexes or "facts" that it generates by using a "batches" concept.

This trace flag forces all processing into one batch.

One effect of using this trace flag is that the space requirements for tempdb may increase.

Tempdb may grow to as much as 5% or more of the user database that is being processed by the DBCC CHECKDB command.

: Although this trace flag improve the performance of the DBCC CHECKDB commands which target usage of the PHYSICAL_ONLY option, some users may not see any improvement in performance.

While this trace flag improves disk I/O resources usage, the underlying performance of disk resources may limit the overall performance of the DBCC CHECKDB command.


: http://www.sqlservice.se/sv/start/blogg/faster-dbcc-checkdb-by-using-trace-flag-2562-and-2549.aspx

: http://blogs.msdn.com/b/saponsqlserver/archive/2011/12/22/faster-dbcc-checkdb-released-in-sql-2008-r2-sp1-traceflag-2562-amp-2549.aspx

: http://support.microsoft.com/kb/2634571

: http://support.microsoft.com/kb/2732669/en-us

: MSDN ms188396

: global only







: 2566

: Runs the DBCC CHECKDB command without data purity check unless DATA_PURITY option is specified.

: Column-value integrity checks are enabled by default and do not require the DATA_PURITY option.

For databases upgraded from earlier versions of SQL Server, column-value checks are not enabled by default until DBCC CHECKDB WITH DATA_PURITY has been run error free on the database at least once.

After this, DBCC CHECKDB checks column-value integrity by default.


: https://support.microsoft.com/en-us/kb/945770

: MSDN ms188396

: global only







: 2588

: Get more information about undocumented DBCC commands

: http://www.sqlservice.se/sv/start/blogg/trace-flag--undocumented-commands.aspx







: 2701

: 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

:







: 2861

: Keep zero cost plans in cache. Tip: Avoid Using Trace Flag 2861 to Cache Zero-Cost Query Plan

: http://support.microsoft.com/kb/325607







: 3001

: Stops sending backup entries into MSDB

:







: 3004

: Returns more info about Instant File Initialization. Shows information about backups and file creations use with 3605 to direct to error log.

: https://blogs.msdn.microsoft.com/psssql/2008/01/23/how-it-works-what-is-restorebackup-doing/

: http://victorisakov.files.wordpress.com/2011/10/sql_pass_summit_2011-important_trace_flags_that_every_dba_should_know-victor_isakov.pdf







: 3014

: Returns more info about backups to the errorlog

: http://victorisakov.files.wordpress.com/2011/10/sql_pass_summit_2011-important_trace_flags_that_every_dba_should_know-victor_isakov.pdf







: 3023

: Enables CHECKSUM option as default for BACKUP command

: Beginning with SQL Server 2014 this behavior is controlled by setting the backup checksum default configuration option.

For more information, see Server Configuration Options (SQL Server)
.

: https://support.microsoft.com/en-us/kb/2656988

: MSDN ms188396

: global and session







: 3031

: SQL 9 — Will turn the NO_LOG and TRUNCATE_ONLY options into checkpoints in all recovery modes

:







: 3042

: Bypasses the default backup compression pre-allocation algorithm to allow the backup file to grow only as needed to reach its final size. This trace flag is useful if you need to save on space by allocating only the actual size required for the compressed backup. Using this trace flag might cause a slight performance penalty (a possible increase in the duration of the backup operation).

For more information about the pre-allocation algorithm, see Backup Compression (SQL Server) .

: MSDN ms188396

: global only







: 3051

: Enables SQL Server Backup to URL logging to a specific error log file.

: MSDN ms188396

: https://msdn.microsoft.com/en-us/library/jj919149.aspx

: global only







: 3101

: Fix performance problems when restoring database with CDC

: http://support.microsoft.com/kb/2567366/







: 3104

: Causes SQL Server to bypass checking for free space

:







: 3106

: Required to move sys databases

:







: 3111

: Cause LogMgr::ValidateBackedupBlock to be skipped during backup and restore operation

:







: 3117

: QL 9 — SQL Server 2005 tries to restore the log files and the data files in a single step which some third-party snapshot backup utilities do not support. Turing on 3117 does things the SQL 8 way multiple-step restore process.

: https://support.microsoft.com/en-us/kb/915385







: 3205

: Disable HW compression for backup to tape drives

: MSDN ms188396

: global







: 3213

: Output buffer info for backups to ERRORLOG

: http://sqlcat.com/sqlcat/b/technicalnotes/archive/2008/04/21/tuning-the-performance-of-backup-compression-in-sql-server-2008.aspx







: 3222

: Disables the read ahead that is used by the recovery operation during roll forward operations

: TECHNET List Of SQL Server Trace Flags







: 3226

: By default, every successful backup operation adds an entry in the SQL Server error log and in the system event log.

If you create very frequent log backups, these success messages accumulate quickly, resulting in huge error logs in which finding other messages is problematic.

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.

: MSDN ms188396

: global only







Thanks to: @lwiederstein ( https://twitter.com/lwiederstein )







: 3422

: Log record auditing

: http://technet.microsoft.com/en-au/library/cc917726.aspx







: 3231

: SQL 8/9 — Will turn the NO_LOG and TRUNCATE_ONLY options into no-ops in FULL/BULK_LOGGED recovery mode, and will clear the log in SIMPLE recovery mode. When set, BACKUP LOG with TRUNCATE_ONLY and BACKUP LOG with NO_LOG do not allow a log backup to run if the database's recovery model is FULL or BULK_LOGGED.

:







: 3282

: SQL 6.5 — Used after backup restoration fails

: https://support.microsoft.com/en-us/kb/215458







: 3400

: Prints the recovery timings

:







: 3422

: Cause auditing of transaction log records as they're read (during transaction rollback or log recovery).

This is useful because there is no equivalent to page checksums for transaction log records and so no way to detect whether log records are being corrupted e careful with these trace flags — I don't recommend using them unless you are experiencing corruptions that you can't diagnose. Turning them on will cause a big CPU hit because of the extra auditing that's happening.

: https://support.microsoft.com/en-us/kb/215458







: 3502

: Writes info about checkpoints to teh errorlog

: http://victorisakov.files.wordpress.com/2011/10/sql_pass_summit_2011-important_trace_flags_that_every_dba_should_know-victor_isakov.pdf







: 3503

: Indicates whether the checkpoint at the end of automatic recovery was skipped for a database (this applies only to read-only databases)

: http://www.sql-server-performance.com/2002/traceflags/







: 3504

: For internal testing. Will raise a bogus log-out-of-space condition from checkpoint

:







: 3505

: Disables automatic checkpointing

: http://support.microsoft.com/kb/815436







: 3601

: Stack trace when error raised. Also see 3603.

:







: 3602

: Records all error and warning messages sent to the client

:







: 3603

: SQL Server fails to install on tricore, Bypass SMT check is enabled, flags are added via registry. Also see 3601.

:







: 3604

: Redirect DBCC command output to query window

: http://blogs.msdn.com/b/askjay/archive/2011/01/21/why-do-we-need-trace-flag-3604-for-dbcc-statements.aspx

: Internals of the Seven SQL Server Sorts – Part 1

: http://www.sqlservice.se/sv/start/blogg/querytraceon.aspx







: 3605

: Directs the output of some Trace Flags to the Errorlog

: Internals of the Seven SQL Server Sorts – Part 1

: http://sqlcat.com/sqlcat/b/technicalnotes/archive/2008/04/21/tuning-the-performance-of-backup-compression-in-sql-server-2008.aspx







: 3607

: Skip recovery on startup

: http://sqlkbs.blogspot.se/2008/01/trace-flag.html







: 3608

: Prevents SQL Server from automatically starting and recovering any database except the master database.

If activities that require tempdb are initiated, then model is recovered and tempdb is created. Other databases will be started and recovered when accessed.

Some features, such as snapshot isolation and read committed snapshot, might not work.

Use for Move System Databases and Move User Databases.

: Do not use during normal operation.

: MSDN ms188396

: global only







: 3609

: Do not create tempdb at startup

: http://basitaalishan.com/2012/02/20/essential-trace-flags-for-recovery-debugging/







: 3610

: SQL 9 — Divide by zero to result in NULL instead of error

:







: 3625

: Limits the amount of information returned to users who are not members of the sysadmin fixed server role, by masking the parameters of some error messages using ' ** '.

This can help prevent disclosure of sensitive information.

: MSDN ms188396

: global only







: 3626

: Turns on tracking of the CPU data for the sysprocesses table.

:







: 3635

: Print diagnostic information. Trace Flag 3635 Diagnostics are written to the console that started it.

There are not written to the errorlog, even if 3605 is turned on.

:







: 3640

: Eliminates sending DONE_IN_PROC messages to client for each statement in stored procedure. This is similar to the session setting of SET NOCOUNT ON, but when set as a trace flag, every client session is handled this way.

:







: 3654

Function:Allocations to stack

:







: 3656

: Enables resolve of all call stacks in extended events

: http://sqlcat.com/sqlcat/b/msdnmirror/archive/2010/05/11/resolving-dtc-related-waits-and-tuning-scalability-of-dtc.aspx







: 3659

: Enables logging all errors to error log during server startup

: http://spaghettidba.com/2011/05/20/trace-flag-3659/







: 3688

: Removes messages to error log about traces started and stopped

: http://support.microsoft.com/kb/922578/en-us







: 3689

: Logs extended errors to errorlog when network disconnect occurs, turned off by default. Will dump out the socket error code this can sometimes give you a clue as to the root cause.

: http://support.microsoft.com/kb/922578/en-us







: 3801

: Prohibits use of USE DB statement

:







: 3913

: SQL 7/8 — SQL Server does not update the rowcnt column of the sysindexes system table until the transaction is committed. When turned on the optimizer gets row count information from in-memory metadata that is saved to sysindexes system table when the transaction commits.

:







: 3923

: Let SQL Server throw an exception to the application when the 3303 warning message is raised

: https://support.microsoft.com/kb/3014867/en-us







: 4001

: Very verbose logging of each login attempt to the error log. Includes tons of information

:







: 4010

: Allows only shared memory connections to the SQL Server. Meaning, you will only be able to connect from the server machine itself. Client connections over TCP/IP or named pipes will not happen.

:







: 4013

: Log each new connection the error log

: http://sqlkbs.blogspot.se/2008/01/trace-flag.html







: 4020

: Boot without recover

:







: 4022

: Bypass Startup procedures

: http://www.sqlservice.se/sv/start/blogg/sql-server-2012-cu1-upgrade-step--msdb110_upgrade-sql--encountered-error-547.aspx







: 4029

: Logs extended errors to errorlog when network disconnect occurs, turned off by default. Will dump out the socket error code this can sometimes give you a clue as to the root cause.

:







: 4030

: Prints both a byte and ASCII representation of the receive buffer. Used when you want to see what queries a client is sending to SQL Server. You can use this trace flag if you experience a protection violation and want to determine which statement caused it. Typically, you can set this flag globally or use SQL Server Enterprise Manager. You can also use DBCC INPUTBUFFER.

:







: 4031

: Prints both a byte and ASCII representation of the send buffers (what SQL Server sends back to the client). You can also use DBCC OUTPUTBUFFER.

:







: 4032

: Traces the SQL commands coming in from the client. When enabled with 3605 it will direct those all to the error log.

:







: 4044

: 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.

:







: 4052

: SQL 9+ Prints TDS packets sent to the client (output) to console. Startup only.

:







: 4055

: SQL 9+ Prints TDS packets received from the client to console. Startup only.

:







: 4102

: SQL 9 — Query performance is slow if the execution plan of the query contains semi join operators Typically, semi join operators are generated when the query contains the IN keyword or the EXISTS keyword. Enable flag 4102 and 4118 to overcome this.

: https://support.microsoft.com/en-us/kb/940128







: 4104

: SQL 9 — Overestimating cardinality of JOIN operator. When additional join predicates are involved, this problem may increase the estimated cost of the JOIN operator to the point where the query optimizer chooses a different join order. When the query optimizer chooses a different join order, SQL 9 system performance may be slow.

: https://support.microsoft.com/en-us/kb/920346







: 4107

: SQL 9 — When you run a query that references a partitioned table, query performance may decrease

: https://support.microsoft.com/en-us/kb/923849







: 4116

: SQL 9 — Query runs slowly when using joins between a local and a remote table

: https://support.microsoft.com/en-us/kb/950880







: 4121

: SQL 9 — Query that involves an outer join operation runs very slowly. However, if you use the FORCE ORDER query hint in the query, the query runs much faster. Additionally, the execution plan of the query contains the following text in the Warnings column: NO JOIN PREDICATE.

:







: 4123

: Query that has many outer joins takes a long time to compile in SQL Server 2005

: https://support.microsoft.com/en-us/kb/943060







: 4125

: SQL 9 — Query may take more time to finish if using an inner join to join a derived table that uses DISTINCT keyword

: https://support.microsoft.com/en-us/kb/949854







: 4127

: SQL 9 — Compilation time of some queries is very long in an x64-based version.

Basically its more than execution time because more memory allocations are necessary in the compilation process.

: https://support.microsoft.com/en-us/kb/953569







: 4130

: XML performance fix

: http://support.microsoft.com/kb/957205







: 4134

: Bugfix for error: parallel query returning different results every time

: http://support.microsoft.com/kb/2546901

: http://sql-sasquatch.blogspot.se/2014/04/whaddayaknow-bout-sqlserver-trace-flag.html







: 4135

: Bugfix for error inserting to temp table

: http://support.microsoft.com/kb/960770







: 4136

: Disables parameter sniffing unless OPTION(RECOMPILE), WITH RECOMPILE or OPTIMIZE FOR value is used.

To accomplish this at the database level, see ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL).

To accomplish this at the query level, add the OPTIMIZE FOR UNKNOWN query hint.

Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag.

: Please ensure that you thoroughly test this option, before rolling it into a production environment.

: http://blogs.msdn.com/b/axinthefield/archive/2010/11/04/sql-server-trace-flags-for-dynamics-ax.aspx

: http://www.sqlservice.se/sv/start/blogg/nagra-trace-flags-for-sql-server.aspx

: New Features in SQL Server 2016 Service Pack 1

: MSDN ms188396

: global or session or query







: 4137

: Causes SQL Server to generate a plan using minimum selectivity when estimating AND predicates for filters to account for correlation, under the query optimizer cardinality estimation model of SQL Server 2012 and earlier versions

Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag.

: Please ensure that you thoroughly test this option, before rolling it into a production environment.

: http://support.microsoft.com/kb/2658214

: New Features in SQL Server 2016 Service Pack 1

: MSDN ms188396

: global or session or query







: 4138

: Causes SQL Server to generate a plan that does not use row goal adjustments with queries that contain TOP, OPTION (FAST N), IN, or EXISTS keywords

Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag.

: Please ensure that you thoroughly test this option, before rolling it into a production environment.

: http://support.microsoft.com/kb/2667211

: New Features in SQL Server 2016 Service Pack 1

: MSDN ms188396

: global or session or query







: 4139

: Enable automatically generated quick statistics (histogram amendment) regardless of key column status.

If trace flag 4139 is set, regardless of the leading statistics column status (ascending, descending, or stationary), the histogram used to estimate cardinality will be adjusted at query compile time

Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag.

: Please ensure that you thoroughly test this option, before rolling it into a production environment.

Link: https://support.microsoft.com/en-us/kb/2952101

: MSDN ms188396

: global or session or query







: 4199

: Controls query optimizer changes released in SQL Server Cumulative Updates and Service Packs.

Starting with SQL Server 2016, trace flag 4199 changes that are made to previous releases of SQL Server will become enabled under database compatibility level 130 without trace flag 4199 enabled

To enable this at the database level, see ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL) .

: Starting with SQL Server 2016, customers are advised to remove trace flag 4199 after they migrate their databases to the latest compatibility level

because trace flag 4199 will be reused for future query optimizer changes that may not apply to your application and could cause unexpected plan performance changes on a production system.

This means that different trace flag 4199 changes are enabled for each compatibility level that is supported in a given product release.


: http://www.sqlservice.se/sv/start/blogg/one-trace-flag-to-rule-them-all.aspx

: https://msdn.microsoft.com/en-us/library/bb510411.aspx#TraceFlag

: https://support.microsoft.com/en-us/kb/974006

: New Features in SQL Server 2016 Service Pack 1

: MSDN ms188396

: global or session







: 4606

: Over comes SA password by startup. Disables password policy check during server startup.

: https://support.microsoft.com/en-us/kb/936892







: 4610

: When you use trace flag 4618 together with trace flag 4610, the number of entries in the cache store is limited to 8,192. When the limit is reached, SQL 2005 removes some entries from the TokenAndPermUserStore cache store.

: https://support.microsoft.com/en-us/kb/959823

: MSDN ms188396

: global only







: 4612

: Disable the ring buffer logging — no new entries will be made into the ring buffer

:







: 4613

: Generate a minidump file whenever an entry is logged into the ring buffer

:







: 4614

: Enables SQL Server authenticated logins that use Windows domain password policy enforcement to log on to the instance even though the SQL Server service account is locked out or disabled on the Windows domain controller.

: https://support.microsoft.com/en-us/kb/925744







: 4616

: Makes server-level metadata visible to application roles.

In SQL Server, an application role cannot access metadata outside its own database because application roles are not associated with a server-level principal.

This is a change of behavior from earlier versions of SQL Server.

Setting this global flag disables the new restrictions, and allows for application roles to access server-level metadata.

: MSDN ms188396

: global only







: 4618

: Limits number of entries per user cache store to 1024.

It may incur a small CPU overhead as when removing old cache entries when new entries are inserted.

It performs this action to limit the size of the cache store growth. However, the CPU overhead is spread over time.

When used together with trace flag 4610 increases the number of entries in the TokenAndPermUserStore cache store to 8192

: MSDN ms188396

: https://support.microsoft.com/en-us/kb/933564

: global only







: 4621

: SQL 9 – After 4610 & 4618 you can still customize the quota for TokenAndPermUserStore cache store that is based on the current workload

: https://support.microsoft.com/en-us/kb/959823







: 5101

: Forces all I/O requests to go through engine 0.

This removes the contention between processors but could create a bottleneck if engine 0 becomes busy with non-I/O tasks.

:







: 5102

: Prevents engine 0 from running any non-affinitied tasks.

:







: 5302

: Alters default behavior of select…INTO (and other processes) that lock system tables for the duration of the transaction.

This trace flag disables such locking during an implicit transaction.

:







: 6498

: Enables more than one large query compilation to gain access to the big gateway when there is sufficient memory available.

It is based on the 80 percentage of SQL Server Target Memory, and it allows for one large query compilation per 25 gigabytes (GB) of memory.

: Beginning with SQL Server 2014 SP2 and SQL Server 2016 this behavior is controlled by the engine and trace flag 6498 has no effect.

: https://support.microsoft.com/en-us/kb/3024815

: MSDN ms188396

: http://blogs.msdn.com/b/sql_server_team/archive/2015/10/09/query-compile-big-gateway-policy-changes-in-sql-server.aspx

: global only







: 6527

: Disables generation of a memory dump on the first occurrence of an out-of-memory exception in CLR integration.

By default, SQL Server generates a small memory dump on the first occurrence of an out-of-memory exception in the CLR.

The behaviour of the trace flag is as follows: If this is used as a startup trace flag, a memory dump is never generated.

However, a memory dump may be generated if other trace flags are used.

If this trace flag is enabled on a running server, a memory dump will not be automatically generated from that point on.

However, if a memory dump has already been generated due to an out-of-memory exception in the CLR, this trace flag will have no effect.

: MSDN ms188396

: global







: 6532

: Enables performance improvement of query operations with spatial data types in SQL Server 2012 and SQL Server 2014.

The performance gain will vary, depending on the configuration, the types of queries, and the objects.

: KB3107399

: MSDN ms188396

: global and session







: 6533

: Enables performance improvement of query operations with spatial data types in SQL Server 2012 and SQL Server 2014.

The performance gain will vary, depending on the configuration, the types of queries, and the objects.

: KB3107399

: MSDN ms188396

: global and session







: 6534

: Enables performance improvement of query operations with spatial data types in SQL Server 2012, SQL Server 2014 and SQL Server 2016.

The performance gain will vary, depending on the configuration, the types of queries, and the objects.

: https://support.microsoft.com/en-us/kb/3054180

: KB3107399

: https://blogs.msdn.microsoft.com/bobsql/2016/06/03/sql-2016-it-just-runs-faster-native-spatial-implementations/

: MSDN ms188396

: global and session







: 7103

: Disable table lock promotion for text columns

: https://support.microsoft.com/en-us/kb/230044







: 7300

: Outputs extra info about linked server errors

: http://support.microsoft.com/kb/314530







: 7314

: Forces NUMBER values with unknown precision/scale to be treated as double values with OLE DB provider

: MSDN ms188396

: https://support.microsoft.com/en-us/kb/3051993

: global and session







: 7352

: Show the optimizer output and the post-optimization rewrite in action

: Internals of the Seven SQL Server Sorts – Part 1







: 7412

: Enables the lightweight query execution statistics profiling infrastructure

: MSDN ms188396

: https://support.microsoft.com/en-us/kb/3170113

: global only







: 7470

: Fix for sort operator spills to tempdb in SQL Server 2012 or SQL Server 2014 when estimated number of rows and row size are correct

: https://support.microsoft.com/en-us/kb/3088480







: 7471

: Running multiple UPDATE STATISTICS for different statistics on a single table concurrently

: https://support.microsoft.com/en-us/kb/3156157

: http://sqlperformance.com/2016/05/sql-performance/parallel-rebuilds







: 7501

: Dynamic cursors are used by default on forward-only cursors.

Dynamic cursors are faster than in earlier versions and no longer require unique indexes.

This flag disables the dynamic cursor enhancements and reverts to version 6.0 behavior.

: https://support.microsoft.com/en-us/kb/152032







: 7502

: Disable cursor plan caching for extended stored procedures

: http://basitaalishan.com/2012/02/20/essential-trace-flags-for-recovery-debugging/







: 7505

: Enables version 6.x handling of return codes when calling dbcursorfetchex and the resulting cursor position follows the end of the cursor result set

:







: 7525

: SQL 8 — Reverts to ver 7 behavior of closing nonstatic cursors regardless of the SET CURSOR_CLOSE_ON_COMMIT state

:







: 7601

: Helps in gathering more information in full text search by turning on full text tracing which gathers information on indexing process using the error log. Also 7603, 7604, 7605 trace flags.

:







: 7608

: Performance fix for slow full text population with a composite clustered index

: https://support.microsoft.com/en-us/kb/938672







: 7613

: SQL 9 — Search results are missing when performing a full-text search operation on Win SharePoint Services 2.0 site after upgrading

: https://support.microsoft.com/en-us/kb/927643







: 7614

: SQL 9 — Full-text index population for the indexed view is very slow

: https://support.microsoft.com/en-us/kb/928537







: 7646

: SQL 10 — Avoids blocking when using full text indexing. An issue we experienced that full text can be slow when there is a high number of updates to the index and is caused by blocking on the docidfilter internal table.

:







: 7806

: SQL 9 — Enables a dedicated administrator connection on SQL Express, DAC resources are not reserved by default

: MSDN ms188396

: https://msdn.microsoft.com/en-us/library/ms189595.aspx

: global only







: 7826

: Disable Connectivity ring buffer

: http://blogs.msdn.com/b/sql_protocols/archive/2008/05/20/connectivity-troubleshooting-in-sql-server-2008-with-the-connectivity-ring-buffer.aspx







: 7827

: Record connection closure info in ring buffer

: http://blogs.msdn.com/b/sql_protocols/archive/2008/05/20/connectivity-troubleshooting-in-sql-server-2008-with-the-connectivity-ring-buffer.aspx

: https://connect.microsoft.com/SQLServer/feedback/details/518158/-packet-error-a-fatal-error-occurred-while-reading-the-input-stream-from-the-network







: 8002

: Changes CPU Affinity behaviour

: http://support.microsoft.com/kb/818769







: 8004

: SQL server to create a mini-dump once you enable 2551 and a out of memory condition is hit

:







: 8010

: Fixes problem that SQL Server services can not be stopped

: http://support.microsoft.com/kb/2633271/en-us







: 8011

: Disable the ring buffer for Resource Monitor

: KB920093

: MSDN ms188396

: global and session







: 8012

: Disable the ring buffer for schedulers

: KB920093

: MSDN ms188396

: global only







: 8015

: Disable auto-detection and NUMA setup

: https://support.microsoft.com/en-us/kb/948450

: MSDN ms188396

: http://sql-sasquatch.blogspot.se/2013/04/startup-trace-flags-i-love.html

: global only







Thanks to: @sql_handle ( https://twitter.com/sql_handle )







: 8017

: Upgrade version conflict

: http://social.msdn.microsoft.com/Forums/eu/sqlexpress/thread/dd6fdc16-9d8d-4186-9549-85ba4c322d10

: http://connect.microsoft.com/SQLServer/feedback/details/407692/indicateur-de-trace-8017-reported-while-upgrading-from-ssee2005-to-ssee2008







: 8018

: Disable the exception ring buffer

: KB920093

: MSDN ms188396

: global only







: 8019

: Disable stack collection for the exception ring buffer

: KB920093

: MSDN ms188396

: global only







: 8020

: Disable working set monitoring

: KB920093

: MSDN ms188396

: global only







: 8021

: On some lower end hardware we used to get reported that each CPU has its own NUMA node.

This was usually incorrect and when we detected only a single CPU per NODE we would assume NO NUMA.

Trace flag 8021 disables this override.

: https://blogs.msdn.microsoft.com/psssql/2011/11/11/sql-server-clarifying-the-numa-configuration-information/







: 8024

: When this TF is on, it affects the mini-dump generation logic for the 1788* errors:

"To capture a mini-dump, one of the following checks must also be met.







  1. The non-yielding workers CPU utilization must be > 40 percent.
  2. The SQL Server process is not starved for overall CPU resource utilization.

    Additional check #1 is targeted at runaway CPU users. Additional check #2 is targeted

    at workers with lower utilizations that are probably stuck in an API call or similar activity."

    : [How To Diagnose and Correct Errors 17883, 17884, 17887, and 17888]


: 8026

: SQL Server will clear a dump trigger after generating the dump once

: http://support.microsoft.com/kb/917825/en-us







: 8030

: Fix for performance bug

: http://support.microsoft.com/kb/917035

: http://www.sqlservice.se/sv/start/blogg/sql-server-2005-slowing-down-after-a-while.aspx







: 8032

: Alters cache limit settings

: Trace flag 8032 can cause poor performance if large caches make less memory available for other memory consumers, such as the buffer pool.

: MSDN ms188396

: global only







: 8033

: Alters cache limit settings

: SQL 9 — Disable the reporting of CPU Drift errors in the SQL Server error log like time stamp counter of CPU on scheduler id 1 is not synchronized with other CPUs.

:







: 8038

: Will drastically reduce the number of context switches when running SQL 2005 or 2008

: KB972767

: http://forum.proxmox.com/threads/15844-Win7-x64-guest-with-SQLServer-2012-High-CPU-usage

: TECHNET List Of SQL Server Trace Flags







: 8040

: Disables Resource Governor

: http://www.sqlservergeeks.com/blogs/AmitBansal/sql-server-bi/64/sql-server-disabling-resource-governor-permanently-somewhat







: 8048

: Converts NUMA partitioned memory objects into CPU partitioned

: http://sql-sasquatch.blogspot.se/2013/04/startup-trace-flags-i-love.html

: https://support.microsoft.com/en-us/kb/2809338

: http://blogs.msdn.com/b/psssql/archive/2012/12/20/how-it-works-cmemthread-and-debugging-them.aspx

: MSDN ms188396

: http://blogs.msdn.com/b/psssql/archive/2011/09/01/sql-server-2008-2008-r2-on-newer-machines-with-more-than-8-cpus-presented-per-numa-node-may-need-trace-flag-8048.aspx

: Beginning with SQL Server 2014 SP2 and SQL Server 2016 this behavior is controlled by the engine and trace flag 8048 has no effect.

: global only







Thanks to: @sql_handle ( https://twitter.com/sql_handle )

Related to: 8015, 9024







: 8049

: SQL 9+ Startup only – Allows use of 1ms times even when patched. Check 8038 for details.

: KB972767







: 8050

: Causes "optional" wait types (see the CSS article) to be excluded when querying sys.dm_os_wait_stats

: https://blogs.msdn.microsoft.com/psssql/2009/11/02/the-sql-server-wait-type-repository/







: 8079

: Allows SQL Server 2014 SP2 to interrogate the hardware layout and automatically configure Soft-NUMA on systems reporting 8 or more CPUs per NUMA node.

The automatic Soft-NUMA behavior is Hyperthread (HT/logical processor) aware.

The partitioning and creation of additional nodes scales background processing by increasing the number of listeners, scaling and network and encryption capabilities.

: This trace flag applies to SQL Server 2014 SP2. Beginning with SQL Server 2016 this behavior is controlled by the engine and trace flag 8048 has no effect.

: KB972767

: MSDN ms188396

: global only







: 8202

: Used to replicate UPDATE as DELETE/INSERT pair at the publisher. ie

UPDATE commands at the publisher can be run as an "on-page DELETE/INSERT" or a "full DELETE/INSERT".

If the UPDATE command is run as an "on-page DELETE/INSERT," the Logreader send UDPATE command to the subscriber,

If the UPDATE command is run as a "full DELETE/INSERT," the Logreader send UPDATE as DELETE/INSERT Pair.

If you turn on trace flag 8202, then UPDATE commands at the publisher will be always send to the subscriber as DELETE/INSERT pair.

:







: 8203

: Display statement and transaction locks on a deadlock error

:







: 8206

: SQL 8 — Supports stored procedure execution with a user specified owner name for SQL Server subscribers or without owner qualification for heterogeneous subscribers

:







: 8207

: Enables singleton updates for Transactional Replication. Updates to subscribers can be replicated as a DELETE and INSERT pair.

This might not meet business rules, such as firing an UPDATE trigger. With trace flag 8207 an update to a unique column that affects only one row (a singleton update) is replicated as an UPDATE and not as a DELETE or INSERT pair.

If the update affects a column on which has a unique constraint or if the update affects multiple rows, the update is still replicated as a DELETE or INSERT pair.

: https://blogs.msdn.microsoft.com/psssql/2009/11/02/the-sql-server-wait-type-repository/

: MSDN ms188396

: https://support.microsoft.com/en-us/kb/302341

: global only







: 8209

: Output extra information to error log regarding replication of schema changes in SQL Server Replication

: http://support.microsoft.com/kb/916706/en-us







: 8295

: Creates a secondary index on the identifying columns on the change tracking side table at enable time

Link: https://social.msdn.microsoft.com/forums/sqlserver/en-US/00250311-7991-47b0-b788-7fae2e102254/trace-flag-8295

Thanks to: Wilfred van Dijk







: 8446

: Databases in SQL 8 do not have a Service Broker ID. If you restore these databases on SQL 9 by using the WITH NORECOVERY option, these databases will not be upgraded causing mirroring & log-shipping configurations to fail.

: https://support.microsoft.com/en-us/kb/959008







: 8501

: Writes detailed information about Ms-DTC context & state changes to the log

:







: 8599

: Allows you to use a save-point within a distributed transaction

:







: 8602

: Disable Query Hints

: http://www.sqlservice.se/sv/start/blogg/sql-server-trace-flag-8602.aspx







: 8605

: Displays logical and physical trees used during the optimization process

: More Undocumented Query Optimizer Trace Flags

: Yet another X-Ray for the QP







: 8606

: Show LogOp Trees

: Cardinality Estimation Framework 2014 First Look

: Yet another X-Ray for the QP







: 8607

: Displays the optimization output tree during the optimization process

: Internals of the Seven SQL Server Sorts – Part 1

: More Undocumented Query Optimizer Trace Flags

: Yet another X-Ray for the QP







: 8612

: Add Extra Info to the Trees Output

: Cardinality Estimation Framework 2014 First Look







: 8615

: Display the final memo structure

: http://www.benjaminnevarez.com/2012/04/inside-the-query-optimizer-memo-structure/

: http://www.somewheresomehow.ru/optimizer-part-3-full-optimiztion-optimization-search0/







: 8619

: Show Applied Transformation Rules

: http://sqlblog.com/blogs/paul_white/archive/2013/02/06/incorrect-results-with-indexed-views.aspx

: Cardinality Estimation Framework 2014 First Look

: Yet another X-Ray for the QP







: 8620

: Add memo arguments to trace flag 8619

: Query Optimizer Deep Dive — Part 4

: Yet another X-Ray for the QP







: 8621

: Rule with resulting tree

: Query Optimizer Deep Dive — Part 4

: Yet another X-Ray for the QP







: 8628

: When used with TF 8666, causes extra information about the transformation rules applied to be put into the XML showplan.

: Yet another X-Ray for the QP







: 8649

: Set Cost Threshold for parallelism from 1 to 0

: http://www.sqlservice.se/sv/start/blogg/enable-parallellism-for-specific-query.aspx







: 8666

: CQScanPartitionSortNew is one of only two sort classes that sets the Soft Sort property exposed when Sort operator execution plan properties are generated with undocumented trace flag 8666 enabled

: Internals of the Seven SQL Server Sorts – Part 1

: Yet another X-Ray for the QP







: 8675

: Displays the query optimization phases for a specific optimization

: More Undocumented Query Optimizer Trace Flags







: 8679

: Prevents the SQL Server optimizer from using a Hash Match Team operator

:







: 8687

: Prevents the SQL Server optimizer from using a Hash Match Team operator

:







: 8690

Undocumented trace flag

: Disable the spool on the inner side of nested loop.

Spools improve performance in majority of the cases. But it's based on estimates.

Sometimes, this can be incorrect due to unevenly distributed or skewed data, causing slow performance.

But in vast majority of situations, you don't need to manually disable spool with this trace flag.

: https://blogs.msdn.microsoft.com/psssql/2015/12/15/spool-operator-and-trace-flag-8690/

: http://dba.stackexchange.com/questions/52552/index-not-making-execution-faster-and-in-some-cases-is-slowing-down-the-query







: 8721

: Reports to the error log when auto-update statistics executes

: https://support.microsoft.com/en-us/kb/195565

: MSDN ms188396

: global only







: 8722

: Disable all hints except locking hints

: http://sqlmag.com/sql-server/investigating-trace-flags







: 8744

: Disable pre-fetching for the Nested Loop operator

: KB920093

: MSDN ms188396

: global only







: 8755

: Disable all locking hints

: http://sqlmag.com/sql-server/investigating-trace-flags







: 8757

: Skip trivial plan optimization and force a full optimization

: More Undocumented Query Optimizer Trace Flags







: 8765

: Allows use of variable length data, from ODBC driver; fixes the issue of a field returning the wrong data length

:







: 8780

: Give the optimizer more time to find a better plan

: http://www.sqlservice.se/sv/start/blogg/sql-server-trace-flag--8780.aspx







: 8783

: Allows DELETE, INSERT, and UPDATE statements to honor the SET ROWCOUNT ON setting when enabled

:







: 8809

: Extended Page Heap Activities.

Referenced in passing in the CSS article in relation to debugging memory scribbler problems.

: https://blogs.msdn.microsoft.com/psssql/2012/11/12/how-can-reference-counting-be-a-leading-memory-scribbler-cause/







: 8816

: Logs every two-digit year conversion to a four-digit year

:







: 9024

: Converts a global log pool memory object into NUMA node partitioned memory object

: Beginning with SQL Server 2012 SP3 and SQL Server 2014 SP1 this behavior is controlled by the engine and trace flag 9024 has no effect.

: https://support.microsoft.com/en-us/kb/2809338

: MSDN ms188396

: global only

Related to: 8048







: 9059

: SQL 8 — Turns back behavior to SP3 after a SP4 installation, this allows to choose an index seek when comparing numeric columns or numeric constants that are of different precision or scale; else would have to change schema/code.

:







: 9082

: SQL 9 — Stored procedure using views, perform slow compared to ver 8 if views use JOIN operator and contain sub queries

: https://support.microsoft.com/en-us/kb/942906







: 9130

: Disables the particular copy out stage rewrite from Filter + (Scan or Seek) to (Scan or Seek) + Residual Predicate.

Enabling this flag retains the Filter in the final execution plan, resulting in a SQL Server 2008+ plan that mirrors the 2005 version.

: http://sqlblog.com/blogs/paul_white/archive/2012/10/15/cardinality-estimation-bug-with-lookups-in-sql-server-2008-onward.aspx

: http://sqlblogcasts.com/blogs/sqlandthelike/archive/2012/12/06/my-new-favourite-traceflag.aspx

: http://sqlblog.com/blogs/paul_white/archive/2013/06/11/hello-operator-my-switch-is-bored.aspx

: https://connect.microsoft.com/SQLServer/feedback/details/767395/cardinality-estimation-error-with-pushed-predicate-on-a-lookup

: http://www.theboreddba.com/Categories/FunWithFlags/Revealing-Predicates-in-Execution-Plans-(TF-9130).aspx







: 9134

: SQL 8 — Does additional reads to test if the page is allocated & linked correctly this checks IAM & PFS. Fixes error 601 for queries under Isolation level read uncommitted. In case performance is affected (because of a bug) apply SP4.

:







: 9185

: Cardinality estimates for literals that are outside the

histogram range are very low

: https://support.microsoft.com/en-us/kb/kbview/833406

Related to: 9205







: 9204

: Output Statistics used by Query Optimizer. When enabled and a plan is compiled or recompiled there is a listing of statistics which is being fully loaded & used to produce cardinality and distribution estimates for some plan alternative or other.

: http://sqlblog.com/blogs/paul_white/archive/2011/09/21/how-to-find-the-statistics-used-to-compile-an-execution-plan.aspx

Related to: 9292







: 9205

: Cardinality estimates for literals that are outside the histogram range are very low for tables that have parent-child relationships

: https://support.microsoft.com/en-us/kb/kbview/833406

Related to: 9185







: 9207

: Fixes that SQL Server underestimates the cardinality of a query expression and query performance may be slow

: https://support.microsoft.com/en-us/kb/831302







: 9259

: SQL 9/10 — An access violation occurs on running a query marked by the following message and a dump in the log folder: KB 970279 / 971490. Msg 0, Level 11, State 0, Line 0 — A severe error occurred on the current command. The results, if any, should be discarded.

:







: 9268

: SQL 8 — When SQL Server runs a parameterized query that contains several IN clauses, each with a large number of values, SQL Server may return the following error message after a minute or more of high CPU utilization: KB 325658. Server: Msg 8623, Level 16, State 1. Internal Query Processor Error: The query processor could not produce a query plan. Contact your primary support provider for more information.

:







: 9292

: Output Statistics considered to be used by Query Optimizer

: http://sqlblog.com/blogs/paul_white/archive/2011/09/21/how-to-find-the-statistics-used-to-compile-an-execution-plan.aspx

Related to: 9204







: 9347

: Disables batch mode for sort operator. SQL Server 2016 introduces a new batch mode sort operator that boosts performance for many analytical queries.

: https://support.microsoft.com/en-us/kb/3172787

: MSDN ms188396

: Niko Neugebauer Columnstore Indexes – part 86

: global only







: 9349

: https://support.microsoft.com/en-us/kb/3172787

: Disables batch mode for top N sort operator. SQL Server 2016 introduces a new batch mode top sort operator that boosts performance for many analytical queries.

: MSDN ms188396

: Niko Neugebauer Columnstore Indexes – part 86

: global or session or query







: 9358

: Disable batch mode sort operations in a complex parallel query. For example, this flag could apply if the query contains merge join operations.

: Niko Neugebauer Columnstore Indexes – part 86

: https://support.microsoft.com/en-us/kb/3171555







: 9389

: Enables dynamic memory grant for batch mode operators. If a query does not get all the memory it needs, it spills data to tempdb, incurring additional I/O and potentially impacting query performance.

If the dynamic memory grant trace flag is enabled, a batch mode operator may ask for additional memory and avoid spilling to tempdb if additional memory is available.

: Niko Neugebauer Columnstore Indexes – part 86

: MSDN ms188396

: global or session







: 9453

: Disables Batch Mode in Parallel Columnstore query plans.

(Note that a plan using batch mode appears to require a recompile before the TF takes effect)

Sunil Agarwal also used this trace flag in demo scripts for a PASS 2014 session on column store indexing

: Niko Neugebauer Columnstore Indexes – part 35

: http://sqlmag.com/sql-server/what-you-need-know-about-batch-mode-window-aggregate-operator-sql-server-2016-part-1







: 9471

: Causes SQL Server to generate a plan using minimum selectivity for single-table filters, under the query optimizer cardinality estimation model of SQL Server 2014 through SQL Server 2016 versions.

Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag.

: Please ensure that you thoroughly test this option, before rolling it into a production environment.

: New Features in SQL Server 2016 Service Pack 1

: MSDN ms188396

: global or session or query







: 9476

: Causes SQL Server to generate a plan using the Simple Containment assumption instead of the default Base Containment assumption, under the query optimizer cardinality estimation model of SQL Server 2014 through SQL Server 2016 versions.

Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag.

: Please ensure that you thoroughly test this option, before rolling it into a production environment.

: https://support.microsoft.com/en-us/kb/3189675

: New Features in SQL Server 2016 Service Pack 1

: MSDN ms188396

: global or session or query







: 9481

: Enables you to set the query optimizer cardinality estimation model to the SQL Server 2012 and earlier version independent of the compatibility level of the database.

To accomplish this at the database level, see ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL).

To accomplish this at the query level, add the QUERYTRACEONquery hint

: http://support.microsoft.com/kb/2801413

: New Features in SQL Server 2016 Service Pack 1

: https://sqlserverscotsman.wordpress.com/2016/11/28/a-guide-on-forcing-the-legacy-ce/

: MSDN ms188396

: global or session or query







: 9485

: Disables SELECT permission for DBCC SHOW_STATISTICS

: https://support.microsoft.com/en-us/kb/2683304

: MSDN ms188396

: global only







: 9495

: Disables parallelism during insertion for INSERT...SELECT operations and it applies to both user and temporary tables

: https://support.microsoft.com/en-us/kb/3180087

: MSDN ms188396

: global or session







: 9532

: SQL 11 CTP3 — to get more than 1 availability group replica in CTP3 Scope Startup

: http://connect.microsoft.com/SQLServer/feedback/details/682581/denali-hadron-read-only-routing-url-is-not-yet-implemente







: 9567

: Enables compression of the data stream for availability groups during automatic seeding.

Compression can significantly reduce the transfer time during automatic seeding and will increase the load on the processor.

: MSDN ms188396

: https://www.mssqltips.com/sqlservertip/4537/sql-server-2016-availability-group-automatic-seeding/

: https://msdn.microsoft.com/en-us/library/mt735149.aspx

: MSDN mt736907

: global or session







: 9592

: Enables log stream compression for synchronous availability groups.

This feature is disabled by default on synchronous availability groups because compression adds latency.

: MSDN ms188396

: MSDN mt736907

: global or session







: 9806

: Unknown. Is turned on on SQL Server 2014 CTP1 standard installation in Windows Azure VM

:







: 9807

: Unknown. Is turned on on SQL Server 2014 CTP1 standard installation in Windows Azure VM

:







: 9808

: Unknown. Is turned on on SQL Server 2014 CTP1 standard installation in Windows Azure VM

:







: 9830

Undocumented trace flag

: Activate the trace flag before creating a natively compiled procedure.

If you now open up the SQL Server error log you should see the compilation process for the natively compiled procedure.

This is an undocumented trace flag so please don't use this on a production system.

: https://web.archive.org/web/20160327221828/http://speedysql.com/2015/10/28/new-trace-flag-for-in-memory-oltp-hekaton/







: 9851

Undocumented trace flag

: For testing purposes, you might want to turn off automatic merging of files, so that you can more readily

explore this metadata. You can do that by turning on the undocumented trace flag 9851. And of course,

be sure to turn off the trace flag when done testing.

: http://gsl.azurewebsites.net/Portals/0/Users/dewitt/talks/HekatonWhitePaper.pdf







: 10204

: Disables merge/recompress during columnstore index reorganization.

In SQL Server 2016, when a columnstore index is reorganized, there is new functionality to automatically merge any small compressed rowgroups

into larger compressed rowgroups, as well as recompressing any rowgroups that have a large number of deleted rows.

: Trace flag 10204 does not apply to column store indexes which are created on memory-optimized tables.

: MSDN ms188396

: global or session







: 10213

: Enables the option to configure compression delay in columnstore indexes in SQL Server 2016

: http://www.nikoport.com/2016/02/04/columnstore-indexes-part-76-compression-delay/

: session







: 10316

: Enables creation of additional indexes on internal memory-optimized staging temporal table, beside the default one.

If you have specific query pattern that includes columns which are not covered by the default index you may consider adding additional ones.

: System-versioned temporal tables for Memory-Optimized Tables are designed to provide high transactional throughput.

Please be aware that creating additional indexes may introduce overhead for DML operations that update or delete rows in the current table.

With the additional indexes you should aim to find the right balance between performance of temporal queries and additional DML overhead.


: MSDN ms188396

: https://support.microsoft.com/en-us/kb/3198846

: https://blogs.msdn.microsoft.com/sqlcat/2016/12/08/improve-query-performance-on-memory-optimized-tables-with-temporal-using-new-index-creation-enhancement-in-sp1/

: global or session








All Articles