<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>In Recovery...</title>
    <description>Paul S. Randal on SQL Server</description>
    <link>http://www.sqlskills.com/BLOGS/PAUL/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.5.0</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://www.sqlskills.com/BLOGS/PAUL/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.sqlskills.com/</blogChannel:blink>
    <dc:creator>Paul S. Randal</dc:creator>
    <dc:title>In Recovery...</dc:title>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/PaulSRandal" /><feedburner:info uri="paulsrandal" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Script: open transactions with text and plans</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Here&amp;#39;s a little script I knocked up this afternoon to tell me who has open transactions on the server - not just the single oldest active transaction that &lt;font face="courier new,courier"&gt;DBCC OPENTRAN&lt;/font&gt; returns.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;It gives back:&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;session ID&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;transaction begin time&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;how many log records have been generated by the transaction&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;how much log space has been taken up by those log records&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;how much log space has been reserved in case the transaction rolls back&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;the last T-SQL that was executed in the context of the transaction&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;the last query plan that was executed (only for currently executing plans)&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;It&amp;#39;s ordered by the transaction begin time. I had some trouble using &lt;font face="courier new,courier"&gt;CROSS APPLY&lt;/font&gt; with the &lt;font face="courier new,courier"&gt;sys.dm_exec_query_plan&lt;/font&gt; DMV - if the plan isn&amp;#39;t available, it blows out the entire result-set for that transaction. After messing around for ten minutes I discovered the joys of the &lt;font face="courier new,courier"&gt;OUTER APPLY&lt;/font&gt; operator - which is the same as &lt;font face="courier new,courier"&gt;CROSS APPLY&lt;/font&gt; but allows NULL values from the function being cross-applied.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Also thanks to fellow MVP Aaron Bertrand (&lt;a href="http://twitter.com/AaronBertrand"&gt;twitter&lt;/a&gt;|&lt;a href="http://sqlblog.com/blogs/aaron_bertrand/default.aspx"&gt;blog&lt;/a&gt;) for pointing out a mistake in the way I was calling &lt;font face="courier new,courier"&gt;sys.dm_exec_query_plan&lt;/font&gt;.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Here&amp;#39;s the script with some example output:&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;SELECT s_tst.[session_id],&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; s_es.[login_name] AS [Login Name],&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; S_tdt.[database_transaction_begin_time] AS [Begin Time],&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; s_tdt.[database_transaction_log_record_count] AS [Log Records],&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;s_tdt.[database_transaction_log_bytes_used] AS [Log Bytes],&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;s_tdt.[database_transaction_log_bytes_reserved] AS [Log Reserved],&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;s_est.[text] AS [Last T-SQL Text],&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;s_eqp.[query_plan] AS [Last Query Plan]&lt;br /&gt;
	FROM sys.dm_tran_database_transactions s_tdt&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;JOIN sys.dm_tran_session_transactions s_tst&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON s_tst.[transaction_id] = s_tdt.[transaction_id]&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; JOIN sys.[dm_exec_sessions] s_es&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON s_es.[session_id] = s_tst.[session_id]&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; JOIN sys.dm_exec_connections s_ec&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON s_ec.[session_id] = s_tst.[session_id]&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; LEFT OUTER JOIN sys.dm_exec_requests s_er&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON s_er.[session_id] = s_tst.[session_id]&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; CROSS APPLY sys.dm_exec_sql_text (s_ec.[most_recent_sql_handle]) AS s_est&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; OUTER APPLY sys.dm_exec_query_plan (s_er.[plan_handle]) AS s_eqp&lt;br /&gt;
	ORDER BY [Begin Time] ASC;&lt;br /&gt;
	GO&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;session_id Login Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Begin Time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log Records Log Bytes Log Reserved Last T-SQL Text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last Query Plan&lt;br /&gt;
	---------- ----------------- ----------------------- ----------- --------- ------------ ------------------------------------ ---------------&lt;br /&gt;
	54&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROADRUNNERPR\paul 2010-02-01 15:28:48.560 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 236&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8550&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin tran insert into t1 values (1) NULL&lt;br /&gt;
	55&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROADRUNNERPR\paul 2010-02-01 16:38:18.373 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 356&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8852&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert into t1 values (3)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL&lt;/font&gt;&lt;/font&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;br /&gt;
	&lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/9Mjkb4sI23o" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/9Mjkb4sI23o/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Script-open-transactions-with-text-and-plans.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=06d7d25b-025b-4b9e-9c13-0129a0faeb9e</guid>
      <pubDate>Mon, 01 Feb 2010 16:37:00 -0800</pubDate>
      <category>Example Scripts</category>
      <category>Transaction Log</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=06d7d25b-025b-4b9e-9c13-0129a0faeb9e</pingback:target>
      <slash:comments>14</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=06d7d25b-025b-4b9e-9c13-0129a0faeb9e</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Script-open-transactions-with-text-and-plans.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=06d7d25b-025b-4b9e-9c13-0129a0faeb9e</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=06d7d25b-025b-4b9e-9c13-0129a0faeb9e</feedburner:origLink></item>
    <item>
      <title>Benchmarking: 1-TB table population (part 2: optimizing log block IO size and how log IO works)</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;(For the hardware&amp;nbsp;setup I&amp;#39;m using, see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-hardware-setup.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;. For the baseline performance measurements for this benchmark, see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-1).aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;.) &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;In my &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-1).aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;previous post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; in the series, I described the benchmark I&amp;#39;m optimizing - populating a 1-TB clustered index as fast as possible using default values. I proved to you that I had an IO bottleneck because the IOs to the data file (from checkpoints) and the transaction log file (from transactions committing) were causing contention. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Several people commented that I might have mis-configured the iSCSI IO subsystem - so first off I want to look at that. Fellow MVP Denny Cherry (&lt;/font&gt;&lt;a href="http://twitter.com/mrdenny"&gt;&lt;font face="verdana,geneva" size="2"&gt;twitter&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;|&lt;/font&gt;&lt;a href="http://itknowledgeexchange.techtarget.com/sql-server/"&gt;&lt;font face="verdana,geneva" size="2"&gt;blog&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;), who knows a lot more than me about IO subsystems, volunteered to discuss my iSCSI setup with me to make sure I hadn&amp;#39;t goofed anywhere (many thanks Denny!). It seems like I haven&amp;#39;t. I&amp;#39;m using a single iSCSI array right now, with a single NIC on the server&amp;nbsp;dedicated to the iSCSI traffic - once I move to multiple volumes, I&amp;#39;ll add in more NICs. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Looking at Task Manager in the middle of a 6-hour test run to see the network utilization through the NIC shows that it&amp;#39;s not saturated, as shown below. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f1%2fiSCSINIC.jpg" alt="" width="499" height="127" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I ran the DELL smcli utility for two hours during the most recent test to see what peak throughput I&amp;#39;m getting, using the following command: &lt;/font&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;smcli -n Middle_MD3000 -c &amp;quot;set session performanceMonitorInterval=5 performanceMonitorIterations=1440;save storageArray performanceStats file=\&amp;quot;c:\\MiddlePerfStats.csv\&amp;quot;;&amp;quot;&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I saw around 101MBytes/sec. and earlier when testing the smcli settings I&amp;#39;d seen 106MBytes/sec. I&amp;#39;m sure once I remove some of the contention that this will get better. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;On to the test! &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The first thing I wanted to try was optimizing my use of the transaction log - i.e. doing as few and as large IOs as possible to the log. My hypothesis is that by changing the batch size from one to, say, 10 or 100 SQL Server can make more efficient use of the log. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I changed my T-SQL script to take a batch size parameter and use explicit transactions inserting &amp;lt;batch-size&amp;gt; records. Everything else remained the same as the baseline. I picked 128 concurrent threads as my test point. In the baseline, the 128-thread insert test took 8 hours 8 minutes 27 seconds to complete (29307 seconds). My simple T-SQL code changed to (with &lt;font face="courier new,courier"&gt;$(rows)&lt;/font&gt; and &lt;font face="courier new,courier"&gt;$(batch)&lt;/font&gt; being SQLCMD parameters to the script):&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;DECLARE @counter BIGINT;&lt;br /&gt;
	DECLARE @inner&amp;nbsp;&amp;nbsp; SMALLINT;&lt;br /&gt;
	DECLARE @start&amp;nbsp;&amp;nbsp; DATETIME;&lt;br /&gt;
	DECLARE @end&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATETIME;&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;SELECT @counter = 0;&lt;br /&gt;
	SELECT @start = GETDATE ();&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;WHILE (@counter &amp;lt; $(rows))&lt;br /&gt;
	BEGIN&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; SELECT @inner = 0;&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; BEGIN TRAN;&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; WHILE (@inner &amp;lt; $(batch))&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; BEGIN&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT INTO MyBigTable DEFAULT VALUES;&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT @inner = @inner + 1;&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; END&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; COMMIT TRAN;&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; SELECT @counter = @counter + $(batch);&lt;br /&gt;
	END;&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;SELECT @end = GETDATE ();&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;font face="courier new,courier"&gt;INSERT INTO msdb.dbo.Results VALUES (CONVERT (INTEGER, DATEDIFF (second, @start, @end)));&lt;br /&gt;
	GO&lt;/font&gt;&lt;br /&gt;
	&lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Below are the results for 128 threads with batch sizes varying from 10 to 10000: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f1%2f2ElapsedTime.JPG" alt="" width="487" height="275" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Increasing the batch size from 1 record to 10 records caused the elapsed time to drop from 29307 seconds to 21167 seconds - a 28% improvement! However, increasing the batch size further didn&amp;#39;t improve things any more. Hmmm.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Next I tried different numbers of concurrent connections with a batch size of ten to see if the improvement was universal: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f1%2f2Batch10ConnVar.jpg" alt="" width="486" height="296" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;So moving from&amp;nbsp;a single-record batch to a ten record batch has the same dramatic effect on performance for varying numbers of connections. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;What&amp;#39;s going on? &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The answer&amp;nbsp;involves some deep internals of the transaction log structure and IO behavior. The transaction log is split up internally into sections called virtual log files (VLFs for short). These VLFs are used to manage which parts of the log can be overwritten with new log records. If this is all unfamiliar, go read my TechNet Magazine article on &lt;/font&gt;&lt;a href="http://technet.microsoft.com/en-us/magazine/2009.02.logging.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;Understanding Logging and Recovery in SQL Server&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; which explains about the log in more detail and about transactions, otherwise what&amp;#39;s coming next may not make much sense. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Whenever a transaction commits, all the transaction log records up to and including the &lt;font face="courier new,courier"&gt;LOP_COMMIT_XACT&lt;/font&gt; log record for that transaction (including log records from other transactions that are inter-mingled with those from the one that just committed) must be written out to disk, so the transaction is durable (called write-ahead logging). But it&amp;#39;s not individual log records that are written to disk, the unit of IO for the transaction log is a log block. VLFs are split internally into dynamically sized log blocks, ranging from 4KB to 60KB in 512-byte increments, as needed. There are algorithms to figure out how big log blocks should be based on what log records are being flushed out. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;With the single record batch, the amount of log generated in the transaction totals 4952 bytes. You can find this by doing something like: &lt;/font&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;CHECKPOINT;&amp;nbsp; -- to force the log in the SIMPLE recovery model to clear&lt;br /&gt;
	GO &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;INSERT INTO MyBigTable DEFAULT VALUES;&lt;br /&gt;
	GO &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;SELECT * FROM fn_dblog (NULL, NULL); -- show me all active log&lt;br /&gt;
	GO&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Then add&amp;nbsp;up the values in the &lt;font face="courier new,courier"&gt;Log Record Length&lt;/font&gt; column for all records from the first &lt;font face="courier new,courier"&gt;LOP_BEGIN_XACT&lt;/font&gt; log record to the &lt;font face="courier new,courier"&gt;LOP_COMMIT_XACT&lt;/font&gt; with the matching &lt;font face="courier new,courier"&gt;Transaction ID&lt;/font&gt;. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Anyway, a single-record transaction generates 4952 bytes of transaction log, which will be flushed out in our case in a log block that&amp;#39;s 5120 bytes (the nearest multiple of 512 above 4952), with a bunch of zero-padding at the end. For ten single-record transactions, that&amp;#39;s 10 small IOs. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The ten-record transaction generates 48688 bytes of transaction log and will be flushed out in a log block that&amp;#39;s 49152 bytes (the nearest multiple of 512 above 48688). This is clearly more efficient than 10 smaller IOs and is why changing to batches makes things go faster. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;A 100-record transaction generates 489628 bytes of transaction log, which is clearly more than the 60KB log-block maximum, so it actually covers multiple log blocks (varying from 14-16 in my tests - I don&amp;#39;t remember the exact algorithms). You can see the log block changing when the middle number in the &lt;font face="courier new,courier"&gt;Current LSN&lt;/font&gt; column of the &lt;font face="courier new,courier"&gt;fn_dblog&lt;/font&gt; output increases. It looks like it&amp;#39;s jumping up, and it is - this is the offset of the log block within the current VLF divided by 512. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Because the 100-record transaction is split into multiple log blocks, there&amp;#39;s no real IO gain during log flushes over the 10-record transaction - which is illustrated by the results I saw. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Now, even with this speed increase from the increased batch size, the average-disk-write-queue-length is still anywhere from 20-40 when running the 128-connection test, so there&amp;#39;s still a significant bottleneck there. In fact, the transaction log grew significantly still during these tests (up to 23GB in one case) - for an explanation of this phenomenon, see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Interesting-case-of-watching-log-file-growth-during-a-perf-test.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;Interesting case of watching log file growth during a perf test&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;.&amp;nbsp;I picked up some wait stats queries from fellow-MVP Glenn Berry (&lt;/font&gt;&lt;a href="http://twitter.com/GlennAlanBerry"&gt;&lt;font face="verdana,geneva" size="2"&gt;twitter&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;|&lt;/font&gt;&lt;a href="http://glennberrysqlperformance.spaces.live.com/blog/"&gt;&lt;font face="verdana,geneva" size="2"&gt;blog&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;) to run while the tests were running.&amp;nbsp;I&amp;#39;m&amp;nbsp;using his as they&amp;#39;re published and anyone can download and use them (see &lt;/font&gt;&lt;a href="http://glennberrysqlperformance.spaces.live.com/blog/cns!45041418ECCAA960!2991.entry"&gt;&lt;font face="verdana,geneva" size="2"&gt;his blog post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; for the queries, and &lt;/font&gt;&lt;a href="http://blogs.msdn.com/psssql/archive/2009/11/03/the-sql-server-wait-type-repository.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;Bob Ward&amp;#39;s CSS blog post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; that&amp;#39;s starting to document the wait types). &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;His queries tell me that with the 10-record per batch and 128-connections: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Average write-stall to the data file is 37ms&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Average write-stall to the log file is 18ms&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Top wait types are &lt;font face="courier new,courier"&gt;PAGELATCH_EX&lt;/font&gt; (55% of all waits), &lt;font face="courier new,courier"&gt;PAGELATCH_SH&lt;/font&gt; (28% of all waits), and &lt;font face="courier new,courier"&gt;WRITELOG&lt;/font&gt; (14% of all waits)&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The first two waits are the Storage Engine waiting for the buffer pool to kick out dirty pages so that buffers can be used to hold newly created pages, and the&amp;nbsp;third is the log manager waiting for log block flushes to disk to complete. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Clearly IO IO IO.&amp;nbsp; Let&amp;#39;s look at a a perfmon capture during the 10-records per batch test with 128 connections: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f1%2f2128batch10perfmon.jpg" alt="" width="736" height="509" /&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Let&amp;#39;s go through each counter (top to bottom in the list in the image) and explain what&amp;#39;s going on. I deliberately picked this time-slice, as it really simply shows the effect of contention:&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Pages Allocated/sec&lt;/font&gt;: this is the light blue line and is the Access Methods part of the Storage Engine (the dev team I used to run) creating new data and index pages for the clustered index we&amp;#39;re populating.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Checkpoint pages/sec&lt;/font&gt;: this is the pink line at the bottom left and bottom right of the capture. This is the buffer pool writing out dirty pages during a periodic checkpoint.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Avg. Disk sec/Write&lt;/font&gt;: this is the dark blue line that&amp;#39;s tracking just above the thick black line. It&amp;#39;s the amount of time in ms for a write to complete. You can see that it has a minimum around 12:51:00 and then varies wildly, hitting as high as 50+ms for a single write.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Avg. Disk Write Queue Length&lt;/font&gt;: this is the highlighted line in thick black. It also has a minimum around 12:51:00 and varies wildly the rest of the time.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Disk Write Bytes/sec&lt;/font&gt;: this is the dark green line at the top that shows the number of bytes being written to disk from all IO sources. Same story around 12:51:00.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Log Growths&lt;/font&gt;: A simple counter since the database was created/server started. It&amp;#39;s over 100 and off the chart.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Log Bytes Flushed/sec&lt;/font&gt;: this is the red, fairly constant line around 1/3 the way up and is log blocks being flushed to disk because of transaction commits or checkpoints.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Lazy writes/sec&lt;/font&gt;: this is the light green line at the bottom and is the buffer pool having to force data pages to be written to disk (along with all transaction log flushed up to the point of the last log record to change the page being written) to make space for images of newly created pages.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This time-slice is really cool in that it shows what happens when contention goes away. Just before 12:51:00, a checkpoint ends and the lazywriter has nothing to do - so the only IOs hitting the disks are those coming from the transaction log flushing out log blocks as transactions commit. You can see the&amp;nbsp;&lt;font face="courier new,courier"&gt;Avg.&amp;nbsp;Disk&amp;nbsp;Write Queue Length&lt;/font&gt;&amp;nbsp;drop down to 2-3, the&amp;nbsp;&lt;font face="courier new,courier"&gt;Avg. Disk sec/Write&lt;/font&gt;&amp;nbsp;drop to about 5ms, and most beautiful of all (look, I&amp;#39;m a big geek ok? :-), the &lt;font face="courier new,courier"&gt;Disk Write Bytes/sec&lt;/font&gt; (the green line) drops down to be exactly equal to the &lt;font face="courier new,courier"&gt;Log Bytes Flushed/sec&lt;/font&gt; - proving that it&amp;#39;s just log flushes hitting the disk. This is the no-contention case. It happens again for brief spell about 10 seconds later - the lazywriter most likely created a temporary surfeit of empty buffers. All the rest of the time, the lazywriter and checkpoints play havoc with the write throughput on the drives by causing contention.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;It&amp;#39;s clearly time to try some separation of files to relieve the contention - and that&amp;#39;s what I&amp;#39;ll cover in the next post in the series.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Hope you&amp;#39;re enjoying&amp;nbsp;the series&amp;nbsp;- these take a long time to write up!&lt;/font&gt; 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/FAP0XwEkE4Y" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/FAP0XwEkE4Y/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-2-optimizing-log-block-IO-size-and-how-log-IO-works).aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=6f2e3cfe-e037-4f25-873e-cc691632b717</guid>
      <pubDate>Wed, 27 Jan 2010 11:23:00 -0800</pubDate>
      <category>Benchmarking</category>
      <category>Performance</category>
      <category>Transaction Log</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=6f2e3cfe-e037-4f25-873e-cc691632b717</pingback:target>
      <slash:comments>24</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=6f2e3cfe-e037-4f25-873e-cc691632b717</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-2-optimizing-log-block-IO-size-and-how-log-IO-works).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=6f2e3cfe-e037-4f25-873e-cc691632b717</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=6f2e3cfe-e037-4f25-873e-cc691632b717</feedburner:origLink></item>
    <item>
      <title>DBCC CHECKFILEGROUP bug fixed in 2008 SP1 CU6</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Back in September I blogged about an old 2005 bug that prevented &lt;font face="courier new,courier"&gt;DBCC CHECKFILEGROUP&lt;/font&gt; checking the partitions of an object on the specified filegroup unless *all* partitions of the object are on the specified filegroup (not a smart way to set things up!). The bug was fixed ages ago in 2005 but has only just been fixed in 2008. The post which explains the bug in more detail is &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/DBCC-CHECKFILEGROUP-bug-on-SQL-Server-2008.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;DBCC CHECKFILEGROUP bug on SQL Server 2008&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;. This is an important feature to be able to split the consistency checks of a partitioned VLDB over a series of days - see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/CHECKDB-From-Every-Angle-Consistency-Checking-Options-for-a-VLDB.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;CHECKDB From Every Angle: Consistency Checking Options for a VLDB&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;for more details.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;SQL Server 2008 SP1 Cumulative Update 6 (which you can get &lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/977443"&gt;&lt;font face="verdana,geneva" size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;) has the bug fix for 2008 finally. The KB article which describes the bug is &lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/975991/"&gt;&lt;font face="verdana,geneva" size="2"&gt;975991&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;You&amp;#39;re all running regular consistency checks, right?&lt;/font&gt; 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/iNQ5_3L1MEc" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/iNQ5_3L1MEc/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/DBCC-CHECKFILEGROUP-bug-fixed-in-2008-SP1-CU6.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=2a1c2594-def3-4671-881d-1ab495d6d26a</guid>
      <pubDate>Mon, 25 Jan 2010 10:47:00 -0800</pubDate>
      <category>Bugfixes</category>
      <category>CHECKDB From Every Angle</category>
      <category>Partitioning</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=2a1c2594-def3-4671-881d-1ab495d6d26a</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=2a1c2594-def3-4671-881d-1ab495d6d26a</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/DBCC-CHECKFILEGROUP-bug-fixed-in-2008-SP1-CU6.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=2a1c2594-def3-4671-881d-1ab495d6d26a</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=2a1c2594-def3-4671-881d-1ab495d6d26a</feedburner:origLink></item>
    <item>
      <title>Benchmarking: 1-TB table population (part 1: the baseline)</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;(For the hardware&amp;nbsp;setup I&amp;#39;m using, see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-hardware-setup.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;.) &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;As part of my new &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/category/Benchmarking.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;benchmarking series&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; I first wanted to play around with different configurations of data files and backup files for a 1-TB database to see what kind of performance gains I can get invoking the parallelism possible when backing up and restoring the database. To do that I need a way to quickly populate a 1-TB database so that I can mess around with different numbers of files and so on. It doesn&amp;#39;t matter what the data in the database is, as backup doesn&amp;#39;t care - as long as there&amp;#39;s a&amp;nbsp;terabyte of it. Why a terabyte? It&amp;#39;s a nice round number, it&amp;#39;s a common enough database size right now, and I have the storage to play around with it. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;But then my plans got derailed. In figuring out how to most quickly populate a 1-TB database, I realized that in itself would be an interesting benchmark to explore, so that&amp;#39;s what I&amp;#39;m doing first. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;My aim is to give you improvements you can use in real life. If you think this is going to be boring, skip down to the end of the post where I show a detailed perfmon and explain what&amp;#39;s going on in my overloaded IO subsystem, then come back up here :-)&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The baseline for this benchmark is contrived - I&amp;#39;m going to populate a 1-TB clustered index (so I can do other experiments with the index) as quickly as I can. The interesting part is that I&amp;#39;m starting with a brain-dead database layout, configuration, and method of populating the table, and then I&amp;#39;m going to alter&amp;nbsp;different things to see the effect on the system. The effects and gains will be the interesting part as it will expose parts of how SQL Server works which *WILL* be applicable to real-life situations and workloads - the whole point of me doing all of this is to show you improvements, why they work, and how they could be useful to you. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;When doing any kind of performance testing it&amp;#39;s *essential* to have a baseline with which to compare&amp;nbsp;- otherwise how do you know what effect a variation is having? This post describes my baseline setup, measurements, and limitations I start to notice. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;First let me describe the baseline setup: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Single data file and log file stored on the same volume, on an 8-drive RAID-10 array (each drive is a 300GB 15k SCIS drive), connected through iSCSI to the server &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Data file is created to be 1-TB, with instant file initialization enabled &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Log file is created to be 256MB &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Database is using the &lt;font face="courier new,courier"&gt;SIMPLE&lt;/font&gt; recovery model &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Yes, I&amp;#39;m deliberately putting the data and log on the same RAID array. I *want* to see some contention so I can prove to you how separation of data&amp;nbsp;and log can reduce contention&amp;nbsp;and improve performance sometimes. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Database and table creation script: &lt;/font&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;CREATE DATABASE BackupPerfTest ON&lt;br /&gt;
	(NAME = &amp;#39;BackupPerfTest_Data&amp;#39;,&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; FILENAME = &amp;#39;K:\BackupPerfTest.mdf&amp;#39;,&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; SIZE = 1TB,&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; FILEGROWTH = 1GB)&lt;br /&gt;
	LOG ON&lt;br /&gt;
	(NAME = &amp;#39;BackupPerfTest_Log&amp;#39;,&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; FILENAME = &amp;#39;K:\BackupPerfTest.ldf&amp;#39;,&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; SIZE = 256MB,&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; FILEGROWTH = 50MB);&lt;br /&gt;
	GO&lt;br /&gt;
	&lt;br /&gt;
	ALTER DATABASE BackupPerfTest SET RECOVERY SIMPLE;&lt;br /&gt;
	GO &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;USE BackupPerfTest;&lt;br /&gt;
	GO &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;CREATE TABLE MyBigTable (c1 BIGINT IDENTITY, c2 CHAR (4100) DEFAULT &amp;#39;a&amp;#39;);&lt;br /&gt;
	GO&lt;br /&gt;
	CREATE CLUSTERED INDEX MyBigTable_cl ON MyBigTable (c1);&lt;br /&gt;
	GO&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I figured the fastest way to fill the database is to have a single table with one row per page, and that having SQL Server create the large &lt;font face="courier new,courier"&gt;CHAR&lt;/font&gt; column inside itself, rather than me doing a &lt;font face="courier new,courier"&gt;REPLICATE&lt;/font&gt;, would be quickest. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;For the actual population of the table, I worked out that 134217728 table rows gives me a terabyte, with each row taking up a single 8KB page. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The baseline setup of the table population is: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Varying numbers of concurrent connections (16, 32, 64, 128, 256) to the server (8-way DELL PowerEdge 1950) &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Each connection runs a simple script that inserts 134217728 / number-of-connections rows into the table, and then logs the elapsed time into a results table &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Each insert is done as a single-statement implicit transaction (if I don&amp;#39;t do an explicit &lt;font face="courier new,courier"&gt;BEGIN TRAN&lt;/font&gt;/&lt;font face="courier new,courier"&gt;COMMIT TRAN&lt;/font&gt;, SQL Server does it for me)&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;A monitor connection pings the results table every 5 minutes checking to see if number-of-connections results are there, and sending me email if so &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Yes, I&amp;#39;m deliberately using this method to insert each row. Again, I want to be able to make improvements and see the effect of the changes.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Each connection will be running this script: &lt;/font&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;SET NOCOUNT ON;&lt;br /&gt;
	GO &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;DECLARE @counter BIGINT;&lt;br /&gt;
	DECLARE @start&amp;nbsp;&amp;nbsp; DATETIME;&lt;br /&gt;
	DECLARE @end&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATETIME; &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;SELECT @counter = 0;&lt;br /&gt;
	SELECT @start = GETDATE (); &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;WHILE (@counter &amp;lt; $(rows))&lt;br /&gt;
	BEGIN&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; INSERT INTO MyBigTable DEFAULT VALUES;&lt;br /&gt;
	&amp;nbsp;&amp;nbsp; SELECT @counter = @counter + 1;&lt;br /&gt;
	END; &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;SELECT @end = GETDATE (); &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;INSERT INTO msdb.dbo.Results VALUES (CONVERT (INTEGER, DATEDIFF (second, @start, @end)));&lt;br /&gt;
	GO&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This is run through SQLCMD, and the number of rows to insert is passed into the T-SQL script using: &lt;/font&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;sqlcmd -S(local)\SQLDev01 -dBackupPerfTest -i&amp;quot;C:\SQLskills\Populate1TBTest\PopulateTable.sql&amp;quot; -v rows=%1&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;%1 in the line above is passed from a master CMD that kicks off number-of-connections CMD windows, each of which just runs the SQLCMD line above. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;So - a simple setup. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Here&amp;#39;s a graph of the results: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f1%2fElapsedTimeImprovements.JPG" alt="" width="485" height="294" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The elapsed times for all connections to complete their work (as there could be up to an hour between the first and last to complete) were: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;16-way: 15 hours 25 minutes 5 seconds &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;32-way: 13 hours 50 minutes 18 seconds (11% faster) &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;64-way: 10 hours 12 minutes 48 seconds (27% faster) &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;128-way: 8 hours 8 minutes 27 seconds (20% faster) &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;256-way: 7 hours 24 minutes 21 seconds (9% faster) &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;More connections clearly&amp;nbsp;leads to&amp;nbsp;a faster runtime, but the improvements from doubling the number of threads clearly aren&amp;#39;t directly proportional to the number of threads. The biggest improvement was from 32 to 64 threads, and then the percentage gain started to tail off. Let&amp;#39;s look at the page allocations per second for each experiment too: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f1%2fPageAllocationsImprovements.JPG" alt="" width="486" height="294" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;As I&amp;#39;d expect, the pace at which pages are being allocated in the database increases with more threads and the percentage improvements line pretty much matches that of the elapsed time graph above. There&amp;#39;s a slight difference in the 128 and 256 gains here because the graph is show what the perf counter number was &lt;em&gt;after the experiment reached a steady state.&lt;/em&gt; I noticed that the log grew enormously for the last few tests, which caused the steady-state number to not be reached for a while. I&amp;#39;ve already blogged about that phenomenon&amp;nbsp;in &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Interesting-case-of-watching-log-file-growth-during-a-perf-test.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;Interesting case of watching log file growth during a perf test&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I also watched what was happening in perfmon to see if there were any obvious performance problems going on. Here&amp;#39;s a perfmon graph for the 64-way test once it reached steady-state and the log wasn&amp;#39;t growing: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f1%2f64wayperfmon.jpg" alt="" width="735" height="441" /&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Analysis:&amp;nbsp;&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;The black line is above 0 when a checkpoint is occuring.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;The green line represents how much data is being written to the K: volume, where the data and log file are. You can see there&amp;#39;s a constant amount of data being written all the time (transaction log records when the implicit transactions commit) with large spikes whenever a checkpoint occurs and causes the actual data pages to be written out.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;The&amp;nbsp;light blue&amp;nbsp;line is the pages allocated per second. You can see that it takes a major nose dive whenever a checkpoint occurs. I&amp;#39;m speculating that this is because of disk contention preventing the transaction log being written to disk (thus slowing down the transaction throughput) while the checkpoint is occuring and writing out data pages&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;The dark blue line at the bottom is the average disk seconds per write. You can see that it hovers around 4-5 milliseconds and spikes to 16-17 when a checkpoint occurs.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;The brown line in the middle is the average disk write queue length. It hovers around 18-19 and spikes to around 25 when a checkpoint occurs.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Observations:&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;This system is clearly bottlenecked in the I/O subsystem&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;There is a direct correlation between checkpoints occuring and: increased disk queue length, reduced transaction throughput&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This is what I would expect to see on a system with lots of updates where the log and data are on the same volume. Remember that I&amp;#39;ve got them on a fast RAID-10 array. This debunks the theory I&amp;#39;ve often heard that contention doesn&amp;#39;t matter on RAID arrays. Yes, it does. You can still max out the throughput capabalities of any IO subsystem - it just depends what you&amp;#39;re trying to do with it. Imagine if I had nonclustered indexes on this table too - more logging and more pages being allocated - much worse performance...&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;So now I&amp;#39;ve got my baseline and there are some obvious things I can try to improve things:&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Data and log file separation&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Varying number of data files&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Varying placement of data files (e.g. different RAID arrays)&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Manual checkpoints&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Pre-sizing the log&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Using explicit transactions with varying batch insert sizes&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Using -E to get larger allocations&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I&amp;#39;m not saying that all of these things are going to help, but over the next few weeks I&amp;#39;m going to try them all and report on the results. You&amp;#39;ll be able to clearly see the effect of changing these on my benchmark, running on production-quality hardware, rather than just taking people&amp;#39;s words for it.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I hope you&amp;#39;re going to find these benchmarks and experiments useful - I&amp;#39;ll be learning (hopefully) as I go along too.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Let me know if there&amp;#39;s anything else you&amp;#39;d like to see me try, and if you&amp;#39;re following along (I don&amp;#39;t want to spend all this time if no-one&amp;#39;s reading the series!)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Thanks!&lt;/font&gt; 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/_s3tFt2CNSo" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/_s3tFt2CNSo/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-1).aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=0b28d711-8fb5-498b-933f-011399f63951</guid>
      <pubDate>Thu, 21 Jan 2010 10:54:00 -0800</pubDate>
      <category>Benchmarking</category>
      <category>IO Subsystems</category>
      <category>Performance</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=0b28d711-8fb5-498b-933f-011399f63951</pingback:target>
      <slash:comments>27</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=0b28d711-8fb5-498b-933f-011399f63951</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-1).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=0b28d711-8fb5-498b-933f-011399f63951</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=0b28d711-8fb5-498b-933f-011399f63951</feedburner:origLink></item>
    <item>
      <title>Remote DB maintenance auditing promotion</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Okay, this post is describing some new services we provide (we are a consulting firm after all :-),&amp;nbsp;but there&amp;#39;s a promotion at the bottom where you can save $$$ on one of the new services. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;We&amp;#39;re starting to offer a set of standalone auditing services that we can perform remotely, greatly reducing the cost of having someone come on-site to evaluate your SQL Server environment. The new standalone audit services we are providing are: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Database maintenance and operations audit of your SQL Server environment &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Disaster recovery and high-availability audit of your SQL Server environment&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The remote audits take the form of us giving you some non-intrusive scripts to run on each server, plus a detailed questionnaire to fill in. We analyze the results and send you a list of recommendations, with supporting explanations and links to deeper information. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;As part of a regular remote consulting engagement, we&amp;#39;d also be engaging with the DBA team through web-meetings, phone calls, email conversations to undertake performance tuning, design work, and so on. However,&amp;nbsp;many people just want to buy a small, limited&amp;nbsp;block of time to run a quick audit and get the OK or a set of changes to implement to improve operations - this is where the standalone audits come in.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The standalone audit services we offer take a much shorter time (depending on environment size) than a regular consulting engagement, as they don&amp;#39;t involve web-meetings and in-depth interaction with the DBA team, so they&amp;#39;re a lot more cost-effective when on a tight budget.&amp;nbsp;Of course, we&amp;nbsp;also provide remote performance tuning, available in small blocks of time rather than an open-ended engagement, and the traditional &amp;#39;figure out all sorts of problems&amp;#39; consulting engagements.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;These audits are usually billed at our regular offsite consulting rate, but as an initial promotion &lt;strong&gt;I&amp;#39;ll perform a database maintenance audit for $500 to the first 10 new customers who&amp;nbsp;sign up&amp;nbsp;before the end of January&lt;/strong&gt;, limited to 4 hours of my time (a 50% saving over our regular rates). &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Shoot me an email (through the contact button at the top of the page) if you&amp;#39;re interested in any of these services and/or want to be one of the lucky few to take part in the promotion. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;We look forward to working with you!&lt;/font&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/FQjoyBh0YEw" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/FQjoyBh0YEw/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Remote-DB-maintenance-auditing-promotion.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=fc1b35c6-6860-476b-bcc5-1b48ca7b1ea1</guid>
      <pubDate>Tue, 19 Jan 2010 16:40:00 -0800</pubDate>
      <category>Auditing</category>
      <category>Consulting</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=fc1b35c6-6860-476b-bcc5-1b48ca7b1ea1</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=fc1b35c6-6860-476b-bcc5-1b48ca7b1ea1</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Remote-DB-maintenance-auditing-promotion.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=fc1b35c6-6860-476b-bcc5-1b48ca7b1ea1</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=fc1b35c6-6860-476b-bcc5-1b48ca7b1ea1</feedburner:origLink></item>
    <item>
      <title>Interesting case of watching log file growth during a perf test</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I&amp;#39;m running some performance tests on the &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-hardware-setup.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;hardware we have&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; (more details on the first of these tomorrow) and I was surprised to see some explosive transaction log growth while running in the SIMPLE recovery model with single row insert transactions!&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Without spoiling tomorrow&amp;#39;s thunder too much, I&amp;#39;ve got a setup with varying numbers of connections populating a 1TB table with default values, with the single data and log files on the same 8-drive RAID-10 array (again more details on why tomorrow). I was looking at perfmon while the test was running with 128 concurrent connections, and noticed some weird-looking behavior - basically what looked like a never-ending checkpoint occuring. So I dug in deeper and discovered the transaction log had grown over 7GB since the start of the test. Huh? &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I restarted the test from scratch, with a 1TB data file and a 256MB log and watched what happened in perfmon; here&amp;#39;s the screenshot of the first 90 seconds: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f1%2f128wayperfmon.jpg" alt="" width="743" height="512" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This is *so* interesting. The black line is the number of log growths, so you can see the log grows every time the line level goes up. The bright blue line is the number of pages being allocated per second to hold all the table rows my 128 connections are inserting. You can clearly see that every time there&amp;#39;s a log growth, the allocations take a nose-dive - because no transactions can commit while the new portion of the log is being zeroed (remember that instant file initialization does not apply to the log - see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Search-Engine-QA-24-Why-cant-the-transaction-log-use-instant-initialization.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this blog post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;). The green line (disk write bytes per second)&amp;nbsp;spikes when the log grows because of the zeroes being written out to the log file by SQL Server (remember that SQL Server does the zeroing).&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;But why is the log growing in the first place? I&amp;#39;m in the SIMPLE recovery model and doing single-row implicit transactions (yes, I&amp;#39;m deliberately doing this) so there shouldn&amp;#39;t be anything stopping the log from clearing during a checkpoint, right?&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Wrong. The log starts out small (256MB) so one of the thresholds for triggering a checkpoint gets hit pretty fast (70% of the log file is used). So a checkpoint occurs (you can see the checkpoints occuring when the pink line at the bottom of the perfmon screen is above zero), and starts writing out to the data file, which is on the same disk as the log (see&amp;nbsp;&lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/How-do-checkpoints-work.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;How do checkpoints work and what gets logged&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; for an explanation of checkpoint mechanics), but it can&amp;#39;t write fast enough (because of disk contention) to get to the log-clearing part before the log fills up completely and has to grow (because transactions are continuing at break-neck speed). So the log grows, and the insert transactions stop while the log is zeroed. And then the log starts to fill up again very quickly and another checkpoint is triggered, and so on and so on.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Eventually a steady state is reached where there&amp;#39;s enough free log space during a checkpoint that no new log is required for the concurrent transactions to commit. You might ask why the checkpoint is so slow in the first place? Because I deliberately put the data file on the same RAID array as the log file, and both are being steadily hammered with writes - classic disk contention. Even though the RAID array is RAID-10 with 8x300GB 15k SCSI drives, the average disk queue write length is over 20 most of the time during the 128-way test because I&amp;#39;m simply trying to do too much.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The point of my blog post? Just because you don&amp;#39;t have any of the classic causes of transaction log growth going on, doesn&amp;#39;t mean you&amp;#39;re going to be immune. In this case my (deliberate) poor physical layout of the database files and workload growth up to 128 concurrent connections caused the log to grow. What started out working when I was running 16 connections didn&amp;#39;t work any more at 128 (actually I went back and re-ran some of the earlier tests and even with only 64 connections, the log grew to over 1GB before reaching steady-state).&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Interesting eh?&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Tomorrow I&amp;#39;ll be continuing the perf/benchmarking series by creating my first benchmark and then tweaking the setup to see how I can improve performance (for instance with multiple data files, separation of log and data files - all the things I preach but have never *demonstrated*), but this behavior merited a post all on its own.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;/font&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/H03Tzoun5fA" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/H03Tzoun5fA/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Interesting-case-of-watching-log-file-growth-during-a-perf-test.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=7f0a020a-6177-4674-be22-a531969d9186</guid>
      <pubDate>Mon, 18 Jan 2010 11:56:00 -0800</pubDate>
      <category>Benchmarking</category>
      <category>Checkpoint</category>
      <category>Performance</category>
      <category>Transaction Log</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=7f0a020a-6177-4674-be22-a531969d9186</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=7f0a020a-6177-4674-be22-a531969d9186</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Interesting-case-of-watching-log-file-growth-during-a-perf-test.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=7f0a020a-6177-4674-be22-a531969d9186</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=7f0a020a-6177-4674-be22-a531969d9186</feedburner:origLink></item>
    <item>
      <title>New blog on SQLskills.com: Paul's Electronics</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;At the start of the year I decided to get seriously back into playing with electronics after a long haitus. I agonized about where to blog about all this stuff (as I like to blog a *lot*, as you all well know) and I initially thought it would be cool to have everything intermingled on this blog. Then I started to play and realized that I have a *ton* of stuff I want to blog about around electronics and microcontrollers - photos, videos, code - and that it would really interfere with the purpose of this blog - disseminating SQL Server info. Couple that with the fact that this blog is picked up by lots of SQL Server blog aggregators, and I started to worry that people would get a little miffed by *lots* of non-SQL stuff coming from this blog. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Soooo I decided to create a completely new blog on the site today, with a new &amp;#39;theme&amp;#39;. I now know lots about CSS style sheets, ASP.NET, IIS, and BlogEngine.Net - probably way more than I really wanted to. But I have a nice shiny new blog dedicated to my electronics adventures. I&amp;#39;ve deleted the two posts since 1/1/10 about electronics and re-posted on the new blog (sorry to the 3 people who&amp;#39;d commented!). There&amp;#39;s a link to the new blog at the top-left of this one - feel free to subscribe, drop in from time to time, or ignore it completely :-)&amp;nbsp;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;You can get to the new blog at &lt;/font&gt;&lt;a href="http://www.sqlskills.com/blogs/paulselec/"&gt;&lt;font face="verdana,geneva" size="2"&gt;Paul&amp;#39;s Electronics&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; (in homage to the name of the electronics kit my Dad made me when I was 10). &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Normal service will be resumed here very shortly... &lt;/font&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/y800akfs4G8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/y800akfs4G8/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/New-blog-on-SQLskillscom-Pauls-Electronics.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=f718940c-46a1-44ec-aa8e-2d496a102b67</guid>
      <pubDate>Sun, 17 Jan 2010 20:50:00 -0800</pubDate>
      <category>Personal</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=f718940c-46a1-44ec-aa8e-2d496a102b67</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=f718940c-46a1-44ec-aa8e-2d496a102b67</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/New-blog-on-SQLskillscom-Pauls-Electronics.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=f718940c-46a1-44ec-aa8e-2d496a102b67</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=f718940c-46a1-44ec-aa8e-2d496a102b67</feedburner:origLink></item>
    <item>
      <title>What three events brought you here?</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Yesterday I was discussing life-direction-changing-events with Kimberly and our great friend Libby and I thought it would be interesting to find out from people how their lives brought them to where they are today. I&amp;#39;m often tagged in these kinds of blog posts from other people, so today I&amp;#39;m going to start one of my own (I feel the power tingling through my veins!!! Er, ahem). &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I&amp;#39;ll go first. There are three very clear events/decisions in my life that brought me to where I am today. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;Event #1&lt;/strong&gt; is the single most important one, as it shaped the way I developed my intellectual interests forever. On my tenth birthday in 1982, my wonderful&amp;nbsp;Dad gave me an electronics kit and an electronics book. The book was Simple Electronics, a British Ladybird series book from 1979, aimed at helping kids build little electronics projects. Now that in itself wasn&amp;#39;t wonderful, but Dad actually made me the kit from scratch over a few weeks in his shed (think &amp;#39;shop&amp;#39; if you&amp;#39;re in the US), including a cool box to keep the book, my wooden circuit boards (with screws to hold the components in place), and all the components, sorted in little bags and boxes with labels on. I think this is the best present I&amp;#39;ve ever been given - thanks Dad!&lt;/font&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Pictures of the book and the box are below (with this blog post in the background - click for bigger images): &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.flickr.com/photos/15134271@N03/3553016151"&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;/font&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;a href="http://www.sqlskills.com/blogs/paul/content/binary/P1020722.jpg"&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f1%2fSmallP1020722.JPG" alt="" width="235" height="314" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; &lt;/font&gt;&lt;a href="http://www.sqlskills.com/blogs/paul/content/binary/P1020723.jpg"&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f1%2fSmallP1020723.JPG" alt="" width="314" height="235" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Sadly the book&amp;nbsp;isn&amp;#39;t the original one he gave me, but I bought one on Ebay a couple of years ago for posterity. The box, of course, is the original one that I still treasure. This kit changed my life completely - I became totally absorbed in electronics (see my recent blog posts &lt;a href="http://www.sqlskills.com/blogs/paulselec/post/Kit-building-Mod-Amp-Kits-guitar-reverb-pedal.aspx"&gt;here&lt;/a&gt; and &lt;a href="http://www.sqlskills.com/blogs/paulselec/post/Arduino-projects-LED-10-bar-array.aspx"&gt;here&lt;/a&gt; for the start of the revival), leading on to 8-bit computers, and my engineering degree in computer science and electronics from the University of Edinburgh.&amp;nbsp;This birthday present&amp;nbsp;put me on the course to being an engineer. But I almost didn&amp;#39;t go to college. That happened because of event #2. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;Event #2&lt;/strong&gt; was what stopped me joining the Royal Navy as a Weapons Electronics Officer. With my Dad having been in the Royal Navy as an engineer (he used to teach nuclear reactor theory and control electronics at the Navy&amp;#39;s engineering school - &lt;/font&gt;&lt;/font&gt;&lt;a href="http://www.royalnavy.mod.uk/operations-and-support/establishments/training-establishments/hms-sultan/"&gt;&lt;font face="verdana,geneva" size="2"&gt;H.M.S. Sultan&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;- smart guy - the person I look up to most in the world), our family life was entwined with the Navy and it&amp;#39;s way of life. I loved it and planned to follow my Dad&amp;#39;s footsteps. I was in the Navy Cadets at school and did all kinds of summer courses with the Navy. Then when I was 17, I spent a week on &lt;a href="http://en.wikipedia.org/wiki/HMS_Glasgow_(D88)"&gt;H.M.S. Glasgow&lt;/a&gt;, a Type-42 Destroyer that saw serious action in the 1982 &lt;a href="http://en.wikipedia.org/wiki/Falklands_war"&gt;Falklands War&lt;/a&gt;, sailing from Edinburgh, around the top of Scotland through the Pentland Firth and The Minch, down to Glasgow on the opposite coast.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Here&amp;#39;s a picture of H.M.S. Glasgow (click for a bigger image): &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;a href="http://www.defencetalk.com/pictures/data/188/medium/HMS_Glasgow_D88_01.jpg"&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;img src="http://www.defencetalk.com/pictures/data/188/medium/HMS_Glasgow_D88_01.jpg" alt="" width="314" height="235" /&gt;&lt;/font&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This *is* the original one, but sadly *isn&amp;#39;t* mine. Lot&amp;#39;s of scope for rampant megalomania with one of these to play with :-)&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;It was a fantastic experience but I discovered that I get badly seasick (and that lots of the equipment was pretty old and battle-hardened (i.e. &amp;#39;simple&amp;#39;)) so that put paid to my plans to join the Navy. Off to college...&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;Event #3&lt;/strong&gt; happened quite a bit later, and was my decision to accept a job offer from Microsoft, move to the US from Scotland and start being a SQL geek instead of a VMS file-system geek. The story behind that is explained in the first few Q&amp;amp;As in an &lt;a href="http://www.thomaslarock.com/2009/06/interview-with-paul-randal/"&gt;email interview&lt;/a&gt; I did last year with Tom LaRock (&lt;/font&gt;&lt;/font&gt;&lt;a href="http://twitter.com/SQLRockstar"&gt;&lt;font face="verdana,geneva" size="2"&gt;twitter&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;|&lt;/font&gt;&lt;a href="http://www.thomaslarock.com/"&gt;&lt;font face="verdana,geneva" size="2"&gt;blog&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;). Without that decision, I&amp;#39;d never have been into SQL Server, started presenting, met Kimberly, etc etc and you wouldn&amp;#39;t be reading this blog post.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;So, those are my three life-changing events. What do you think are yours? It&amp;#39;s not what got you to be a DBA, it what got you to where you are in your life.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;In the great spirit of the SQL Community, I&amp;#39;m going to tag&amp;nbsp;a few of my friends&amp;nbsp;to have a go next who I think will provide interesting answers in an entertaining way (no pressure!) - if you blog in this series, please link back here so I can make sure I read them.&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/"&gt;&lt;font face="verdana,geneva" size="2"&gt;Kimberly&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://www.brentozar.com/"&gt;&lt;font face="verdana,geneva" size="2"&gt;Brent Ozar&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://sqlblog.com/blogs/andrew_kelly/"&gt;&lt;font face="verdana,geneva" size="2"&gt;Andrew Kelly&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://blogs.msdn.com/buckwoody/"&gt;&lt;font face="verdana,geneva" size="2"&gt;Buck Woody&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://thomaslarock.com/"&gt;&lt;font face="verdana,geneva" size="2"&gt;Tom LaRock&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://sqlblog.com/blogs/kalen_delaney/"&gt;&lt;font face="verdana,geneva" size="2"&gt;Kalen Delaney&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://sqlblog.com/blogs/kevin_kline/"&gt;&lt;font face="verdana,geneva" size="2"&gt;Kevin Kline&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Enjoy!&lt;/font&gt; 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/qWlbVT_R8ow" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/qWlbVT_R8ow/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/What-three-events-brought-you-here.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=785a0c9c-e035-43ea-bbac-685d10d5802d</guid>
      <pubDate>Sat, 16 Jan 2010 12:35:00 -0800</pubDate>
      <category>Personal</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=785a0c9c-e035-43ea-bbac-685d10d5802d</pingback:target>
      <slash:comments>24</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=785a0c9c-e035-43ea-bbac-685d10d5802d</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/What-three-events-brought-you-here.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=785a0c9c-e035-43ea-bbac-685d10d5802d</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=785a0c9c-e035-43ea-bbac-685d10d5802d</feedburner:origLink></item>
    <item>
      <title>Arduino projects: LED 10-bar array</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I finally had some time over the last two days to play with the Arduino board I picked up late last year. The Arduino is a pretty neat concept - wrapping a microcontroller up in a neat board that makes playing with sensors, displays, motors, etc and prototyping very simple. It&amp;#39;s all open source and you can read more about it on their homepage (&lt;/font&gt;&lt;a href="http://www.arduino.cc/"&gt;&lt;font face="verdana,geneva" size="2"&gt;http://www.arduino.cc/&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;) which also has a freeware IDE to use for programming. The board I have uses Amtel&amp;#39;s &lt;/font&gt;&lt;a href="http://www.atmel.com/dyn/products/product_card.asp?PN=ATmega328P"&gt;&lt;font face="verdana,geneva" size="2"&gt;ATmega328P&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; processor, with 32K of flash memory and can do 20MIPS. They&amp;#39;re very popular and opening up electronics and gadget hacking to non-techies.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Here&amp;#39;s the 2009 rev of the &lt;/font&gt;&lt;a href="http://www.arduino.cc/en/Main/ArduinoBoardDuemilanove"&gt;&lt;font face="verdana,geneva" size="2"&gt;Arduino Duemilanove&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; board (image from their website, click for larger version): &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;a href="http://arduino.cc/blog/wp-content/uploads/2008/10/duemilanove500.jpg"&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;img src="http://arduino.cc/blog/wp-content/uploads/2008/10/duemilanove500.jpg" alt="" width="314" height="226" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;They cost about $30 - I got mine as part of a &lt;/font&gt;&lt;a href="http://store.nutsvolts.com/product.php?productid=16841&amp;amp;cat=385&amp;amp;page=1"&gt;&lt;font face="verdana,geneva" size="2"&gt;kit from the Nuts&amp;#39;n&amp;#39;Volts magazine store&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; but&amp;nbsp;loads of online stores have them. &amp;nbsp;I just picked up some accessories yesterday from SparkFun who have the &lt;/font&gt;&lt;a href="http://www.sparkfun.com/commerce/categories.php?c=103"&gt;&lt;font face="verdana,geneva" size="2"&gt;full range&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;, including the Arduino Mega which has 54 IO pins - can&amp;#39;t wait for that to arrive! &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The possibilities for this are just endless. The IDE provides a full C++ environment with a bunch of helper classes already defined, which takes a lot out of the tedium of programming microcontrollers. If you&amp;#39;re going to play with this, I recommend using some of the samples that come with the IDE and on their very extensive web site. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;My current interest is with making things light up in clever ways so I thought I&amp;#39;d start off by writing a simple program to play with an LED array. The circuit&amp;#39;s very simple: pins 2-11 from the Arduino connected through 220ohm resistors to the LED array, which is connected to ground on the other side. Future, more complex projects will include a circuit diagram (once I find a nice freeware program to do it). &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Here&amp;#39;s a photo of the board connected up and a close up of the very simple circuit (click for larger versions): &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;a href="http://www.sqlskills.com/blogs/paul/content/binary/P1020710.jpg"&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f1%2fSmallP1020710.JPG" alt="" width="235" height="237" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;a href="http://www.sqlskills.com/blogs/paul/content/binary/P1020719.jpg"&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f1%2fSmallP1020719.JPG" alt="" width="314" height="222" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I put together two easy programs - one to move the lit LED from right-to-left and back again and one to move the lit LEDs from the middle out to the two sides and back in again. Kind of Knightrider-esque, but also the way the old SUN machines I used at university had their status lights on the back of the machine. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The code for the first one is: &lt;/font&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;/*&lt;br /&gt;
	&amp;nbsp; 10-bar LED array&lt;br /&gt;
	&amp;nbsp; &lt;br /&gt;
	&amp;nbsp; Connect the LED array to pins 11-2 through a 220R resistor, and to ground on the other side.&lt;br /&gt;
	&amp;nbsp; 01/14/2010&lt;br /&gt;
	*/ &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;void setup ()&lt;br /&gt;
	{&lt;br /&gt;
	&amp;nbsp; for (int loop = 2; loop &amp;lt; 12; loop++)&lt;br /&gt;
	&amp;nbsp; {&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; pinMode (loop, OUTPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set the pin IO mode&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (loop, LOW);&lt;br /&gt;
	&amp;nbsp; }&lt;br /&gt;
	} &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;void loop ()&lt;br /&gt;
	{&lt;br /&gt;
	&amp;nbsp; // The loop has to start&amp;nbsp;at 2 because 1 isn&amp;#39;t an IO pin.&lt;br /&gt;
	&amp;nbsp; // Go from&amp;nbsp;right to left&lt;br /&gt;
	&amp;nbsp; for (int loop = 2; loop &amp;lt; 12; loop++)&lt;br /&gt;
	&amp;nbsp; {&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; // Switch the LED on for 10 milliseconds&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (loop, HIGH);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; delay (10);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (loop, LOW);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; delay (20);&lt;br /&gt;
	&amp;nbsp; }&lt;br /&gt;
	&amp;nbsp; &lt;br /&gt;
	&amp;nbsp; // And from left to right again&lt;br /&gt;
	&amp;nbsp; for (int loop = 11; loop &amp;gt; 1; loop--)&lt;br /&gt;
	&amp;nbsp; {&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (loop, HIGH);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; delay (10);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (loop, LOW);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; delay (20);&lt;br /&gt;
	&amp;nbsp; }&lt;br /&gt;
	} &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;And the second one changes the loop to be: &lt;/font&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;void loop ()&lt;br /&gt;
	{&lt;br /&gt;
	&amp;nbsp; // Start on LED 6 and go up to 10 (remember, shifted by 1)&lt;br /&gt;
	&amp;nbsp; for (int loop = 7; loop &amp;lt; 12; loop++)&lt;br /&gt;
	&amp;nbsp; {&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; // Light the LED on the LHS of middle and the matching one on the RHS&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; // This will light LEDs 6-5, 7-4, 8-3, 9-2, 10-1 (shifted by 1)&lt;/font&gt;&lt;/font&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (loop, HIGH);&lt;/font&gt;&lt;/font&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (13 - loop, HIGH);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; delay (10);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (loop, LOW);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (13 - loop, LOW);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; delay (20);&lt;br /&gt;
	&amp;nbsp; }&lt;br /&gt;
	&lt;br /&gt;
	&amp;nbsp; //&amp;nbsp;And back down to the middle again&lt;br /&gt;
	&amp;nbsp; for (int loop = 11; loop &amp;gt; 6; loop--)&lt;br /&gt;
	&amp;nbsp; {&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (loop, HIGH);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (13 - loop, HIGH);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; delay (10);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (loop, LOW);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite (13 - loop, LOW);&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; delay (20);&lt;br /&gt;
	&amp;nbsp; }&lt;br /&gt;
	}&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Note there&amp;#39;s no &lt;font face="courier new,courier"&gt;main()&lt;/font&gt; function - it&amp;#39;s all taken care of. The wrapper calls your &lt;font face="courier new,courier"&gt;setup()&lt;/font&gt; function and calls the &lt;font face="courier new,courier"&gt;loop()&lt;/font&gt; function in an infinite loop. You only have to provide these&amp;nbsp;functions and you&amp;nbsp;can&amp;nbsp;use all the&amp;nbsp;C++ programming constructs (if you want to) or keep it pretty simple.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I took some short (5 second) movies of each program running - you can get them from &lt;/font&gt;&lt;a href="http://www.sqlskills.com/blogs/paul/content/binary/P1020721.mov"&gt;&lt;font face="verdana,geneva" size="2"&gt;SideToSide movie&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; and &lt;/font&gt;&lt;a href="http://www.sqlskills.com/blogs/paul/content/binary/P1020720.mov"&gt;&lt;font face="verdana,geneva" size="2"&gt;MiddleToSides movie&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; (1.9MB each).&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This was just my introduction to the environment, the real fun will start with some of the projects I have lined up:&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;3-D LED cubes (3x3x3, 4x4x4, 8x8x8 and maybe higher - I have 1000 3mm red LEDs winging their way towards me - $29.95 from &lt;/font&gt;&lt;a href="http://www.rackmount-devices.com/010-0201.html"&gt;&lt;font face="verdana,geneva" size="2"&gt;Rackmount-Devices.com&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;)&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;panel of 8x8 LED arrays controlled through &lt;/font&gt;&lt;a href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1339"&gt;&lt;font face="verdana,geneva" size="2"&gt;MAX7219&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; chips&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;object recognition with a simple CMOS camera&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;font face="verdana,geneva" size="2"&gt;It&amp;#39;s going to be a fun year! &lt;font face="verdana,geneva" size="2"&gt;This is going to satisfy not only my desire to get back into electronics and start tinkering, but also to write some nifty low-level code. &lt;/font&gt;&lt;/font&gt;&lt;font face="verdana,geneva" size="2"&gt;
&lt;p&gt;
As always, let me know if this is interesting, you&amp;#39;re doing something similar, want something explained, or you have an idea for a cool project. 
&lt;/p&gt;
&lt;p&gt;
Enjoy! 
&lt;/p&gt;
&lt;/font&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/V7WJ8neQqYI" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/V7WJ8neQqYI/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Arduino-projects-LED-10-bar-array.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=9b974d76-61c3-488d-8b6f-351dc698e359</guid>
      <pubDate>Thu, 14 Jan 2010 15:39:00 -0800</pubDate>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=9b974d76-61c3-488d-8b6f-351dc698e359</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=9b974d76-61c3-488d-8b6f-351dc698e359</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Arduino-projects-LED-10-bar-array.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=9b974d76-61c3-488d-8b6f-351dc698e359</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=9b974d76-61c3-488d-8b6f-351dc698e359</feedburner:origLink></item>
    <item>
      <title>Diskeeper 10 Intelliwrite corruption bug</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;A couple of years ago I &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Search-Engine-QA-14-Beware-3rd-party-file-system-drivers-with-DBCC-CHECKDB.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;blogged about 3rd-party file system filter drivers&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; and how if they&amp;#39;re not coded correctly to cope with NTFS alternate streams they will cause all kinds of weird corruption errors to be reported when DBCC CHECKDB is running. At the time I&amp;#39;d only seen&amp;nbsp;the issue a&amp;nbsp;couple of times so thought no more about it until a few weeks ago.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I was settling down to watch a movie with my laptop nearby when I got involved helping fellow-MVP Jonathan Kehayias (&lt;/font&gt;&lt;a href="http://sqlblog.com/blogs/jonathan_kehayias/default.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;blog&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;|&lt;/font&gt;&lt;a href="http://twitter.com/sqlsarg"&gt;&lt;font face="verdana,geneva" size="2"&gt;twitter&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;). As things progressed it dawned on me that his CHECKDBs were fine using regular database snapshots, but failed using the automatically-created snapshots, which use NTFS alternate streams (see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/CHECKDB-From-Every-Angle-Why-would-CHECKDB-run-out-of-space.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this blog post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; where I explain about them). The errors produced were as below (borrowed from Jonathan&amp;#39;s blog post):&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="2"&gt;2009-12-10 01:35:44.04 spid75&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error: 17053, Severity: 16, State: 1. &lt;br /&gt;
	2009-12-10 01:35:44.04 spid75&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; E:\SQLData\MSSQL.1\DatabaseName.mdf:MSSQL_DBCC16: Operating system error 1784(The supplied user buffer is not valid for the requested operation.) encountered. &lt;br /&gt;
	2009-12-10 01:35:44.07 spid98&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBCC CHECKDB (DatabaseName) WITH all_errormsgs, no_infomsgs, data_purity executed by Domain\UserName found 0 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes 9 seconds. &lt;br /&gt;
	2009-12-10 01:35:44.45 spid98&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error: 926, Severity: 21, State: 6. &lt;br /&gt;
	2009-12-10 01:35:44.45 spid98&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Database &amp;#39;DatabaseName&amp;#39; cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information.&amp;nbsp;&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Lo-and-behold, it turned out to be a Diskeeper 10 filter driver that had a bug in it. You can read Jonathan&amp;#39;s more in-depth recounting of the story on his blog &lt;/font&gt;&lt;a href="http://sqlblog.com/blogs/jonathan_kehayias/archive/2009/12/10/a-tale-of-checkdb-failures-cause-by-3rd-party-file-system-drivers.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Diskeeper issued a fix a couple of weeks back, and Microsoft Product Support also put out a blog post with some details. Links are:&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;a href="http://www.diskeeper.com/blog/post/2009/12/28/New-Diskeeper-2010-update-%28140898%29.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;http://www.diskeeper.com/blog/post/2009/12/28/New-Diskeeper-2010-update-%28140898%29.aspx&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;(note there&amp;#39;s a newer version even than this one, at time of writing)&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;a href="http://blogs.msdn.com/psssql/archive/2010/01/08/dbcc-check-commands-encounter-problems-and-reports-errors.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;http://blogs.msdn.com/psssql/archive/2010/01/08/dbcc-check-commands-encounter-problems-and-reports-errors.aspx&lt;/font&gt;&lt;/a&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Hope this doesn&amp;#39;t happen to you!&lt;/font&gt; 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/fgPoCHYca6E" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/fgPoCHYca6E/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Diskeeper-10-Intelliwrite-corruption-bug.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=e370e973-7d1e-43ad-9d3b-87343d73d68d</guid>
      <pubDate>Wed, 13 Jan 2010 14:34:00 -0800</pubDate>
      <category>Bugfixes</category>
      <category>CHECKDB From Every Angle</category>
      <category>Corruption</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=e370e973-7d1e-43ad-9d3b-87343d73d68d</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=e370e973-7d1e-43ad-9d3b-87343d73d68d</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Diskeeper-10-Intelliwrite-corruption-bug.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=e370e973-7d1e-43ad-9d3b-87343d73d68d</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=e370e973-7d1e-43ad-9d3b-87343d73d68d</feedburner:origLink></item>
  </channel>
</rss>
