June 20, 2018 at 10:13 pm
Comments posted to this topic are about the item Converting Trace to Extended Events
June 21, 2018 at 1:44 am
This can also be done in PowerShell. I wrapped a slightly modified version of Jonathan's procedure in ConvertTo-DbaXESession and added it to dbatools
Here's how to convert the trace with id of 2 on two different servers, convert them to XE sessions named "Long Running Queries" then start them immediately
Get-DbaTrace -SqlInstance sql2017, sql2012 | Where Id -eq 2 | ConvertTo-DbaXESession -Name 'Long Running Queries' | Start-DbaXESession
Chrissy
Founder, dbatools.io
June 21, 2018 at 3:10 am
Ah, should have added that to the article. I'll put a note at the end.
June 21, 2018 at 7:02 am
Good write-up, Steve. I like that once you have the session defined the way you like, you can script it out, and I think it might actually be easier than profiler to set up a quick trace. For example, if I'm searching for text showing up in a query, or specific stored proc, I can have that script saved and do a find/replace anywhere the sql_text is set on an action and fire up the session. Thanks for sharing!
June 21, 2018 at 2:54 pm
Personally I like Extended Events better than profiler. But my biggest complaint is not setting up the session, but changing it. It was easier on profiler than editing the query and getting the parentheses and commas right in XE
June 28, 2018 at 9:41 am
alen teplitsky - Thursday, June 21, 2018 2:54 PMPersonally I like Extended Events better than profiler. But my biggest complaint is not setting up the session, but changing it. It was easier on profiler than editing the query and getting the parentheses and commas right in XE
Not using the UI?
June 28, 2018 at 9:42 am
S. Kusen - Thursday, June 21, 2018 7:02 AMGood write-up, Steve. I like that once you have the session defined the way you like, you can script it out, and I think it might actually be easier than profiler to set up a quick trace. For example, if I'm searching for text showing up in a query, or specific stored proc, I can have that script saved and do a find/replace anywhere the sql_text is set on an action and fire up the session. Thanks for sharing!
The same thing works in XE, which also then could have a much lower performance impact. I'd save out the ALTER script and then do the search/replace in the predicate if needed.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply