SQL Server Profiler Tutorial

Source: Internet
Author: User

SQL Server Profiler is a SQL Server Enterprise Edition with a very powerful statement tracking and analysis tool. Using it skillfully is useful for us to analyze database performance issues, such as when data Access uses an ORM framework such as EF, we often need to look at the SQL statements that it generates to us, and then analyze performance issues, and I intend to summarize them in the following ways.

    1. Environment configuration
    2. How to track SQL statements
    3. Using templates
Environment configuration

To use SQL Server Profiler, the first of all is to configure the environment, how to configure it? Can be divided into the following steps.

1. Start SQL Server Profiler, select the menu "Tools > SQL Server Profiler" to start the SQL Server Profiler, as in.

    

2, go to the Login window, select the link database, enter the user name and password, click the ' Connect ' button to open the Tracking Settings window, such as.

    

3, select the standard template and then go to the ' Events Selection ' event Selection window, such as.

    

4, tick the ' Show all Columns ' option, click on the column Filters ... Enter the column Filter window, such as.

    

Note that here with hostname only for Windows authentication method login, if the shared sa account can not be filtered, how to solve the problem, still need to check the information.

5, click the OK button, and then go to the window to start monitoring, such as.

    

So the environment is configured so that you can start tracking and monitoring.

How to track SQL statements

We initiate a query request locally, and then we can see the SQL statements executed, such as.

  

Next, you can copy the SQL you traced to the SQL Server to execute and view the execution plan.

Using templates

In order to save frequently run configurations, avoid duplication of settings and improve efficiency, we save these settings and build a template, and the next time you run it, you can quickly start tracking by selecting the appropriate template directly. So how do you create a new template in SQL Server Profiler? This can be done in the following steps.

1. Select the menu ' file/templates/new template ... ' To open the New Trace Template window, such as.

    

2, enter the template name, and select based on the existing standard template, the Event Selection window setting is the same as when the environment is configured, display all columns and use the filter to display the information we need to display, such as.

    

Click Save, a new template is built, the next time you start the template can be directly selected to start tracking, is not very convenient?

Resources:

1, the Cloud drizzling SQL Server Profiler using the tutorial, easy to understand is the kingly

SQL Server Profiler Tutorial

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.