Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

What is the Syntax for Multiple Trace Flags Expand / Collapse
Author
Message
Posted Tuesday, March 10, 2009 2:32 PM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 21, 2011 9:28 AM
Points: 10, Visits: 41
In SQL 2005 Configuration Manager, if I want to turn on multiple trace flags for sqlservr, what is the correct syntax? For example if I want to have trace # 1204 and 1222 both on when SQL Server starts, do I use -T1204 -T1222 or -T1204,1222 or something else?

Thanks for your input.

Nate



Nate TeWinkel
UFS Inc. - DBA / Operations Analyst / Programmer
Post #672790
Posted Tuesday, March 10, 2009 11:56 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, September 21, 2011 1:19 PM
Points: 933, Visits: 1,016
I don't know if that is possible Nate...

But... isn't 1222 only isn't enough? They both return full information; only thing is 1222 returns information in XML format.

1204: Returns the resources and types of locks participating in a deadlock and also the current command affected.

Scope: global only

1222: Returns the resources and types of locks that are participating in a deadlock and also the current command affected, in an XML format that does not comply with any XSD schema.

Scope: global only

Thanks.


---

Mohit K. Gupta, MCITP: Database Administrator (2005), My Blog.
Microsoft FTE - SQL Server PFE

* Some time its the search that counts, not the finding...
* I didn't think so, but if I was wrong, I was wrong. I'd rather do something, and make a mistake than be frightened and be doing nothing.


How to ask for help .. Read Best Practices here.
Post #672998
Posted Wednesday, March 11, 2009 7:16 AM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 21, 2011 9:28 AM
Points: 10, Visits: 41
In the Books Online, under Trace flags [SQL Server]:deadlocks it says "It is possible to enable both trace flags to obtain two representations of the same deadlock event."

I'm trying to troubleshoot some deadlock issues and that is when I saw that comment. I am really just using these two as an example. Whether it is these two or combinations of any of the trace flags, I am curious as to what the actual syntax is to do multiple trace flags.



Nate TeWinkel
UFS Inc. - DBA / Operations Analyst / Programmer
Post #673222
Posted Wednesday, March 11, 2009 8:11 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 9:58 AM
Points: 1,097, Visits: 2,137
NateT (3/11/2009)
In the Books Online, under Trace flags [SQL Server]:deadlocks it says "It is possible to enable both trace flags to obtain two representations of the same deadlock event."

I'm trying to troubleshoot some deadlock issues and that is when I saw that comment. I am really just using these two as an example. Whether it is these two or combinations of any of the trace flags, I am curious as to what the actual syntax is to do multiple trace flags.


Yes, you can use both but it is hard to analyze a deadlock issue with the graph generated by 1204. Enable 1222 will give you clear picture and also TSQL statements causing the deadlock issue. If you have any torubles, post the output of 1222, we would be able to help you out.


Post #673281
Posted Wednesday, March 11, 2009 8:21 AM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 21, 2011 9:28 AM
Points: 10, Visits: 41
Yes, I have turned on one of the trace flags and I'm beginning to examine what is causing the deadlocks.

However, that is not what this post is about.

I would like to know how to turn on multiple global trace flags at startup with the -T option. I should have used a more generic example of mythical trace flags 1111 and 9999. How do I enable two (or more) of the trace flags at startup?

Thank you.



Nate TeWinkel
UFS Inc. - DBA / Operations Analyst / Programmer
Post #673297
Posted Wednesday, March 11, 2009 8:25 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 10:19 AM
Points: 4,505, Visits: 9,197
if doing it via configuration manager:

;-T1204;-T1222

add that to the end of current startup parameters. You should see the flags referred to in the errorlog when SQL is restarted

If you want to enable them without restarting SQL

DBCC TRACEON(1204,1222,-1)

the -1 means enable for all sessions.

to check use DBCC TRACESTATUS(-1)

to turn off

DBCC TRACEOFF(1204,1222,-1)

using 1204 and 1222 just as an example


---------------------------------------------------------------------

proud member of the 'et al' fraternity.
Post #673303
Posted Wednesday, March 11, 2009 8:29 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 9:58 AM
Points: 1,097, Visits: 2,137

NateT (3/11/2009)


I'm trying to troubleshoot some deadlock issues and that is when I saw that comment.


My apologies, but I was trying to give more insight into your troubleshoot just an extra info.

Post #673308
Posted Wednesday, March 11, 2009 8:38 AM


One Orange Chip

One Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange Chip

Group: Administrators
Last Login: Today @ 4:06 PM
Points: 29,496, Visits: 11,673
http://msdn.microsoft.com/en-us/library/ms187329.aspx

You can include 1..n trace flags with DBCC TRACEON









Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #673321
Posted Wednesday, March 11, 2009 8:41 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 9:58 AM
Points: 1,097, Visits: 2,137
Steve Jones - Editor (3/11/2009)
http://msdn.microsoft.com/en-us/library/ms187329.aspx

You can include 1..n trace flags with DBCC TRACEON




OP was wanting solution at the startup steve:)


Post #673324
Posted Wednesday, March 11, 2009 8:42 AM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 21, 2011 9:28 AM
Points: 10, Visits: 41
Thank you, George. That's what I was looking for. Since I didn't see any specific syntax for the -T it would make sense that it would have to be added a second time with the next flag to turn on.




Nate TeWinkel
UFS Inc. - DBA / Operations Analyst / Programmer
Post #673329
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse