Trace Flags of SQL Server 2005 are a interesting topic. Even though Developer may not be using them much, Administrators and Performance tuning engineers regularly work them. Lets find out what are Trace Flags.
- What are Trace Flags and why are they used?
- What are the different types of Trace Flags?
- What is the difference between Global Trace Flag and Session Trace Flag?
- If a Session Trace Flag is enabled in Session A, will it affect Session B?
- How to configure Trace Flags?
- Is it possible to enable session Trace Flags using startup options?
- How to enable the trace flag 3205 for a session?
- How to enable the trace flag 3205 globally?
- Where can I read more information on Trace Flags?
Trace Flags are used to temporarily enable or disable specific behavior of SQL Server. For example, if the Trace Flag 7806 is set SQL Server 2005 allows Dedicated Administration Connections.
SQL Server 2005 supports Session level Trace Flags and Global level Trace Flags.
Global trace flags are active at the server level and are visible to all the existing connections and new connection of the server.
Session level trace flags are active only to the current user session and they are visible to the current connection.
No. Session B will not be able to see any changes.
Trace flags are configured can be configured in two way. Using either DBCC TRACEON/TRACEOFF to configure session and global trace flags or -T startup option of SQL Server service to enable trace flags globally.
No. It is not possible to enable session level trace flags using –T startup option. The startup option is used only to enable global trace flags.
7. Example: how to enable the trace flag 3205 for a session? Execute the command DBCC TRACEON 3205 Execute the command DBCC TRACEON 3205, -1. Note the extra parameter -1 which instructs to apply the trace flag globally. Read the MSDN article on Trace Flag
Execute the command DBCC TRACEON 3205
Execute the command DBCC TRACEON 3205, -1. Note the extra parameter -1 which instructs to apply the trace flag globally.
Read the MSDN article on Trace Flag