<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss1full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:cc="http://web.resource.org/cc/" xmlns="http://purl.org/rss/1.0/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">

<channel rdf:about="http://www.rodcolledge.com/rod_colledge/">
<title>Dirty Reads ... </title>
<link>http://www.rodcolledge.com/rod_colledge/</link>
<description>... and other filthy tales by Rod Colledge, SQL Server MVP</description>
<dc:language>en-US</dc:language>
<dc:creator />
<dc:date>2010-03-15T11:42:10+10:00</dc:date>
<admin:generatorAgent rdf:resource="http://www.typepad.com/" />


<items>
<rdf:Seq><rdf:li rdf:resource="http://www.rodcolledge.com/rod_colledge/2010/03/speaking-melbourne-sql-server-users-group-tomorrow-evening-hitchhikerss-guide-to-sql-server-management-studio-httpbitl.html" />
<rdf:li rdf:resource="http://www.rodcolledge.com/rod_colledge/2010/02/fun-with-ssis-part-1-troubleshooting.html" />
<rdf:li rdf:resource="http://www.rodcolledge.com/rod_colledge/2010/01/pass-presentation-evaluation-results.html" />
<rdf:li rdf:resource="http://www.rodcolledge.com/rod_colledge/2010/01/mvp.html" />
<rdf:li rdf:resource="http://www.rodcolledge.com/rod_colledge/2009/12/business-intelligence-roadkill-and-the-politics-of-change.html" />
<rdf:li rdf:resource="http://www.rodcolledge.com/rod_colledge/2009/08/the-great-dba-schism.html" />
<rdf:li rdf:resource="http://www.rodcolledge.com/rod_colledge/2009/08/dbas-behaving-badly-710-manual-administration.html" />
<rdf:li rdf:resource="http://www.rodcolledge.com/rod_colledge/2009/07/dmvs-and-autoclose.html" />
<rdf:li rdf:resource="http://www.rodcolledge.com/rod_colledge/2009/07/dbas-behaving-badly-610-indexes.html" />
<rdf:li rdf:resource="http://www.rodcolledge.com/rod_colledge/2009/07/top-5-reasons-your-business-intelligence-project-will-fail.html" />
</rdf:Seq>
</items>

<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rdf+xml" href="http://feeds.feedburner.com/DirtyReadsAndOtherFilthyTales" /><feedburner:info uri="dirtyreadsandotherfilthytales" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /></channel>

