Simple use of SQL Server Profiler (monitoring mssql) SQL Server Profiler tracks database deadlocks

SQL Server Profiler can detect the statements executed on the data, especially some projects do not directly use SQL statements, but directly use the ORM framework system to process database projects, which is of great help when debugging SQL statements.

I wrote the article " SQL Server Profiler Tracking Database Deadlocks " using SQL Server Profiler to track deadlocks. Here, I will briefly write about the functions commonly used in the use of SQL Server Profiler.

 

SQL Server 2008 R2 version is used here

1. When installing the SQL Server database, please ensure that SQL Server Profiler is installed. By default, all installations will be installed automatically.

2. Open SQL Server Management Studio, in the menu, find the "Tools" menu, find the SQL Server Profiler menu item, as shown in the following figure.

 

3. Select "Event Selection" and check several frequently used items, as shown in the following figure.

 

4. Select "Show All Columns", then in the list, check the "DatabaseName" item.

 

5. Set the filter. The setting here is only to filter the database name, because if there are multiple databases in a database instance, then the database name is not filtered, and the execution statements on all databases can be monitored.

You can also set Duration to filter SQL statements with different execution times. For example, you can filter SQL statements with long execution time, and choose to optimize SQL statements.

What if multiple people access the same database and only want to detect the statements they operate? You can create a database account that you log in to the database (you can delete the user after testing), and then, in the LoginName filter, filter the database account you log in to.

 

After setting, click [Run] to start monitoring, and the monitoring screen is as follows.

 

For the monitoring content, you can save it. In the [File] menu of the monitoring interface, select Save As, and select the format you want to save. Next time, if you want to view the data, you can directly open the saved file.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326071942&siteId=291194637
Recommended