Contents
How do I enable trace flag in SQL Server?
In SQL Server Configuration Manager, click SQL Server Services. In the right pane, right-click SQL Server () , and then click Properties. On the Startup Parameters tab, in the Specify a startup parameter box, type the parameter (in this case the trace flag -T1118 ), and then click Add. Click OK.
How do I enable DBCC Traceon?
Remarks
- Using the DBCC TRACEON and DBCC TRACEOFF commands. For example, to enable the 2528 trace flag globally, use DBCC TRACEON with the -1 argument: DBCC TRACEON (2528, -1) .
- Using the -T startup option to specify that the trace flag be set on during startup.
- At the query level, by using the QUERYTRACEON query hint.
What are my trace flags enabled on SQL Server?
SQL Server from time to time has an uncanny requirement to enable certain Trace Flags. Trace Flags are specifically enabled by administrators to mitigate certain behavior that SQL Server has in specific situations.
How to enable or disable trace flags in DBCC?
Trace flags are set ON or OFF by using either of the following methods: Using the DBCC TRACEON and DBCC TRACEOFF commands. For example, to enable the 2528 trace flag globally, use DBCC TRACEON with the -1 argument: DBCC TRACEON (2528, -1). The effect of enabling a global trace flag with DBCC TRACEON is lost on server restart.
How to check the status of a trace flag?
As the name suggests the Global flag is applicable for the whole server node while there can be specific status which are applicable just for a session duration. If you want to check the status of a Trace Flag, then we can call the trace status command specifically using the trace number as indicated below.
When to enable or disable trace flag 139?
WARNING: Trace flag 139 is not meant to be enabled continuously in a production environment, and should be used for the sole purpose of performing database validation checks described in this Microsoft Support article. It should be immediately disabled after validation checks are completed.