How to use SQL Server Profiler

Source: Internet
Author: User
Tags how to use sql server microsoft sql server 2005 how to use sql management studio sql server management sql server management studio

I. How SQL Server Profiler is used

1. Click Start-Program--microsoft SQL Server 2005--Performance tool--sql Server Profiler, such as:

2. Pop up the SQL Server Profiler window, such as:

3. In the Work window, click "File---" New trace (N) ... "", Pop Up the Database Connection dialog window, enter the Tracking database server name, user name and Password in the dialog window, such as:

4, after the input is complete, click the Connect button, pop up the tracking Properties window, the left side of the window "General" tab is a basic setting, generally use the default is OK. The Event Selection tab on the right is used to set what events to track, list of events can be selected, and basically there are events on SQL, including the procedure you can follow to manipulate the database with SQL Server Management Studio. Just click Show all events to make the selection of all events.

You can also filter the statistics fields on the Event Selection tab, and click any of the column headings to see a description of the column, such as:

This is described in turn:

TextDate relies on the text value of the event class captured in the trace;

ApplicationName the name of the client application that created the SQL Server connection. This column is populated by the value passed by the application, not by the program name that is displayed;

Ntusername the Windows user name.

LoginName User's login name (SQL Server secure logon or Windows logon credentials, in the format "domain \ User name")

CPU time (in milliseconds) that is used by the CPUs event.

Reads the number of times the logical disk was read by the server on behalf of the event.

Writes the number of times that the server writes physical disks on behalf of events.

The time that the Duration event takes. Although the server calculates the duration in microseconds, SQL Server Profiler can display the value in milliseconds, depending on the settings in the Tools > Options dialog box

ClientProcessID the process ID of the application calling SQL Server.

SPID SQL Server assigns the server process ID to the associated process for the client.

The start time of the Strattime event (if available).

The time at which the EndTime event ended. This column is not populated for event classes that indicate the start of an event, such as Sql:batchstarting or sp:starting.

BinaryData relies on the binary values of the event classes captured in the trace.

5, after setting up, click the "Run" button can, of course, if you are interested, you can also rearrange and filter columns, as long as you click on the corresponding button below the prompt operation will be OK.

  Through the above diagram we can clearly track each step is the process. From the window can also clearly see the detailed SQL statement, if the SQL statement is ambiguous or do not understand the words can refer to the above, and is always, in SQL operation a few here will appear corresponding SQL statement, this is a learning and improve the good tool, not only this, We can also analyze the data, query, tracking can pause, start and stop operations, can start multiple traces at the same time, tracking different databases and tables, if and SQL Database Engine Tuning Advisor with the use of the better, you can analyze the performance of your SQL statement if, And will tell you how to modify it better.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.