<item rdf:about="http://www.rodcolledge.com/rod_colledge/2010/03/speaking-melbourne-sql-server-users-group-tomorrow-evening-hitchhikerss-guide-to-sql-server-management-studio-httpbitl.html">
<title />
<link>http://feedproxy.google.com/~r/DirtyReadsAndOtherFilthyTales/~3/cmT-ozsOyqA/speaking-melbourne-sql-server-users-group-tomorrow-evening-hitchhikerss-guide-to-sql-server-management-studio-httpbitl.html</link>
<description>Speaking @ Melbourne SQL Server User's Group tomorrow evening. "Hitchhiker's Guide to SQL Server Management Studio" http://bit.ly/9tvbkU</description>
<content:encoded><![CDATA[Speaking @ Melbourne SQL Server User&#39;s Group tomorrow evening. &quot;Hitchhiker&#39;s Guide to SQL Server Management Studio&quot; <a href="http://bit.ly/9tvbkU">http://bit.ly/9tvbkU</a><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=cmT-ozsOyqA:_ofOwRpe3S8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?i=cmT-ozsOyqA:_ofOwRpe3S8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=cmT-ozsOyqA:_ofOwRpe3S8:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DirtyReadsAndOtherFilthyTales/~4/cmT-ozsOyqA" height="1" width="1"/>]]></content:encoded>



<dc:creator>Rod Colledge</dc:creator>
<dc:date>2010-03-15T11:42:10+10:00</dc:date>
<feedburner:origLink>http://www.rodcolledge.com/rod_colledge/2010/03/speaking-melbourne-sql-server-users-group-tomorrow-evening-hitchhikerss-guide-to-sql-server-management-studio-httpbitl.html</feedburner:origLink></item>
<item rdf:about="http://www.rodcolledge.com/rod_colledge/2010/02/fun-with-ssis-part-1-troubleshooting.html">
<title>Fun with SSIS - Part 1 - Troubleshooting</title>
<link>http://feedproxy.google.com/~r/DirtyReadsAndOtherFilthyTales/~3/sr7RqiMu57A/fun-with-ssis-part-1-troubleshooting.html</link>
<description>Although I still consider myself a DBA, the last few years have seen me spend more and more time in the Business Intelligence development space (SSIS development in particular). In this the first of a 2-part SSIS series, I’ll be...</description>
<content:encoded><![CDATA[<p>Although I still consider myself a DBA, the last few years have seen me spend more and more time in the Business Intelligence development space (SSIS development in particular). In this the first of a 2-part SSIS series, I’ll be focusing on a number of SSIS “issues” I’ve discovered the hard way.</p><p><span style="color: #4040ff; font-size: 18px;">1: Case Sensitivity</span></p><p>I’ve never been particularly good at using case consistently, the perfect example of which was my publisher asking me to edit hundreds of figure captions in my <a href="http://www.amazon.com/gp/product/193398872X?ie=UTF8&amp;tag=wwwrodcolledg-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=193398872X" target="_blank">recently published book</a>. Like most people of my age who took a college course in programming, I studied C, and spent countless hours debugging problems traced back to the incorrect case of variable names (and using “=” instead of “==” !).</p><p>When I decided to specialize in SQL Server administration, I rejoiced at the lack of case sensitivity involved, although I occasionally see databases with the case sensitive option, in most cases (pardon the pun) installed my accident.</p><p>Imagine my angst when I discovered that a tool I’m spending more and more time with is rampantly case sensitive. Almost everything about SSIS is case sensitive; the expression language, variable names and one that gets me every time; lookups.</p><p>A very common SSIS data flow transformation is <em>lookup</em>. As the name implies, it’s most often used to lookup a key value based on a text value in the data flow. For example, in the figure below, we’re returning the supplierKey based on the supplierName value. The first screen defines the lookup source, and the second defines the join condition and what value is to be returned.</p><p><a href="http://www.rodcolledge.com/.a/6a0111684623b6970c0128777d1852970c-pi" style="display: inline;"><img alt="1" border="0" class="asset asset-image at-xid-6a0111684623b6970c0128777d1852970c image-full " src="http://www.rodcolledge.com/.a/6a0111684623b6970c0128777d1852970c-800wi" title="1" /></a> <br /> </p><p>This, for all intents and purposes, in a simple join condition with a column from the joined table being returned. However, unlike T-SQL, the SSIS lookup <em>is </em>case sensitive.</p><p>The obvious way to address this is to ensure both the lookup column (vendorName in this example) and the matching data flow field (Supplier) are set to the same case using the UPPER (or LOWER) function. For the lookup, that’s a simple case of changing the lookup source T-SQL to use one of those functions. For the data flow field, we could use the <em>derived column transformation </em>using the same function, and use that column in the lookup process.</p><p><span style="color: #4040ff; font-size: 18px;">2: Strong Typing</span><br />
</p>
<p>If there was any remaining doubt that SSIS was designed for developers (and not classic DBAs) it’s confirmed in its (very) strong typing. As an example of that, let’s revisit the lookup example from above. A previous version of the database had the Supplier data type set to varchar(50) and vendorName set to nvarchar(255). When we try and connect these in the lookup, we’ll get the following error;</p><p><a href="http://www.rodcolledge.com/.a/6a0111684623b6970c0128777d1f5c970c-pi" style="display: inline;"><img alt="2" border="0" class="asset asset-image at-xid-6a0111684623b6970c0128777d1f5c970c image-full " src="http://www.rodcolledge.com/.a/6a0111684623b6970c0128777d1f5c970c-800wi" title="2" /></a> <br />&#0160; </p><p>Another common issue with mismatched data types is when inserting rows into a table at the end of a data flow task. If the destination table’s column length is shorter than the source, you’ll get a warning such as this one;</p><p><a href="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a87aa229970b-pi" style="display: inline;"><img alt="3" border="0" class="asset asset-image at-xid-6a0111684623b6970c0120a87aa229970b image-full " src="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a87aa229970b-800wi" title="3" /></a> <br /> </p><p>Unless you have the luxury of an enterprise wide data dictionary (that every one adheres to), data type variances such as these are common, with the most frequent SSIS workarounds being to either CAST the columns in the data source selection (e.g.; using a view) and/or using type casts in a derived column transformation (more on that in part 2 of this blog series)</p><p><span style="color: #4040ff; font-size: 18px;">3: 64-bit Trickery</span><br />
</p>

<p>There will presumably come a day when everything works on 64-bit, and that day can’t come soon enough. In the meantime, we have to deal with a variety of annoying problems, one of which is 64-bit driver support in SSIS.</p><p>A common data source for SSIS packages are Excel files. The current (and all previous) versions of Excel do not include 64-bit drivers. This presents a problem when SSIS packages run in 64-bit environments, and the error messages returned are far from helpful (unless you consider <em>“The AcquireConnection method call to the connection manager blah failed with error code blah”</em> helpful).</p><p>Fortunately, there’s an easy workaround for this issue, via a property called <em>Run64BitRuntime</em> accessed through the Debugging page of the project’s properties window. As per the figure below, setting this property to <em>False </em>(it’s true by default) will use the 32-bit driver.</p><p><a href="http://www.rodcolledge.com/.a/6a0111684623b6970c0128777d2099970c-pi" style="display: inline;"><img alt="4" border="0" class="asset asset-image at-xid-6a0111684623b6970c0128777d2099970c image-full " src="http://www.rodcolledge.com/.a/6a0111684623b6970c0128777d2099970c-800wi" title="4" /></a> <br /> </p><p>Note that there are a whole range of other considerations for 64-bit mode, for example when calling child packages from a parent with a different setting for this value. For a great blog post on these issues visit <a href="http://toddmcdermid.blogspot.com/2009/10/quick-reference-ssis-in-32-and-64-bits.html" target="_blank">Todd McDermid’s post&#0160;</a> from last year.</p><p><span style="color: #4040ff; font-size: 18px;">4: Package Configurations</span><br />
</p>


<p>One of the real SSIS horror stories that I was very close to (but not responsible for!) was an SSIS package that was run against a production database by accident (blowing away gigabytes of production data). The package used a production configuration file instead of a test/development file. There’s a couple of aspects to this (all too common) problem; configuration technique and security. </p><p>Firstly, configuration technique. SSIS allows a number of ways of configuring settings such as server and database name. The most common one is to use an XML configuration file, the path to which is either stored within the package itself, or set through an environment variable.</p><p>I’ve seen problems with both of these techniques. Using a configuration file location (as per the example below) assumes that all servers on which the package runs has the same path available, which is quite often not the case.</p><p><a href="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a87aa3e9970b-pi" style="display: inline;"><img alt="5" border="0" class="asset asset-image at-xid-6a0111684623b6970c0120a87aa3e9970b " src="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a87aa3e9970b-800wi" title="5" /></a> <br /> </p><p>The environment variable option can also present some problems, notably the need to reboot the server for the variable to come into effect. Depending on the environment, rebooting production servers is not the easiest thing to do.</p><p>Another alternative to both of the above is one that I discovered while listening to <a href="http://sqldownunder.com/PreviousShows/tabid/98/Default.aspx" target="_blank">Greg Low’s SQLDownUnder podcast with Jamie Thompson</a>&#0160; in which Greg spoke of the idea of connecting to a special configuration database which stored the configuration settings. The settings returned were based on the calling machine’s context and then used to set the value of package variables for subsequent use.</p><p>Regardless of the configuration technique, one of the really important considerations is security. In each of the above techniques, mistakes can still be made. For example, a production configuration file can be copied over the top of a development file, or the incorrect settings stored in a configuration database. </p><p>To prevent these types of configuration errors from killing a production database, we need to ensure that the security context of an SSIS package prevents it from accessing the wrong environment. There are at least two ways of achieving this; using separate service accounts in each environment (and making sure the account only has database permissions in the appropriate environment), or better still, having the production database in a separate domain with trust permissions removed to the other domain(s). </p><p>With the appropriate security setup, even if the wrong configuration file is used, the package will fail to run due to the lack of database permissions.</p><p><span style="color: #4040ff; font-size: 18px;">5: Miscellaneous Silly Business</span><br />
</p>



<p>Finally, there’s a number of really silly things I continue to do that I shouldn’t (I’m a slow learner). Firstly, the <em>evaluate as expression</em> property.</p><p>A common design pattern in SSIS packages is to use a variable as the source for an Execute SQL task. The variable’s value is then set using an expression which references another variable. A common example of this is a variable that contains an update command with a where clause containing the value of a BatchID variable. The expression property contains the code that references the other variable.</p><p>If you use this type of arrangement, make sure the variable&#39;s <em>evaluate as expression</em> property is set to TRUE, as per the example below. I’ve spent many hours debugging problems where I’ve simply forgotten to set this properly.</p><p><a href="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a87aa515970b-pi" style="display: inline;"><img alt="6" border="0" class="asset asset-image at-xid-6a0111684623b6970c0120a87aa515970b " src="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a87aa515970b-800wi" title="6" /></a> <br /> </p><p>To wrap up this post, I frequently want to add an existing .dtsx package (e.g.; from another project) to the current project. By default I right click the <em>SSIS Packages</em> node in solution explorer and choose the .dtsx package that I’ve already copied into the project directory. I’m then confused as to why the package is renamed e.g.; from Package.dtsx to Package(1).dtsx. </p><p>It turns out that the <em>Add Existing Package</em> menu is really designed for adding a package from a different location (i.e.; remote server), and if you use it locally, it makes a copy (and renames) the file.</p><p>For the situation I described, using the <em>Add &gt; Existing Item</em> option (instead of Add Existing Package from the SSIS Packages menu) is the correct option. The figure below compares these 2 options side by side.</p><p><a href="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a87aa5c1970b-pi" style="display: inline;"><img alt="7" border="0" class="asset asset-image at-xid-6a0111684623b6970c0120a87aa5c1970b image-full " src="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a87aa5c1970b-800wi" title="7" /></a> <br /> In the next post, I’ll talk about some important SSIS performance tuning tips.</p><p>Cheers<br /> </p><p> </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=sr7RqiMu57A:V5xGJz4KHmI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?i=sr7RqiMu57A:V5xGJz4KHmI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=sr7RqiMu57A:V5xGJz4KHmI:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DirtyReadsAndOtherFilthyTales/~4/sr7RqiMu57A" height="1" width="1"/>]]></content:encoded>


<dc:subject>Business Intelligence</dc:subject>

<dc:creator>Rod Colledge</dc:creator>
<dc:date>2010-02-09T22:40:38+10:00</dc:date>
<feedburner:origLink>http://www.rodcolledge.com/rod_colledge/2010/02/fun-with-ssis-part-1-troubleshooting.html</feedburner:origLink></item>
<item rdf:about="http://www.rodcolledge.com/rod_colledge/2010/01/pass-presentation-evaluation-results.html">
<title>PASS Presentation Evaluation Results</title>
<link>http://feedproxy.google.com/~r/DirtyReadsAndOtherFilthyTales/~3/urQnI_gWx40/pass-presentation-evaluation-results.html</link>
<description>The results are in .... Following on from Jonathan, Grant, Marco, Andy &amp; Louis, here are the results from the 40 returned evaluations of my "DBAs Behaving Badly" session at PASS 2009; This was the first time I've spoken at...</description>
<content:encoded><![CDATA[<p>The results are in ....</p><p>Following on from <a href="http://sqlblog.com/blogs/jonathan_kehayias/archive/2010/01/13/pass-session-evaluations.aspx" target="_blank">Jonathan</a>, <a href="http://scarydba.wordpress.com/2010/01/06/pass-summit-evaluations/" target="_blank">Grant</a>, <a href="http://sqlblog.com/blogs/marco_russo/archive/2010/01/08/pass-summit-2009-evaluations.aspx" target="_blank">Marco</a>, <a href="http://sqlblog.com/blogs/andy_leonard/archive/2010/01/07/pass-summit-evaluations.aspx" target="_blank">Andy</a> &amp; <a href="http://sqlblog.com/blogs/louis_davidson/default.aspx" target="_blank">Louis</a>, here are the results from the 40 returned evaluations of my &quot;DBAs Behaving Badly&quot; session at PASS 2009;<a href="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a7ccce17970b-pi" style="display: inline;"><br /></a></p><p><span style="text-decoration: underline;"><a href="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a7ccd5d1970b-pi" style="display: inline;"><img alt="PASSResults" border="0" class="asset asset-image at-xid-6a0111684623b6970c0120a7ccd5d1970b image-full " src="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a7ccd5d1970b-800wi" title="PASSResults" /></a> <br /> </span>&#0160;<br /> </p><p></p><p>This was the first time I&#39;ve spoken at <a href="http://www.sqlpass.org/summit/na2010/" target="_blank">PASS</a> (hopefully not the last!), and the first time I&#39;ve spoken in front of a large audience. I&#39;m blown away by the result, and really enthusiastic about preparing my next presentation.</p><p>To everyone that came along, thanks for laughing at my jokes ... or laughing at me ... either way, thanks :-)</p><p><br />Cheers</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=urQnI_gWx40:ZvuUkCMPYgQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?i=urQnI_gWx40:ZvuUkCMPYgQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=urQnI_gWx40:ZvuUkCMPYgQ:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DirtyReadsAndOtherFilthyTales/~4/urQnI_gWx40" height="1" width="1"/>]]></content:encoded>


<dc:subject>PASS</dc:subject>
<dc:subject>Presentations</dc:subject>

<dc:creator>Rod Colledge</dc:creator>
<dc:date>2010-01-13T20:09:52+10:00</dc:date>
<feedburner:origLink>http://www.rodcolledge.com/rod_colledge/2010/01/pass-presentation-evaluation-results.html</feedburner:origLink></item>
<item rdf:about="http://www.rodcolledge.com/rod_colledge/2010/01/mvp.html">
<title>MVP!</title>
<link>http://feedproxy.google.com/~r/DirtyReadsAndOtherFilthyTales/~3/m_gzXDk5QC8/mvp.html</link>
<description>On Saturday morning I woke up to news that I was granted the MVP award for 2010 (my first MVP award). That capped a stellar year for me during which, among other things, my book was published, I spoke at...</description>
<content:encoded><![CDATA[On Saturday morning I woke up to news that I was granted the MVP award for 2010 (my first MVP award). That capped a stellar year for me during which, among other things, <a href="http://www.amazon.com/SQL-Server-2008-Administration-Action/dp/193398872X/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1262595651&amp;sr=8-2" target="_blank">my book</a> was published, I spoke at the PASS summit in Seattle, and I had the honor of being involved in the tech editing of the brilliant <a href="http://www.amazon.com/SQL-Server-MVP-Deep-Dives/dp/1935182048/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1262595859&amp;sr=8-1" target="_blank">SQL Server MVP Deep Dives</a> book.<br /><br />Each of those things was huge, but for all of them to occur in one year was massive. Receiving the MVP award is both overwhelming and exciting, and I hope that my actions in 2010 will do the award justice.<br /><br />Thank you to all who have supported and encouraged me (you know who you are!) in particular Kevin Kline, Paul Nielsen, the folks at Manning Publications, and my local user group here in Australia run by fellow MVP Peter Ward.<br /><br />As I write this, I’m organizing my schedule to attend the MVP Summit in February. If you’re going and are interested in sharing a room, drop me a line at rodcolledge at gmail dot com<br /><br />Cheers, and have an awesome 2010!<br />Rod.<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=m_gzXDk5QC8:JjXS2A7BcbM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?i=m_gzXDk5QC8:JjXS2A7BcbM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=m_gzXDk5QC8:JjXS2A7BcbM:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DirtyReadsAndOtherFilthyTales/~4/m_gzXDk5QC8" height="1" width="1"/>]]></content:encoded>


<dc:subject>Book</dc:subject>
<dc:subject>MVP</dc:subject>

<dc:creator>Rod Colledge</dc:creator>
<dc:date>2010-01-04T19:16:42+10:00</dc:date>
<feedburner:origLink>http://www.rodcolledge.com/rod_colledge/2010/01/mvp.html</feedburner:origLink></item>
<item rdf:about="http://www.rodcolledge.com/rod_colledge/2009/12/business-intelligence-roadkill-and-the-politics-of-change.html">
<title>Business Intelligence Roadkill ... and the Politics of Change</title>
<link>http://feedproxy.google.com/~r/DirtyReadsAndOtherFilthyTales/~3/InlLLbZJ0Ig/business-intelligence-roadkill-and-the-politics-of-change.html</link>
<description>One of the challenges of being a consultant on a Business Intelligence project is dealing with employees' perceptions of how the project will impact on their value within the organization. More on that soon ... The primary goal of any...</description>
<content:encoded><![CDATA[One of the challenges of being a consultant on a Business Intelligence project is dealing with employees&#39; perceptions of how the project will impact on their value within the organization. More on that soon ...<br /><p>The primary goal of any BI solution is to provide decision makers with the information they need to make better decisions, leading to higher profits, lower costs and improved service levels. Successful BI solutions enable this by automating the extraction and transformation of data into a shape that facilitates agile reporting and analysis.</p><p>When working with organizations looking to build their first BI solution, I&#39;ve found that building them a prototype is a great way to show them the types of things that are possible with BI solutions. This process assists them in answering the questions used to document the formal business requirements upon which their real BI solution will be built.</p><p>It&#39;s interesting to observe their reactions during the demonstration of the prototype. For organizations that are used to manually collating figures and producing canned reports, the speed with which a BI solution can slice and dice the numbers often blows them away, which is nice, but it can also have a side effect of alienating the very people who are critical to the success of the project.</p><p>It&#39;s very easy to build a slick looking prototype and present it under controlled conditions. It&#39;s much harder to build a real solution that consumes real data, much of which is unstructured, inconsistent, and, in some cases, plain wrong. </p><p>One of the primary reasons BI projects fail is poor data quality, leading to inconsistent results and errors during data loads. Such outcomes chip away at the confidence in the system, and in some cases, precipitates the cancelation of the project itself. I wrote about this in more detail in my blog post titled <a href="http://www.rodcolledge.com/rod_colledge/2009/07/top-5-reasons-your-business-intelligence-project-will-fail.html" target="_blank">Top 5 reasons why your Business Intelligence project will fail</a>.</p><p>Avoiding data quality issues requires a good working relationship with the custodians of the source data. These people are often the same people that produce the existing reports that the BI system will ultimately replace, and therein lies the paradox; why would they help you to build a system that makes them redundant?</p><p>Human beings, rightly or wrongly, are resistant to change, particularly when the change has a perceived impact on their livelihood or professional value. In the context of a new BI solution, data custodians often view the solution as a threat to their value in the organization. They’re used to being in charge of large amounts of data, and making sense of it by producing reports. They feel threatened by a new system which promises to automate large parts of their work and produce much more flexible reports.</p><p>Successful BI projects acknowledge this threat/perception early. They engage data custodians and report writers in the early stages, and involve them throughout the solution lifecycle. They make them stakeholders in the solution, and value their organizational knowledge as a crucial ingredient in the overall success of the project. Perhaps most importantly, they address the value they will continue to play in the future. They map out how their role will evolve from basic data collation/reporting to more advanced analysis, and therefore provide <strong><em>increased </em></strong>value to the organization.</p><p>Some would argue that this is a mere ego stroking political exercise to be indulged on an as-needed basis. I argue that it’s a real challenge to be met early, and one that has measurable and ongoing impacts, and may just save the project from being undermined by those with a vested interest in its failure.</p><p>Cheers, and happy holidays :-)<br />Rod.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=InlLLbZJ0Ig:9DhPPRGrvWA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?i=InlLLbZJ0Ig:9DhPPRGrvWA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=InlLLbZJ0Ig:9DhPPRGrvWA:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DirtyReadsAndOtherFilthyTales/~4/InlLLbZJ0Ig" height="1" width="1"/>]]></content:encoded>


<dc:subject>Business Intelligence</dc:subject>

<dc:creator>Rod Colledge</dc:creator>
<dc:date>2009-12-21T20:04:22+10:00</dc:date>
<feedburner:origLink>http://www.rodcolledge.com/rod_colledge/2009/12/business-intelligence-roadkill-and-the-politics-of-change.html</feedburner:origLink></item>
<item rdf:about="http://www.rodcolledge.com/rod_colledge/2009/08/the-great-dba-schism.html">
<title>The Great DBA Schism</title>
<link>http://feedproxy.google.com/~r/DirtyReadsAndOtherFilthyTales/~3/tOcWrqgtZ_s/the-great-dba-schism.html</link>
<description>Schism n. A separation or division into factions Perhaps "schism" is a bit strong a word for what I'm describing in this post, but there's no doubt the role of a DBA, particularly a SQL Server DBA, is simultaneously splitting...</description>
<content:encoded><![CDATA[<p>Schism n. <em>A separation or division into factions</em></p><p>Perhaps &quot;schism&quot; is a bit strong a word for what I&#39;m describing in this post, but there&#39;s no doubt the role of a DBA, particularly a SQL Server DBA, is simultaneously splitting and changing, albeit in a gradual and peaceful manner.</p><p>In the forward to <a href="http://www.amazon.com/SQL-Server-2008-Administration-Colledge/dp/193398872x" target="_blank">my book</a>, Kevin Kline wrote of <em>institutional knowledge</em> as <em>the accumulated wisdom of many individual practitioners across many years</em>. The very fact that I was able to write a SQL Server book is direct evidence of the power of accumulated wisdom. Nothing (or very little) in my book is material that cannot be deduced from a number of other sources; my aim from the start was to present a single (and easy to digest) reference that encapsulated the accumulated wisdom of the role of SQL Server DBA, and I hope that I succeeded in that task.</p><p>In years gone by, the very best SQL Server DBAs were those that knew all the back doors and secret scripts and switches to squeeze out the best performance whilst avoiding the classic mistakes of those new to the role. Those DBAs still exist, but their power and mystique is diminishing. Together with well documented and easily accessible accumulated wisdom, new and improved features in recent versions of SQL Server have smoothed out the learning curve, making the role of SQL Server DBA a lot easier and more approachable than it once was. As a result, existing DBAs are spending more time accumulating knowledge in complementary areas, and new DBAs are coming into the role with a specialist angle in mind.</p><p>I&#39;ve listed below four different types of DBA role. Most DBAs I know currently perform tasks from at least two of these, but over time, I think these roles will become increasingly separated and practiced by those with an expertise in one area.</p><p><span style="font-size: 18px; font-family: Trebuchet MS;">Administration DBAs</span></p><p>The days of having a specialist DBA on staff to administer a small number of databases are drawing to a close. These tasks will be consumed by other administration staff (Windows, Exchange etc ....) who&#39;ll be expected to pickup the required SQL Server skills as part of their &quot;hybrid&quot; administration role. As such, the number of part time, or &quot;involuntary&quot; DBAs will rise, increasing the need for (and value of) accumulated DBA wisdom.</p><p>What&#39;s becoming very clear is that those that remain (or enter) the dedicated SQL Server administration space will need to specialize in administering large numbers of servers, typically in data centres and hosted environments. Their specialty will be the mastering of proactive administration (alerts, baseline analysis, etc ...) and will be the prime beneficiaries of new SQL Server features such as Policy-Based Management, Management Data Warehouse (MDW) and Resource Governor. They&#39;ll also employ their knowledge of scripting languages such as Powershell to further streamline their administration processes.</p><p>These DBAs will also be comfortable with virtualization (ESX/Hyper-V) and consolidation techniques, and will be able to hold their own in conversations with storage administrators regarding SAN configuration. Their deep knowledge of dynamic management views (DMVs) will enable them to pinpoint and correct database performance problems, and they&#39;ll be comfortable with disaster recovery planning, implementing least privilege security and high availability principals.</p><p><span style="font-size: 18px; font-family: Trebuchet MS;">Development DBAs</span></p><p>Development DBAs will spend most of their time with the database <em>before</em> it enters production. Their specialty will be logical and/or physical modelling, writing stored procedures and dealing with CLR, LINQ to SQL and Entity Framework (EF) performance and manageability issues. In addition to T-SQL programming, they&#39;ll be strong in one or more other development languages such as C#, and will spend most of their day in Visual Studio and TFS. </p><p>The emergence of geospatial data will see a sub-branch of development expertise for mapping applications.</p><p><span style="font-size: 18px; font-family: Trebuchet MS;">Data Tier Architects</span></p><p>The Data Tier Architects will be the ones that float around in meetings scribbling clouds on whiteboards. They&#39;ll be responsible for designing the interfaces to the data, and how the data is accessed, replicated, and synchronized. Their knowledge of SQL Server replication and scale out solutions such as shared scalable databases will enable them to design high performance platforms for the benefit of the various applications that consume and populate the data.</p><p><span style="font-size: 18px; font-family: Trebuchet MS;">Business Intelligence &amp; Data Warehousing DBAs</span></p><p>Finally, the years to come will see a continuation (and acceleration) of the rollout of business intelligence &amp; data warehousing projects. DBAs in this field will be those with a mastery of Integration Services (SSIS), Analysis Services (SSAS), MDX and Reporting Services (SSRS). True &quot;data mining&quot; projects will become more common, with the consolidation and conversion of legacy data systems.</p><p><br />So, the question is this ... <em>What sort of DBA will you be in 10 years from now?</em></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=tOcWrqgtZ_s:Nlf17gJGBIY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?i=tOcWrqgtZ_s:Nlf17gJGBIY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=tOcWrqgtZ_s:Nlf17gJGBIY:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DirtyReadsAndOtherFilthyTales/~4/tOcWrqgtZ_s" height="1" width="1"/>]]></content:encoded>


<dc:subject>DBA</dc:subject>

<dc:creator>Rod Colledge</dc:creator>
<dc:date>2009-08-24T23:40:33+10:00</dc:date>
<feedburner:origLink>http://www.rodcolledge.com/rod_colledge/2009/08/the-great-dba-schism.html</feedburner:origLink></item>
<item rdf:about="http://www.rodcolledge.com/rod_colledge/2009/08/dbas-behaving-badly-710-manual-administration.html">
<title>DBAs Behaving Badly (7/10): Manual Administration</title>
<link>http://feedproxy.google.com/~r/DirtyReadsAndOtherFilthyTales/~3/yxHdr-PsX_Q/dbas-behaving-badly-710-manual-administration.html</link>
<description>Imagine for a moment it's late one Friday afternoon, and like a scene from Office Space, you try and avoid the boss on the way out the door. Before you make it out, he grabs you and tells you that...</description>
<content:encoded><![CDATA[<p>Imagine for a moment it&#39;s late one Friday afternoon, and like a scene from <a href="http://www.youtube.com/watch?v=_v90q0ydxMI" target="_blank">Office Space</a>, you try and avoid the boss on the way out the door. Before you make it out, he grabs you and tells you that you&#39;ve just got another 10,000 SQL Servers to manage ....</p><p><em>&quot;I&#39;m gonna need you to go ahead and come in tomorrow...&quot;<br /><br /><a href="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a4ee15da970b-pi" style="display: inline;"><img alt="Office_space_bobbleheads" border="0" class="at-xid-6a0111684623b6970c0120a4ee15da970b " src="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a4ee15da970b-800wi" title="Office_space_bobbleheads" /></a> <br />&quot;Oh.... and I&#39;m gonna need you to come in on Sunday as well ... mmmkay?&quot;</em></p><br /><p><br />I can joke about this, but for some of you this is probably all too real. In that context, let&#39;s examine some common worst practices, beginning with ....</p><p><span style="font-size: 18px; font-family: Trebuchet MS;">Manual Administration</span></p><p>One of the common things I come across are DBAs who start with a very small number of servers to manage, and they manage them using a very manual technique. By that I mean using Management Studio wizards, for example, to backup databases, check logs and so forth...</p><p>Sometimes those DBAs are part time or “accidental” DBAs, for example, developers that have taken on a DBA role, or sometimes they just fall into the process of doing things in a manual manner.</p><p>Now managing one or two servers like that might be fine, but the problems begin as the number of servers increase, and unless the technique changes, those DBAs often end up running around in circles responding to whoever screams the loudest, which is not cool.</p><p>The fact is, there is simply no substitute for automation - <strong><em>automation enables more things to be achieved with fewer mistakes in a given amount of time</em></strong>. And what that means, is that there’s more time in the day for more pleasurable things – training, reading the newspaper, beer, golf or whatever floats the boat.</p><p>Essentially, if anything needs to be done more than once, it should be scripted, and created in a manner that enables it to be scheduled for execution, with a monitoring and alerting component placed over the top.</p><p>The other issue at play here is that during disaster recovery situations, scripts are absolutely crucial in getting things restored as quickly as possible – The alternative, that is running around manually poking things while under pressure, is rarely a good look.</p><p>Let’s continue by taking a look at the importance of alerts.<br /><span style="font-size: 18px; font-family: Trebuchet MS;"><br />Not defining Alerts</span></p><p>One of the things that becomes very clear when dealing with a large number of servers is that you end up “managing by exception”. What that means is that you spend all of your time dealing with the things that go wrong, and the more servers you have, the more things that go wrong, increasing the need for proactive management.</p><p>Now, there’s two approaches to discovering things that go wrong; The first is to sit back and wait for people to start screaming, and the second is to define alerts, which help us discover problems before users do.</p><p>Alerts enable us to define the acceptable operating conditions, and to be notified when something falls outside that range – and that’s really the only efficient option for large environments. </p><p>For example, at a minimum, we should define alerts for SQL Agent job failures and high severity errors, but also for performance conditions. For example, we could define an alert for when batches/sec or CPU utilization reaches a critical level, at which performance is known to degrade. That would enable us to take actions, such as shutting down non essential processes like ad hoc reports or batch archiving.</p><p>One other thing I wanted to mention before moving on was what type of errors we should be creating alerts for. The classic alert setup is for errors of severity 19 +, but as per <a href="http://www.sqlskills.com/BLOGS/PAUL/post/A-little-known-sign-of-impending-doom-error-825.aspx" target="_blank">this post from Paul Randal </a>earlier this year, such a scheme often misses important events such as error 825.</p><p>One of the many really cool things that Tibor Karaszi has done is create a <a href="http://www.karaszi.com/SQLServer/util_agent_alerts.asp" target="_blank">SQL Agent Alerts Management Pack</a>, which is essentially a T-SQL script to create alerts for all of the major errors and events that we should be looking out for, including error 825. So in the absence of anything else, this is a great starting point.</p><p>Before finishing, let’s cover off one final thing, and that’s the creation of a task list.</p><p><span style="font-size: 18px; font-family: Trebuchet MS;">No Task/Check List</span></p><p>Regardless of the level of automation or 3rd party monitoring, one of the things I think is important is having a basic checklist of daily, weekly and monthly tasks.</p><p>Checklists are essential in many industries, aviation for example, and provide the framework within which we can automate jobs, bring newly hired DBAs up to speed, and various other things. So included here is a checklist I like to use myself.</p><p><img alt="" src="file:///C:/Users/rod/AppData/Local/Temp/moz-screenshot-1.jpg" /><a href="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a5453c57970c-pi" style="display: inline;"><img alt="Checklist" border="0" class="at-xid-6a0111684623b6970c0120a5453c57970c image-full " src="http://www.rodcolledge.com/.a/6a0111684623b6970c0120a5453c57970c-800wi" title="Checklist" /></a> </p><p>Obviously a lot of these checks can be automated – The important thing is having a documented starting point from which to automate.</p><p>In closing, it would be silly of me to write this post without talking about my favorite new feature in SQL Server 2008 ...</p><p><span style="font-size: 18px; font-family: Trebuchet MS;">Policy Based Management </span>(to the rescue)</p><p>Imagine for a moment you’re the new DBA of a company with thousands of servers across development, test and production and you’re asked to ensure all servers adhere to best practices.</p><p>If you were handy with scripting languages such as powershell, that would certainly help, but without those skills, you’d be basically manually checking and fixing each server – A massive task, and by the time you finished, how could you be certain that none of the servers had reverted back to a poor configuration?</p><p>Policy based management is purpose built to address this problem.</p><p>Essentially what we can do is to start moving from “exception” based management to “intent” based management – in other words – “make this production server like all those other production servers&quot;. Best of all, when something happens that causes it to deviate from the intended state, we can either prevent the change (depending on the type of change made), or be alerted to it.</p><p>For those not familiar with this new feature, check out <a href="http://edge.technet.com/Media/SQL-Server-2008-Policy-Based-Management-Interview/" target="_blank">this interview with Dan Jones</a>. It&#39;s the only way to fly.</p><p>Cheers,<br />Rod.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=yxHdr-PsX_Q:4hlMvxdfG3s:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?i=yxHdr-PsX_Q:4hlMvxdfG3s:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=yxHdr-PsX_Q:4hlMvxdfG3s:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DirtyReadsAndOtherFilthyTales/~4/yxHdr-PsX_Q" height="1" width="1"/>]]></content:encoded>


<dc:subject>DBA</dc:subject>

<dc:creator>Rod Colledge</dc:creator>
<dc:date>2009-08-13T21:02:09+10:00</dc:date>
<feedburner:origLink>http://www.rodcolledge.com/rod_colledge/2009/08/dbas-behaving-badly-710-manual-administration.html</feedburner:origLink></item>
<item rdf:about="http://www.rodcolledge.com/rod_colledge/2009/07/dmvs-and-autoclose.html">
<title>DMVs and Autoclose</title>
<link>http://feedproxy.google.com/~r/DirtyReadsAndOtherFilthyTales/~3/yQCyHbFuFNA/dmvs-and-autoclose.html</link>
<description>Its a well known fact that restarting SQL Server will reset the contents of most Dynamic Management Views (DMVs). What's less well known are the other ways these DMVs are reset. The other night I was preparing the indexing component...</description>
<content:encoded><![CDATA[<p>Its a well known fact that restarting SQL Server will reset the contents of most Dynamic Management Views (DMVs). What&#39;s less well known are the other ways these DMVs are reset.</p><p>The other night I was preparing the indexing component of my <a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/DBAsBehavingBadlyWorstPracticesfor.aspx" target="_blank">worst practices session for this year&#39;s SQLPass summit</a>, and I was confused as to why the contents of the sys.dm_db_index_usage_stats was completely empty after I&#39;d just ran a script to &quot;warm up&quot; the database by running some queries.</p><p>It turns out that I&#39;d enabled the AutoClose option on the database in order to trigger an alert from my Policy Based Management policy I&#39;d setup the previous night. Having the memory of a aging fish, I&#39;d completely forgotten about it. After running the warm up script, I closed the query window, which triggered the autoclose event, as that was the only remaining connection to the database.</p><p>DMV contents are reset under the following conditions;</p><ol>
<li>SQL Server restart,</li>
<li>AutoClose events,</li>
<li>Taking a database offline</li>
</ol>
<p>When assessing the contents of a DMV, be sure to think about when any of the above events last occurred.</p><p>Cheers,<br />Rod.</p><p>PS: <a href="http://www.manning.com/colledge/" target="_blank">My book</a> is at the printers :-) Read Kevin Kline&#39;s forward <a href="http://www.manning.com/colledge/excerpt_foreword.html" target="_blank">here</a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=yQCyHbFuFNA:hkU2D0-ROOQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?i=yQCyHbFuFNA:hkU2D0-ROOQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=yQCyHbFuFNA:hkU2D0-ROOQ:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DirtyReadsAndOtherFilthyTales/~4/yQCyHbFuFNA" height="1" width="1"/>]]></content:encoded>


<dc:subject>DBA</dc:subject>

<dc:creator>Rod Colledge</dc:creator>
<dc:date>2009-07-30T20:21:49+10:00</dc:date>
<feedburner:origLink>http://www.rodcolledge.com/rod_colledge/2009/07/dmvs-and-autoclose.html</feedburner:origLink></item>
<item rdf:about="http://www.rodcolledge.com/rod_colledge/2009/07/dbas-behaving-badly-610-indexes.html">
<title>DBAs Behaving Badly (6/10): Indexes</title>
<link>http://feedproxy.google.com/~r/DirtyReadsAndOtherFilthyTales/~3/nK0vkwPhyMY/dbas-behaving-badly-610-indexes.html</link>
<description>In my experience, indexing problems can typically be traced back to one of two sources. The first is developers who don't create indexes either because they don't know what they are, assume the DBA will take care of it in...</description>
<content:encoded><![CDATA[<p>In my experience, indexing problems can typically be traced back to one of two sources. </p><p>The first is developers who don&#39;t create indexes either because they don&#39;t know what they are, assume the DBA will take care of it in production, or assume they&#39;re not needed thinking that production performance will be comparable to a small development database.</p><p>The common outcome from this scenario is gradually declining production performance, often leading to false assertions about the adequacy of the hardware and/or SQL Server itself.</p><p>The second source is DBAs without index analysis knowledge, who are unsure of how to go about the process of determining which indexes are missing, which are not used, and which require maintenance. </p><p>A common outcome from this second group are databases that look like they&#39;ve been carpet bombed with indexes by someone hoping that performance will eventually improve with the addition of more and more indexes.</p><p>So for the first of our three indexing worst practices, let’s look at situations in which there are either too many or not enough indexes.</p><p><span style="font-size: 18px; font-family: Trebuchet MS;">Too many/not enough</span></p><p>Not having the required indexes will cause SQL Server to read more data than necessary from disk, leading to more disk I/O and therefore less available memory - a classic double whammy.</p><p>Almost as bad, having <em>too many </em>indexes leads to more overhead for data modification statements – SQL Server has to maintain the indexes even though they’re never actually used.</p><p>The first thing to say about these two situations is that with an adequate load testing environment, this should never really occur in the first place. If the database is stressed with the expected level of production activity, most of these problems would be identified before they become apparent in production.</p><p>Having said that, load testing is always a bit of a guessing game as to what the expected production load will be, and depending on the load testing tools and techniques, may not produce an accurate load profile anyway. </p><p>So we need to ensure that we’re analysing index usage and fragmentation on a regular basis, and in this regard, both SQL Server 2005 and 2008 have made this process much easier.</p><p>Rather than regurgitate Books Online, I’ll point you in the direction of <a href="http://blogs.msdn.com/bartd/archive/2007/07/19/are-you-using-sql-s-missing-index-dmvs.aspx" target="_blank">this blog post from Bart Duncan on discovering missing indexes</a> and <a href="http://statisticsio.com/Home/tabid/36/articleType/ArticleView/articleId/320/Updated-Unused-Index-Query.aspx" target="_blank">this blog post from Jason Massie on analysing index usage</a>.</p><p><br /><span style="font-size: 18px; font-family: Trebuchet MS;">Updating Statistics after Index Rebuild</span></p><p>So now for our second worst practice, and I have to say one of my favourites, and that’s updating statistics after an index rebuild.</p><p>SQL Server keeps statistics on both indexes and columns which help it decide how it will process each query. Because certain index lookups require two actions for each matching row, that is, look up the index, and then look up the table entry, for queries that will return a lot of rows, it may be quicker to simply scan the table rather than use the index.</p><p>Table scans use sequential I/O, index lookups use random I/O. Because moving the disk heads around during random I/O is much slower than scanning a sequential chunk of data, it’s important that SQL Server only use random I/O index lookups for queries that return a low percentage of rows compared to the total table size.</p><p>In order for SQL Server to determine the estimated number of rows to be returned from a query, it keeps statistics on both indexes and columns. For example, it will store the fact that a given table contains a million people with the surname “Smith” and only two with the surname “Zatorsky”, and that gives it the best chance of determining the best query plan to use for a surname based lookup, i.e.; table scan or index lookup.</p><p>So getting backup to the worst practice, I refer your attention to the following screen shot of a SQL Server 2008 Maintenance Plan.</p><p><img alt="" src="file:///C:/Users/rod/AppData/Local/Temp/moz-screenshot.jpg" /><a href="http://www.rodcolledge.com/.a/6a0111684623b6970c0115714c0492970c-pi" style="display: inline;"><img alt="Maint" border="0" class="at-xid-6a0111684623b6970c0115714c0492970c image-full " src="http://www.rodcolledge.com/.a/6a0111684623b6970c0115714c0492970c-800wi" title="Maint" /></a> </p><p>You’ll notice on the left of screen, we have 2 steps, the first to rebuild indexes, and the second to update statistics. The properties window on the right side of screen contains the default values for the update statistics task.</p><p>One of the things that happens when rebuilding an index is that the statistics for that index are updated “in full”, that is, the statistics will be perfect, given that SQL Server has to read every single row when rebuilding the index. </p><p>So after rebuilding it, there’s no need to update the index statistics. If you do, you’re effectively building the index statistics twice, and for large indexes, that’s an unnecessary and costly overhead.</p><p>You’ll also notice in the scan type section, the choice between “Full scan” and “Sample by”.&#0160; The &quot;Sample by&quot; option is designed for speed, whereby it will sample a certain percentage of rows rather than the full set – the idea being a trade off between build time and statistics accuracy.</p><p>In earlier versions of SQL Server, this was a particular problem, as the &quot;Full scan&quot; option at the bottom there, wasn’t available in the maintenance plans, so people would often rebuild an index, and then proceed to replace a full set of statistics with a sample set. In 2008, the default option, as you can see, is a full scan, which means that rather than replace perfect stats with sample stats, they’re rebuilt twice – still bad, but probably better than replacing good stats with less accurate ones.</p><p>So, the recommendation here is that after rebuilding indexes, rather than update &quot;All existing statistics&quot;, we update &quot;Column statistics only&quot;, shown above by the red bar around the option. Column statistics are not touched by the index rebuild process, so using this option limits the work done by SQL Server, and in the case of very large databases, this option can save a massive amount of time, therefore shortening mainatenance windows.</p><p><span style="font-size: 18px; font-family: Trebuchet MS;">Inappropriate Index Maintenance</span></p><p>As equally important as having the right amount of indexes, is making sure that indexes are appropriately maintained. Like any other disk object, indexes become fragmented over time through the normal course of inserts, deletes and updates. In addressing this, indexes in SQL Server can be either rebuilt or defragmented - now referred to as “reorganized”.</p><p>Compared to defragging or reorganizing an index, rebuilding will achieve the best result from a fragmentation perspective, however, there are a couple of downsides. </p><p>Firstly, unless you have the Enterprise edition of SQL Server, rebuilding an index is an offline operation, meaning that the index is unavailable during the rebuild. </p><p>Secondly, rebuilding an index is a fully logged operation, meaning that the transaction log will grow much more when compared to reorganizing, and for installations which use Log Shipping or Database Mirroring, this can have a significant impact, particularly when using high safety mode mirroring or when disk space is a problem.</p><p>So when I say inappropriate index maintenance, what I’m talking about is really one of two things; either not maintaining them at all, or choosing rebuild over reorganize or vice versa. </p><p>The classic rule of thumb is that for indexes with a 5 – 30 % fragmentation level, we defragment / reorganize, and indexes with more than 30% we rebuild, assuming we can either cope with the outage, or we have the Enterprise edition of SQL Server.&#0160; This technique usually delivers the best bang for the buck – a minimum amount of disk usage and overhead for the maximum amount of performance gain.</p><p>From an fragmentation analysis perspective, sys.dm_db_index_physical_stats is a crucial component of any index maintenance plan. One of the great things we can do with this DMV is use it as part of an automated script, and Books Online actually provides the code to do exactly that.</p><p>Included below is a screen shot from the “sys.dm_db_index_physical_stats” article in Books Online. It shows some of the code from a cursor that loops through each index in the DMV looking at the fragmentation level, and depending on the percentage, either rebuilds it or reorganizes it.</p><p><a href="http://www.rodcolledge.com/.a/6a0111684623b6970c011572406f96970b-pi" style="display: inline;"><img alt="BOL" border="0" class="at-xid-6a0111684623b6970c011572406f96970b image-full " src="http://www.rodcolledge.com/.a/6a0111684623b6970c011572406f96970b-800wi" title="BOL" /></a> </p><p>All of this code is freely available in Books Online, and provides a much better alternative than a simple rebuild of all indexes every night, or worse, no maintenance at all. For more boutique and full featured solutions, be sure to check out <a href="http://ola.hallengren.com" target="_blank">Ola Hallengren&#39;s solution</a> and <a href="http://sqlfool.com/2009/06/index-defrag-script-v30/" target="_blank">Michelle Ufford&#39;s solution</a>.</p><p>In the next post in this series, we&#39;ll examine DBCC worst practices.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=nK0vkwPhyMY:RPgNEqttezA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?i=nK0vkwPhyMY:RPgNEqttezA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=nK0vkwPhyMY:RPgNEqttezA:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DirtyReadsAndOtherFilthyTales/~4/nK0vkwPhyMY" height="1" width="1"/>]]></content:encoded>


<dc:subject>DBA</dc:subject>

<dc:creator>Rod Colledge</dc:creator>
<dc:date>2009-07-28T22:03:10+10:00</dc:date>
<feedburner:origLink>http://www.rodcolledge.com/rod_colledge/2009/07/dbas-behaving-badly-610-indexes.html</feedburner:origLink></item>
<item rdf:about="http://www.rodcolledge.com/rod_colledge/2009/07/top-5-reasons-your-business-intelligence-project-will-fail.html">
<title>Top 5 Reasons Why Your Business Intelligence Project Will Fail</title>
<link>http://feedproxy.google.com/~r/DirtyReadsAndOtherFilthyTales/~3/hY8Y0bxqpBA/top-5-reasons-your-business-intelligence-project-will-fail.html</link>
<description>Lack of business support; BI projects set themselves a much higher bar compared to “normal” projects. When (and I intentionally exclude “if”) the project is delayed, or fails to fully meet the expectations it sets for itself, having the support...</description>
<content:encoded><![CDATA[<ol>
<li><em><strong>Lack of business support; </strong></em>BI projects set themselves a much higher bar compared to “normal” projects. When (and I intentionally exclude “if”) the project is delayed, or fails to fully meet the expectations it sets for itself, having the support of people with a decision making capacity is critical.</li>
<li><em><strong>Poor data quality;</strong></em> Other than lack of business support, nothing kills a BI/Data Warehousing project quicker than poor data quality. Other systems may be able to hide poor quality data, but it’s fully exposed in a BI solution. The two most common outcomes when dealing with poor data quality are ETL processes failing, for example, duplicate primary keys from unexpected data patterns, and decisions made on the basis of incorrect data. In such cases, the reliability and accuracy of the system will be questioned, and the business will then start to question the investment in the system itself. See point 1.</li>
<li><em><strong>Trying to be all things to all people;</strong></em> Promising the business a swift passage to the land of milk and honey often leads to disappointment when the high expectations cannot be met. Terms such as “Data Mining” and “Predictive Data Analysis” roll off the tongue, and powerpoint presentations make these things seem dead simple; the reality of course is that they’re difficult to implement properly, and very few projects deliver on the promise sold to the business.</li>
<li><em><strong>Early release of Ad-Hoc reporting tools; </strong></em>Continuing on from the previous point, projects that try and solve every problem ASAP often fall into the trap of releasing ad-hoc reporting tools (e.g.; Microsoft Report Builder) early, convincing themselves that the users can help themselves to the data however (and whenever) they like it. The problem of course, is that trying to build report models that enable such user access whilst avoiding performance problems and user frustrations is very difficult. Further, letting users help themselves often means that the ability to capture business requirements (and therefore build an appropriate BI solution) is compromised. See my previous post on this topic, <a href="http://www.rodcolledge.com/rod_colledge/2009/02/herding-cats-dealing-with-open-ended-reporting-requirements.html" target="_blank">Herding Cats: Dealing with open ended reporting requirements</a>.</li>
<li><em><strong>Not employing BI specialists;</strong></em> BI specialists are hard to find (and they’re typically expensive). There’s a world of difference between designing a database, designing an application and designing multi-dimensional cubes (properly). Don’t fall for the trap of expecting a DBA or .Net developer to pickup the skills needed, and therefore save money on staff overhead.</li>
</ol>
<p>Antidotes to the above;</p><ol>
<li>Identify an <em><strong>influential sponsor </strong></em>early, keep them regularly updated of progress and risks, and give them the information they need to communicate to the rest of the decision makers.</li>
<li>Ideally, ensure the source systems have a <em><strong>rigorous data validation module </strong></em>(DVM) built into them to prevent poor data from becoming an issue in the first place. Failing that (almost always the case) ensure the BI solution’s ETL processes cater for a vast array of potential data quality issues and either prevent dubious data from entering the BI solution, or build data quality reports to communicate the problems back to the administrators of the source systems.</li>
<li><em><strong>Start small. </strong></em>Be agile. Be realistic. Fully solve a small number of business problems properly before attempting to solve everything at once. Use your business sponsor to spread the word, and feed off the early successes.</li>
<li><em><strong>Resist the temptation to release ad-hoc reporting tools </strong></em>as long as possible. Understand the business requirements for user reports, and build the appropriate canned reports or cubes to meet those requirements. Such solutions are much more controlled, and therefore have a much better chance of meeting the performance and functional expectations of the largest number of end users.</li>
<li><em><strong>Engage with appropriately qualified BI specialists </strong></em>as soon as possible, ideally those that have experienced failure on a previous BI project. Their skills and experience will save you a massive amount of time (and money) in the long term, despite the short term spike in staff costs.</li>
</ol><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=hY8Y0bxqpBA:P9jhHignbMM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?i=hY8Y0bxqpBA:P9jhHignbMM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?a=hY8Y0bxqpBA:P9jhHignbMM:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DirtyReadsAndOtherFilthyTales?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DirtyReadsAndOtherFilthyTales/~4/hY8Y0bxqpBA" height="1" width="1"/>]]></content:encoded>


<dc:subject>Industry</dc:subject>

<dc:creator>Rod Colledge</dc:creator>
<dc:date>2009-07-15T23:00:27+10:00</dc:date>
<feedburner:origLink>http://www.rodcolledge.com/rod_colledge/2009/07/top-5-reasons-your-business-intelligence-project-will-fail.html</feedburner:origLink></item>


</rdf:RDF><!-- ph=1 --><!-- nhm:dynamic-ssi -->
