<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SQL Articles &#187; Performance</title>
	<atom:link href="http://www.sqldba.co.nz/blog/?feed=rss2&#038;cat=12" rel="self" type="application/rss+xml" />
	<link>http://www.sqldba.co.nz/blog</link>
	<description></description>
	<lastBuildDate>Thu, 27 Jul 2017 19:31:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.2</generator>
	<item>
		<title>Disk allocation unit size</title>
		<link>http://www.sqldba.co.nz/blog/?p=170</link>
		<comments>http://www.sqldba.co.nz/blog/?p=170#comments</comments>
		<pubDate>Wed, 24 Sep 2014 21:04:32 +0000</pubDate>
		<dc:creator><![CDATA[brentm]]></dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.sqldba.co.nz/blog/?p=170</guid>
		<description><![CDATA[How to determine what allocation unit size was selected when a disk was formatted? If a disk was formatted incorrectly i.e. a SQL Server data volume,  but you want to check what allocation unit size was selected  when the disk &#8230; <a href="http://www.sqldba.co.nz/blog/?p=170">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>How to determine what allocation unit size was selected when a disk was formatted?</p>
<p>If a disk was formatted incorrectly i.e. a SQL Server data volume,  but you want to check what allocation unit size was selected  when the disk was formatted, use this&#8230;</p>
<p>From a CMD window, type FSUTIL FSINFO NTFSINFO &lt;drive letter:&gt;</p>
<p>e.g . FSUTIL FSINFO NTFSINFO D:</p>
<p>and look at the line: Bytes Per Cluster</p>
<p>The accepted rule for all SQL Server drives is 64K which reads as 65536 bytes</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqldba.co.nz/blog/?feed=rss2&#038;p=170</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scaling MDW</title>
		<link>http://www.sqldba.co.nz/blog/?p=72</link>
		<comments>http://www.sqldba.co.nz/blog/?p=72#comments</comments>
		<pubDate>Sat, 01 Dec 2012 21:59:24 +0000</pubDate>
		<dc:creator><![CDATA[brentm]]></dc:creator>
				<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://www.sqldba.co.nz/blog/?p=72</guid>
		<description><![CDATA[SQL Server 2008 introduced the MDW &#8211; a Management Data Warehouse. The MDW is a data warehouse for storing performance data about your SQL servers. It is best configured using a centrally located database &#8211; in the environment I work &#8230; <a href="http://www.sqldba.co.nz/blog/?p=72">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>SQL Server 2008 introduced the MDW &#8211; a Management Data Warehouse. The MDW is a data warehouse for storing performance data about your SQL servers. It is best configured using a centrally located database &#8211; in the environment I work in we use our CMS (Central Management Server) as our MDW. The initial setup is performed on your MDW server. You only have 1 choice for creating a MDW database so do it on your CMS. If you go to create your MDW database on the server you want to monitor it will only let you choose your local server. Instead on the monitored server you choose the Data Collector option.</p>
<p>If you are monitoring for deadlocks on your server when you setup the Data Collector, the default schedule for the upload jobs is to upload both jobs at the same 15 min interval. This causes deadlocks. It is easily fixed by staggering the schedules to 1 min apart.</p>
<p>I would recommend a separate MDW database (on your same CMS) for each instance you monitor. The reason for this is that there is a purge job created as part of the MDW setup. If you have 50 servers reporting to the same database then it is going to be extremely difficult to complete the purge in a timely manner each day and your database will grow out of control.</p>
<p>Therefore, using the <em>instmdw.sql</em> script located in:</p>
<p><em>C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Install </em></p>
<p>Run this script each time for each MDW database you create. Just make small customisations for the names of data files and the DB name. You can name the database anything you like as you reference this DB in the Data Collector setup. I use MDW_ with a suffix of the servername in our environment.</p>
<p>(to be continued)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqldba.co.nz/blog/?feed=rss2&#038;p=72</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Capturing Timeouts</title>
		<link>http://www.sqldba.co.nz/blog/?p=19</link>
		<comments>http://www.sqldba.co.nz/blog/?p=19#comments</comments>
		<pubDate>Sat, 25 Feb 2012 06:29:42 +0000</pubDate>
		<dc:creator><![CDATA[brentm]]></dc:creator>
				<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://www.sqldba.co.nz/blog/?p=19</guid>
		<description><![CDATA[The only way to capture timeouts is via SQL Trace &#8211; you need to know what was running/executing at the time of the timeout and SQL Trace is the tool to capture this. Do not confuse SQL Trace with SQL &#8230; <a href="http://www.sqldba.co.nz/blog/?p=19">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The only way to capture timeouts is via SQL Trace &#8211; you need to know what was running/executing at the time of the timeout and SQL Trace is the tool to capture this. Do not confuse SQL Trace with SQL Profiler &#8211; SQL Trace is the collection of stored procedures that are used by profiler for capturing events. SQL Profiler is a Client Side Trace &#8211; SQL Trace is a Server Side Trace. Never, ever, run an extended duration trace using SQL Profiler. Most modern servers will handle it but for a busy server it can be enough to cause a blue screen and a server restart. Doing this is what I call &#8220;DBA&#8217;s behaving badly!&#8221;</p>
<p>Setup a server-side trace by using SQL Profiler starting with a blank template and add the following items&#8230;</p>
<p>Errors and Warnings:</p>
<p>*Attention &#8211; this is the actual timeout event. This only tells you a timeout has occurred. You need the following and associate this event with what was running when the timeout occurred.</p>
<p>Stored Procedures:<br />
*RPC:Starting<br />
*SP:StmtStarting  </p>
<p>TSQL:<br />
*SQL:BatchStarting<br />
*SQL:StmtStarting  </p>
<p>Normally we would use the completed objects but remember with a timeout they don&#8217;t complete so we want the starting objects. If you want to filter the trace for a particular database then add this in now.  Click Run and then Stop the trace. Go Export &gt; Script Trace Definition and save the script to a file. Using SSMS, open the script you just created and connect to the server concerned.  Edit the parameters for @maxfilesize and the sp_trace_create command. I would use the file rollover option to keep a predetermined number of files that you can overwrite on a daily basis without the files getting too large and also consuming all your disk space.  Once running, it is possible to query the live trace file by using one of the built-in SQL functions&#8230; fn_trace_gettable()<br />
You pass in the filename and then the number of files to read, or DEFAULT to read all files.  e.g.  SELECT * FROM fn_trace_gettable(&#8216;D:\MSSQL\Trace\MyTraceFile.trc&#8217;, DEFAULT) </p>
<p>The EventID for a timeout is 16 &#8211; this can be found by querying sys.trace_events  </p>
<p>After the trace has been running a while, run a query to see if there have been any timeouts. For example&#8230; </p>
<p><code>SELECT *<br />
FROM fn_trace_gettable('D:\MSSQL\Trace\MyTraceFile.trc', DEFAULT)<br />
WHERE EventClass = 16</code></p>
<p>if you get a result set back, note the times and correlate that with a particular file range so that the can query just that file and run something like the following&#8230;<br />
<code>SELECT b.*  FROM<br />
FN_TRACE_GETTABLE('E:\MSSQL\TimeoutTrace_30.trc', 1) AS a<br />
INNER JOIN FN_TRACE_GETTABLE('E:\MSSQL\TimeoutTrace_30.trc', 1) AS b ON a.SPID = b.SPID<br />
WHERE a.EventClass = 16<br />
AND b.StartTime &gt; DATEADD(ss, -30, a.StartTime)<br />
AND b.StartTime &lt;= a.StartTime  </code></p>
<p>What is happening here is we are performing a self join on one of the trace files. In the first result set is the Attention event (16) and joining on the SPID of that event to the same file getting all the events in the last 30 seconds on the same SPID. This should reveal what command was running when the timeout occurred. You can use this information to diagnose further what the problem is but at least we now what was running at the time <img src="http://www.sqldba.co.nz/blog/wp-includes/images/smilies/simple-smile.png" alt=":-)" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sqldba.co.nz/blog/?feed=rss2&#038;p=19</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
