Introduction to Profiler

  • Comments posted to this topic are about the item Introduction to Profiler

  • Profiler is probably the most valuable tool I use for troubleshooting, especially with vendor provided applications. With Profiler, I can frequenetly determine the cause of an nissue and the fix in just a few minutes, rather than trying to work with the vendor. One of our vendor apps builds SQL code from a library, and Profiler allows us to determine not only what code is executed, but also where teh code was stored.

  • Thanks Jack, great introduction to Profiler. Looking forward to the next installment.

  • I have been doing SQL Server development for 8 years and have never gone far enough with profiler to run a trace. I read through the article and setup my first trace. I use ColdFusion as my application server so all events are execution of prepared SQL. How can I find the actual SQL, I thought it would be in Text Data?

  • Great intro. I like it.

    I have seen tools like Intuit (now Quest S/w) Coefficient that do a phenomenal job of analyzing the output of a trace and posting the results in an extremely easy to use format.

    Can you post some useful trace templates that you use for Profiler 2008 and how to use them?

    Also, how do you baseline a server using Profiler and how can this info be best used when something starts acting up.

  • john.w.walker (4/16/2009)


    I have been doing SQL Server development for 8 years and have never gone far enough with profiler to run a trace. I read through the article and setup my first trace. I use ColdFusion as my application server so all events are execution of prepared SQL. How can I find the actual SQL, I thought it would be in Text Data?

    John,

    What events are you including in your trace?

  • Profiler is great when tracking down problems with Service Broker.

  • I am pretty much including all events because I don't know how to choose what I really need. But 99% of what I see is prepared SQL execution and I expected as much due to my application configuration which sends SQL via Data Direct drivers from Java to SQL Server. I se some slower SQL, but I want to know what the SQL statement is or I can't track it down.

  • The events I am seeing that I want to see the SQL for are RPC Completed. Object is sp_prepexec or sp_execute.

  • John,

    I think the issue is that, if you started with the Standard Template, the TextData column is NOT selected for the RPC:Completed event. If you go in and modify the properties of the trace and check the TextData column under the RPC:Completed event I believe you will see something like this in the TextData column:

    declare @p1 int

    set @p1=1

    exec sp_prepexec @p1 output,N'@contact_id int',N'Select Count(*) as persons from Person.Contact Where contactid = @contact_id',@contact_id=541

    select @p1

    This is from a quickie .NET application where I used Command.Prepare() and queried the AdventureWorks DB.

  • raj more (4/16/2009)


    Great intro. I like it.

    I have seen tools like Intuit (now Quest S/w) Coefficient that do a phenomenal job of analyzing the output of a trace and posting the results in an extremely easy to use format.

    Can you post some useful trace templates that you use for Profiler 2008 and how to use them?

    Also, how do you baseline a server using Profiler and how can this info be best used when something starts acting up.

    Raj,

    Thanks for the kind words.

    I hadn't even considered posting templates mainly because templates I do create are usually just to add filters on database or application so I don't have to keep re-creating the filters, so they are specific to my environment. It's a great suggestion though.

    As far as baselining, that will be something I discuss in one of the later articles in the series. A quick idea is to to use the CPU, reads, and writes columns on the RPC:Completed, SP:Completed, and SQL:StmtCompleted events and see if there are changes to these as your data changes or as you make changes to queries. I've just started Grant Fritchey's book, SQL Server 2008 Query Performance Tuning Distilled, and I currently reading his chapter on baselining. He says, and I agree, you can't tell if what you are doing works if you don't have a baseline.

  • Jack, thanks a bunch. That was the problem. I went through all the columns and right clicked on them to select them, but they weren't all set for some reason. Once I fixed that, I got what I needed. This will be a huge help. Looking forward to future articles on using the traces.

  • Nice article, Jack. It's a great kick-start for anybody wanting to learn the profiler.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Hi Jack,

    Brilliant article! I knew from other posts elsewhere that you were going to do a series on Profiler and when I saw this in my mailbox this morning I got very exited. This part I am OK with except for the selecting of columns and events which I will now start doing and swot up from BOL. I am excited for you next delivery. When can we expect that? Keep up the good work!;-):-P

    :-PManie Verster
    Developer
    Johannesburg
    South Africa

    I can do all things through Christ who strengthens me. - Holy Bible
    I am a man of fixed and unbending principles, the first of which is to be flexible at all times. - Everett Mckinley Dirkson (Well, I am trying. - Manie Verster)

  • Very nice article Jack, I would be in the crowd who needs this introduction, and found your article to be very well written and easy to follow.

    Looking forward to the next!

    Jon

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic. Login to reply