Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

This tutorial will help you learning SQL Server Profiler

Authors

Getting Started with SQL Server Profiler

Getting Started with SQL Server Profiler - Part 1: What is a SQL Trace?

Jun 26 2012 12:00AM by Nakul Vachhrajani   

Microsoft SQL Server comes with a host of development and administrator features that warrant a separate IDE – the SQL Server Management Studio (SSMS). While the SSMS allows a developer or an administrator to write and debug T-SQL code and manage and maintain SQL Server instance(s), there is a requirement for a diagnostic tool that can be used for:

  • Troubleshooting
  • Debugging T-SQL code
  • Performance monitoring & analysis
  • Audit and review activities occurring against an instance of the Microsoft SQL Server
  • Correlate performance counters for advanced troubleshooting

SQL Trace

All of this is achieved by “tracing” the activities of the SQL Server Database engine. Such an instance is called a “SQL Trace”. A SQL Trace is most commonly described by using the following terms. We will be using these as we talk more about the SQL Server Profiler

  • Trace = A collection of events & data returned by the SQL Server database engine
  • Events = An Event is the occurrence of an event within the SQL Server Database engine
  • Event Class = A type of event that can be traced. The event class contains all of the data columns that can be reported by an event
  • Event Category = A group of related Event Classes
  • Data column = An attribute of an event
  • Filter = Criteria that limit the events collected on a trace

Permissions

Any user requiring to run a SQL Trace using SQL Server Profiler must have the ALTER TRACE permissions on the SQL Server instance. Talking about permissions, it is important to remember that such users will be able to see sensitive information and therefore such access must be restricted to members of the db_owner fixed database role, or members of sysadmin fixed server role.

Access to trace data – Minimum disk space requirements

For efficient access to the trace data, SQL Server Profiler uses the path specified by the TEMP environment variable to store the trace data. It is required that SQL Server Profiler has a minimum 10MB of free space. If by chance, the free space drops below 10MB, all SQL Server Profiler functions stop.

Launching the SQL Server Profiler

Now that we have the basics, let’s see the 3 ways by which we can invoke SQL Server Profiler.

  1. Via Command Prompt: This has got to be the most used method to launch the SQL Server Profiler. One can go to the “Run” prompt or launch the command prompt and type the following based on the version of Microsoft SQL Server Profiler that one wants to launch:

    profiler90 = Profiler for Microsoft SQL Server 2005 profiler = Profiler for Microsoft SQL Server 2008/2008 R2/SQL 2012 (code named: “Denali”)

  2. Via SQL Server Management Studio (SSMS):

    Via the toolbar: Go to Tools –> SQL Server Profiler

    NOTE: No SPID filtering is performed.

    alt text

    Via the Query editor window:

    1. In the Query editor window, right-click
    2. Choose “Trace Query in SQL Server Profiler” (As an alternate to the above steps, you can use the keyboard short-cut: Ctrl+Alt+P)

alt text

NOTE: Note that the SPID being traced by the Profiler is automatically set to the SPID of the Query editor window.

Via Activity Monitor

  • Launch the Activity Monitor (refer my post: Activity Monitor – Underappreciated Features of Microsoft SQL Server)
  • Under the “Process” pane, select the activity of interest
  • Right-click and choose “Trace Process in SQL Server Profiler”

    NOTE: Note that the the SPID being traced by the Profiler is automatically set to the SPID selected in the Processes pane.

alt text

In my next post, I will be looking at Profiler Templates, Template types and how to create customized templates.


Nakul Vachhrajani
4 · 33% · 10680
13



Submit

6  Comments  

  • Nakul can you please write something related to perfmon and how we can use that? Thanks in advance for your help

    commented on Jun 27 2012 7:58AM
    Jeetendra
    153 · 1% · 315
  • That's a nice idea, Jeetendra. I have added it on my "to-write-about" list.

    Thank-you for the feedback. Keep it coming!

    commented on Jun 27 2012 12:10PM
    Nakul Vachhrajani
    4 · 33% · 10680
  • Hi Nakul,

    How to filter the procedures/Events based on our windows username.

    Regards, Ramkoti

    commented on Aug 1 2012 7:22AM
    Ramkoti
    415 · 0% · 95
  • Thank you Nakul.

    commented on Aug 7 2012 4:09AM
    Ramkoti
    415 · 0% · 95
  • How to give SQL Profiler permissions to users.

    commented on Sep 25 2012 2:43AM
    Ramkoti
    415 · 0% · 95

Your Comment


Sign Up or Login to post a comment.

"Getting Started with SQL Server Profiler - Part 1: What is a SQL Trace?" rated 5 out of 5 by 13 readers
Getting Started with SQL Server Profiler - Part 1: What is a SQL Trace? , 5.0 out of 5 based on 13 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]