Relating SQL Server profiler with Performance monitor

A DBA would often experience the need to explore performance bottlenecks, to create benchmarking reports and to overview the SQL Server performance as part of its daily existence. Any of the above (including the daily existence) can easily become a daunting task if the "tools of the trade" are not known and mastered. Hence, in this short article we will concentrate our attention on a very rewarding aspect of the Windows Server and SQL Server performance monitoring tools.

 

In this article I will not go in detail about how to start perfmon and Profiler, nor how to save the output to file. I believe this is a subject of a completely different article. What we would see here is how to build a bridge over the river of information flowing between both tools.

 

Here is what you will need for the purpose:

  1. A perfmon generated file, in either *.csv or *.blg format
  2. A Profiler trace, saved to disk as a *.trc file.
  3. Plenty of good intention and sophistication when it comes to the gathered set of perfmon counters and Profiler events. Keep in mind that you have to know what you are looking for and get to it in the most efficient and modest way possible.

 

Let's suppose that we already have saved both files on disk and that we are ready to tackle the problem we are after.

1. Start SQL Server Profiler, and open the saved *.trc file.

2. Click on "File > Import Performance Data... " and you will be presented with a file browsing window like this one.

3. Point to the perfmon file (csv or blg) and click Open. Of course, the trace file and the perfmon file must have something in common. I.e. a trace which was stopped last month will not correlate with a perfmon file started today.

 

4. After you point to the perfmon file and click "Open", you will be presented with the following "Performance Counters Limit Dialog". As you can see, here you can select the performance counters which you are interested in and profiler will import them in correlation with the currently open trace. In an ideal situation you will select a few counters, thus making it easy to read and analyze.

5. After selecting the desired counters by checking the appropriate checkboxes, click OK, and viola! You will be presented with a colorful graphic of the perfmon counters' ups and downs within the Profiler.

6. Let's submerge us in a bit more detail: in the profiler now you see 4 different layers of information: trace events on top, the color diagram, the perfmon counter list and the actual Profiler's TextData field displayed on the bottom.

7. You have several options for exploring the information.

  • a. You can click on any line of the trace event and see the corresponding values of the perfmon counters
  • You can click on the perfmon's graphics and you will be taken to the profiler event which happened at that time. 
  • You can right-click on one of the counters in the list and you can select "Go to max value" or "Go to min value"
  • You can review the t-sql in the bottom window

 

8. Don't forget that the world IS what you make out of it! It is up to your imagination what set of counters you will gather as well as what events and columns. Just make sure you use a server side trace and keep in mind that there is a way to gather perfmon counters remotely as well. (This is a topic for another article.)Think about the performance of your own performance measurements. Do not bring the system down, just because you wanted to know what is already bringing the system down.

 


Posted 7/11/2009 6:00 PM by Feodor Georgiev
Copyright SQL Server Nation 2010
Powered by Community Server (Non-Commercial Edition), by Telligent Systems