Monday 18 February 2013

SQL Server : Caution while enabling Trace flag : (-T1204 or -t1204)



While working on a project ,I've come across situations where I had to add trace flags to my SQL Server instances for capturing useful information in SQL Server error log . Everyone know that how to do that but there might be chances that impact of -T (Capital T) and -t (small t) is not well calculated.


Trace flags can be used to alter the behavior of SQL Server and they can assist when diagnosing performance issues as well. Flags can be set for Session or Global (some are startup) levels though for later some can only be switched at startup using –T (you are suggested to avoid –t which turns on other internal flags) otherwise DBCC TraceOn/TraceOff (Flag # -1 though optional) comes quite handy.

-T > turns on only trace flag which is specified
-t > which turns on other internal flags along with the flag which is specified

How to check a trace flag is enabled or disabled?


Using method DBCC TRACESTATUS, we can check the status of a trace flag.
Ex: DBCC TRACESTATUS (-1) will display list of trace flags enabled at global level
DBCC TRACESTATUS () will display list of trace flags enabled for current session





Brgds,


Chhavinath Mishra
Database Administrator
Microsoft Certified IT Professional (MCITP)

No comments:

Post a Comment