Simple Talk 21St Feb 2011]
Total Page:16
File Type:pdf, Size:1020Kb
Homepage Opportunity Nokia's [Thu, 17 Feb 00:00] The editor finds hope in Microsoft's alliance with Nokia. These are two companies that need each other's help in the Smartphone market, and the result could surprise the industry.... Correlating SQL Server Profiler with Performance Monitor [Wed, 16 Feb 00:00] Both Performance Monitor and SQL Server Profiler provide valuable information about your server. However, if you combine the data from the two sources, then this correlated information can help find some of the subtler bugs. Brad explains how. SQL Scripts Manager with PowerShell [Thu, 17 Feb 00:00] SQL Scripts Manager was released as a Christmas present to Simple-Talk subscribers. William Brewer then wrote an appreciation of the tool. Now, he reveals a secret:: It also runs PowerShell scripts, and hence, SMO. He has the scripts to prove it, though hopefully, you'll soon be running your own PowerShell from SQL Scripts Manager. What Counts for a DBA: Skill [Tue, 15 Feb 00:00] “Practice makes perfect:” right? Well, not exactly. Different types of programming require different skill sets and you as a programmer must recognize the difference between the procedural languages and SQL, and treat them differently. Skill comes from practicing doing things the right way and making “right” a habit. Look-up Tables in SQL [Tue, 01 Feb 00:00] Lookup tables can be a force for good in a relational database. Whereas the 'One True Lookup Table' remains a classic of bad database design, an auxiliary table that holds static data, and is used to lookup values, still has powerful magic. Joe Celko explains.... The Presentation Isn't Over Until It's Over [Mon, 14 Feb 00:00] Phil Factor was challenged to blog about his best and worst presentations. The worst was obviously the one he has already recounted when a realistic toy pistol rolled out accidentally from his briefcase. This presentation, on the other hand....... Raw Materials: Dinner Out [Wed, 16 Feb 00:00] Derek sees all, knows all, won't say how. Partitioning Your Code Base through .NET Assemblies and Visual Studio Projects [Thu, 10 Feb 00:00] Should every Visual Studio project really be in its own assembly? And what does 'Copy Local=True' really mean? Patrick Smacchia is no stranger to large .NET projects,is well placed to lay a few myths to rest, and gives some advice that promises up to a tenfold increase in speed of compilation. Web Testing with Selenium Sushi: A Practical Guide and Toolset [Wed, 09 Feb 00:00] How does one test the user-interface of a web application? Too often, the answer seems to be 'clumsily, slowly, and not very well'. The technology of automated, repeatable, testing of websites is still developing, but it exists; and Michael Sorens is here to describe an even better approach based on Selenium Hitting the Ground Running with Parallel Extensions in .NET 4.0 [Tue, 01 Feb 00:00] With the arrival of Parallel Extensions in .NET 4.0, the concurrent programming powers traditional reserved for the most elite of developers are now available to all of us. With multi-core processors increasingly becoming the norm, this is good news, and Jeremy Jarrell gives us the essential knowledge we'll need to get started. | Next | Section Menu | Main Menu | Inside the tent.... Occasional Editorial announcements. Opportunity Nokia's Published Thursday, February 17, 2011 3:25 PM Nokia’s alliance with Microsoft is likely to be good news for anyone using Microsoft technologies, and particularly for .NET developers. Before the announcement, the future wasn’t looking so bright for the ‘mobile’ version of Windows, Windows Phone. Microsoft currently has only 3.1% of the Smartphone market, even though it has been involved in it for longer than its main rivals. Windows Phone has now got the basics right, but that is hardly sufficient by itself to change its predicament significantly. With Nokia's help, it is possible. Despite the promise of multi-tasking for third party apps, integration with Microsoft platforms such as Xbox and Office, direct integration of Twitter support, and the introduction of IE 9 “later this year”, there have been frustratingly few signs of urgency on Microsoft’s part in improving the Windows Phone product. Until this happens, there seems little prospect of reward for third-party developers brave enough to support the platform with applications. This is puzzling when one sees how well SQL Server and Microsoft’s other server technologies have thrived in recent years, under good leadership from a management that understands the technology. The same just hasn’t been true for some of the consumer products. In consequence, iPads and Android tablets have already exposed diehard Windows users, for the first time, to an alternative GUI for consumer Tablet PCs, and the comparisons aren’t always in Windows’ favour. Nokia’s problem is obvious: Android’s meteoric rise. Android now has 33% of the worldwide market for smartphones, while the market share of Nokia’s Symbian has dropped from 44% to 31%. As details of the agreement emerge, it would seem that Nokia will bring a great deal of expertise, such as imaging and Nokia Maps, to Windows Phone that should make it more competitive. It is wrong to assume that Nokia’s decline will continue: the shock of Android’s sudden rise could be enough to sting them back to their previous form, and they have Microsoft’s huge resources and marketing clout to help them. For the sake of the whole Windows stack, I really hope the alliance succeeds. by Andrew Clarke | Section Menu | Main Menu | Correlating SQL Server Profiler with Performance Monitor 16 February 2011 by Brad McGehee Both Performance Monitor and SQL Server Profiler provide valuable information about your server. However, if you combine the data from the two sources, then this correlated information can help find some of the subtler bugs. Brad explains how. n the past, when watching the % Processor Time counter in Performance Monitor on my live production SQL Servers, I would occasionally see Isudden spikes in CPU utilization, to 50, 70 or even 80%. These spikes might last several minutes or more, then disappear. In some extreme cases I would see spikes that lasted 30, or even 60 minutes. I always wanted to know which SQL Server activity was causing the spike, but the problem was that I had no way of correlating a specific statement running in SQL Server to a specific resource usage spike. With SQL Server 2005 Profiler, I now have the tools to identify the causes of such spikes. I can import Performance Monitor log data and compare it directly with Profiler activity. If I see a spike in CPU utilization, I can identify which statement or statements were running at the same time, and diagnose potential problems. In this article, I will describe how to perform a correlation analysis using Profiler and Performance Monitor, covering: How to collect Profiler data for correlation analysis How to collect Performance Monitor data for correlation analysis How to capture Profiler traces and Performance Monitor logs How to correlate SQL Server 2005 Profiler data with Performance Monitor data How to analyze correlated data I assume you have a basic working knowledge of Performance Monitor (sometimes called System Monitor) as well as Profiler, in order to focus on how to use the two tools together. If you need further information on the basics of using Performance Monitor, check out Books Online. How to Collect Profiler Data for Correlation Analysis While it is possible to correlate most Profiler events to most Performance Monitor counters, the area of greatest correlation is between Profiler Transact-SQL events and Performance Monitor counters that indicate resource bottlenecks. This is where I focus my efforts, and the following sections describe how I collect Profiler data for correlation with Performance Monitor. As always, feel free to modify my suggestions to suit your own needs. The key, as always when using Profiler, is to capture only those events and data columns you really need in order to minimize the workload on your production server when the trace is running. Events and Data Columns My favorite Profiler template, when correlating Profiler trace data with Performance Monitor counter data, is the one I outlined in How to Identify Slow Running Queries. This template collects data on the following events: RPC:Completed SP:StmtCompleted SQL:BatchStarting SQL:BatchCompleted Showplan XML In addition, I include these data columns: Duration ObjectName TextData CPU Reads Writes IntegerData DatabaseName ApplicationName StartTime EndTime SPID LoginName EventSequence BinaryData Note that in order to perform an accurate correlation between Profiler and Performance Monitor data, you need to capture both the StartTime and EndTime data columns as part of your trace. Filters The only filter I create is based on Duration, because I want to focus my efforts on those SQL Statements that are causing the most problems. Selecting the ideal Duration for the filter is not always easy. Generally, I might initially capture only those events that are longer than 1000 milliseconds in duration. If I find that there are just too many events to easily work with, I might "raise the bar" to 5000 or 10000 milliseconds. You will need to experiment with different durations to see what works best for you. In the example for this article, I use 1000 milliseconds. I don't filter on DatabaseName, or any other data column, because I want to see every statement for the entire SQL Server instance. Performance Monitor counters measure the load on an instance as a whole, not just the load on a single database.