Showing posts with label Profiler. Show all posts
Showing posts with label Profiler. Show all posts

Wednesday, August 26, 2009

Access Denied, Not Possible

What’s going on here?

When trying to open Default Trace files on Windows 7 and SQL Server 2008 I got the “You don’t have permission to open this file” error.  My first and second thoughts were “How can this be, I’m an administrator!?”.  SO the first thing I tried was reading the files using fn_trace_gettable in SSMS.  This works, what is different between SSMS and Profiler?  Nothing that I can think of.

What’s Next?

First step, check permissions on the folder, yup, full control.  Second step, turn off inheritance.  Third step, bang head on desk!  So off to google/bing I went.  I found this post by the SQL Server PSS team, , which told me about the issue, but not a good way to solve it.  I can’t just grant rights to each file because the Default Trace rolls over and creates new files, I need rights all the time.  Then I found this post, which says the owner of the files needs to copy and paste them out to a another shared folder.  While not the most helpful idea for my situation I tried it, and it worked!  I’m still annoyed at this point because I don’t want to have to move the files to read them.

Finally, a solution

Once again it is Twitter to the rescue.  I tweeted my problem and got a pretty quick response from Brian Kelley (Twitter|Blog) asking about OS and if I ran Profiler as Administrator.  I answered Win 7 and Yes, I was mistaken on the Yes it turns out.  I thought because the account I was running under had administrative privileges that I was running as administrator.  This is not the case in Vista, Win 7, and Windows Server 2008 when UAC is on.  With UAC on you still need to run Profiler using elevated privileges by right-clicking and selecting “Run As Administrator”.  That is the answer.  I should also note that Ken Simmons (Twitter|Blog) also produced this answer.   Jonathan Kehayias (Twitter|Blog) also chimed in to let me know that you can set individual applications to always run as administrator by right-clicking, selecting Properties, Compatibility, and checking the Run as Administrator box.  All of this in about 20 minutes and this is after I spent at least an hour fighting with it and searching the internet for a solution!

Conclusion

I really need to get a better understanding of UAC, and believe it or not, Twitter works!

Wednesday, May 13, 2009

What are EventSubClass and ObjectType in my Trace File?

Have you ever wondered what that 1 in EventSubClass or ObjectType 8277 mean in that trace file you are querying using fn_trace_gettable?  If I open the file in Profiler I see EventSubClass 0-Begin and for ObjectType I see 8277-U, but when I use fn_trace_gettable I only see 0 and 8277.  Well, today I found out how to find out what those nice integers mean.  Both translations can be found in the sys.trace_subclass_values system view.  This view consists of the trace_event_id (eventclass in the trace file), trace_column_id, subclass_name, and subclass_value.  So the query:
SELECT
TE.NAME AS event_name,
 TSV.subclass_name,
TSV.subclass_value 
FROM
sys.trace_events AS TE JOIN
sys.trace_subclass_values AS TSV ON
TE.trace_event_id = TSV.trace_event_id JOIN
sys.trace_columns AS TC ON
TSV.trace_column_id = TC.trace_column_id 
WHERE
TC.[name] = 'EventSubClass'
ORDER BY
 event_name
Will return all the EventSubClass names for each event and:
SELECT
TE.NAME AS event_name,
TSV.subclass_name,
TSV.subclass_value 
FROM
sys.trace_events AS TE JOIN
sys.trace_subclass_values AS TSV ON
TE.trace_event_id = TSV.trace_event_id JOIN
sys.trace_columns AS TC ON
TSV.trace_column_id = TC.trace_column_id 
WHERE
TC.[name] = 'ObjectType'
ORDER BY
event_name
returns all the ObjectType names, well actually abbreviations.  If you really want to know the names of the ObjectTypes you need to look here.  Or as Brad McGahee recommends in his book Mastering SQL Server Profiler you can search for “ObjectType Trace Event Column” in BOL.

Tuesday, April 28, 2009

Speaking at Tampa Bay SQL User Group

I will be speaking at the Tampa SQL User Group on Tuesday, May 19th.  I’ll be speaking on SQL Server Profiler which I have presented at OPASS and SQLSaturday #8 – Orlando. 

I look forward to meeting everyone who is part of the group and re-connecting with those I have met at other events like SQLSaturday.  Please don’t be offended if we met and I can’t remember your name, it is a MY failing, not yours.

Wednesday, April 15, 2009

Introduction to Profiler published on SQLServerCentral

My article Introduction to Profiler has been published on SQLServerCentral today.  This is part of one of a series that I am working on and covers the basics of Profiler.  The rest of the series will build to more complex uses of Profiler.

Thursday, April 2, 2009

Replaying a Profiler Trace Featured on JumpstartTV

The video, Replaying a Profiler Trace, that I did is being featured on JumpstartTV today.

JumpstartTV is a web site dedicated to professional development by providing specific 2-5 minute how to videos currently focused on SQL Server and .NET.

Wednesday, February 11, 2009

Featured Content on JumpstartTV

JumpstartTV featured another of the Profiler Videos I did for them today.
Explaining The Properties Window in SQL Server Profiler
This video goes through the setting the basic properties for a Profiler trace.