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

<channel>
	<title>Cranky DBA</title>
	<atom:link href="http://crankydba.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://crankydba.com</link>
	<description>Mike Hillwig thinks you&#039;re entitled to his opinion.</description>
	<lastBuildDate>Fri, 11 May 2012 01:29:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How Not to be a Cranky DBA #NESQL</title>
		<link>http://crankydba.com/2012/05/10/how-not-to-be-a-cranky-dba-nesql/</link>
		<comments>http://crankydba.com/2012/05/10/how-not-to-be-a-cranky-dba-nesql/#comments</comments>
		<pubDate>Fri, 11 May 2012 00:00:56 +0000</pubDate>
		<dc:creator>Mike Hillwig</dc:creator>
				<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://crankydba.com/?p=735</guid>
		<description><![CDATA[Tonight was the May meeting of the New England SQL Server User Group (NESQL) and I was the presenter. It was exciting, and a bit scary. Still, I had a lot of fun, and the audience was pretty receptive. If you were there, thank you for having me. Here is the slide deck. It was [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight was the May meeting of the New England SQL Server User Group (NESQL) and I was the presenter. It was exciting, and a bit scary. Still, I had a lot of fun, and the audience was pretty receptive. If you were there, thank you for having me.
<p>
Here is the slide deck. It was a lot of fun to assemble.
<div style="width:425px" id="__ss_12885636"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/mikehillwig/how-not-to-be-a-cranky-dba-12885636" title="How not to be a cranky dba" target="_blank">How not to be a cranky dba</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/12885636" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/thecroaker/death-by-powerpoint" target="_blank">PowerPoint</a> from <a href="http://www.slideshare.net/mikehillwig" target="_blank">Mike Hillwig</a> </div>
</p></div>
<p>If you attended the presentation, I would ask that you take a moment to do a review on speakkerrate.
<p>
<script src="http://speakerrate.com/talks/10511/widget.js" id="speakerrate-widget-10511"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://crankydba.com/2012/05/10/how-not-to-be-a-cranky-dba-nesql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Coming to #NESQL How Not to Be a Cranky DBA</title>
		<link>http://crankydba.com/2012/05/01/coming-to-nesql-how-not-to-be-a-cranky-dba/</link>
		<comments>http://crankydba.com/2012/05/01/coming-to-nesql-how-not-to-be-a-cranky-dba/#comments</comments>
		<pubDate>Tue, 01 May 2012 13:00:19 +0000</pubDate>
		<dc:creator>Mike Hillwig</dc:creator>
				<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://crankydba.com/?p=708</guid>
		<description><![CDATA[On Thursday, May 10, I will be presenting at the New England SQL Server User Group at Microsoft in Waltham. Details can be found here. I&#8217;m pretty excited because this is one of the largest SQL user groups in the country. At the same time, this completely scares the bejeezus out of me because this [...]]]></description>
			<content:encoded><![CDATA[<p>On Thursday, May 10, I will be presenting at the New England SQL Server User Group at Microsoft in Waltham. Details can be found <a href="http://nesql.org/Home/tabid/75/ModuleID/402/ItemID/55/mctl/EventDetails/Default.aspx" target="_blank">here</a>. I&#8217;m pretty excited because this is one of the largest SQL user groups in the country. At the same time, this completely scares the bejeezus out of me because this is one of the largest SQL user groups in the country. There is a volcanic amount of brain power in this room.</p>
<p>When Adam Machanic (<a href="http://sqlblog.com/blogs/adam_machanic/" target="_blank">blog</a> | <a href="http://twitter.com/adammachanic" target="_blank">twitter</a>) asked me if I&#8217;d speak, I jumped at the chance. We started brainstorming my topic and I sent him the slide decks of my two &#8220;top ten&#8221; presentations. He suggested that we combine them and polish up the title a bit. And that&#8217;s how &#8220;How Not to Be a Cranky DBA&#8221; was born.</p>
<p>As I&#8217;ve been preparing my slide deck, I realized that this user group gets some fantastic speakers. We&#8217;ve had <a href="http://brentozar.com" target="_blank">Brent Ozar</a>, <a href="http://www.scarydba.com/" target="_blank">Grant Fritchey</a>, <a href="http://sqlblog.com/blogs/aaron_bertrand/" target="_blank">Aaron Bertrand</a>, and of course, Adam Machanic. These aren&#8217;t exactly second stringers. These are big names in the SQL Server community, and I&#8217;m being given some really big shoes to fill. This is a really big deal for me, and I need to bring my A game. I&#8217;ve spent a good deal of time making my slides visually appealing and choosing the stories I want to tell.</p>
<p>One of the things I like about this topic is that it&#8217;s all story telling and no demo. Anyone who knows me knows that I love to tell stories, and this is a whole presentation full of them.</p>
<p>Come join us for an evening of SQL goodness.</p>
]]></content:encoded>
			<wfw:commentRss>http://crankydba.com/2012/05/01/coming-to-nesql-how-not-to-be-a-cranky-dba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sports Analogies</title>
		<link>http://crankydba.com/2012/03/15/sports-analogies/</link>
		<comments>http://crankydba.com/2012/03/15/sports-analogies/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 17:12:51 +0000</pubDate>
		<dc:creator>Mike Hillwig</dc:creator>
				<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://crankydba.com/?p=697</guid>
		<description><![CDATA[I&#8217;m not exactly a sports fan. Not even close. But every once in a while, I will use a sports analogy that would make my dad proud. A couple of weeks ago, I was troubleshooting a performance problem. Every fifteen minutes, a group servers would start paging and our IO waits would skyrocket. It was [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not exactly a sports fan. Not even close. But every once in a while, I will use a sports analogy that would make my dad proud.</p>
<p>A couple of weeks ago, I was troubleshooting a performance problem. Every fifteen minutes, a group servers would start paging and our IO waits would skyrocket. It was pretty easy to looking for the culprit. All we needed to do was find whatever processes were running every fifteen minutes. In this case, it was our transaction log backups.</p>
<p>The application on this group of servers uses a series of twenty databases (which is another post for another day) and the transaction logs backups were all configured to kick off at the same time. I wanted my servers to run them serially instead of all at once.  My boss is a golfer, and I explained that we were doing a scramble instead of a shotgun. She completely got it. You could say I hit it out of the park. Oh, wait. Mixing analogies probably isn&#8217;t a good idea here.</p>
<p>One of the lessons learned in this process (and I thank <a href="http://littlekendra.com" target="_blank">Kendra Little</a> for her help in this) is that the log shipping engine on the target side wants the filename in a specific format. While I was at it, I converted the timestamp to UTC to match how the log shipping process names its file.</p>
<p>The second lesson learned here is that the schedule for the backup job should vary every so slightly than the LSCopy job on the target server. Assuming your servers have synchronized times, you will be doing a copy at the same time as the backup. That&#8217;s causing a little bit of disk contention. You also run the risk of your DR site being behind production the length of your repeat interval. In my case, that was fifteen minutes. What I did was set my backups to start at the top of the hour, repeating every 15 minutes. The LSCopy schedule to start three minutes after the top of the hour, repeating every fifteen minutes. That means my DR server is about three minutes behind production.</p>
<p>The third lesson here is that the SQL Server Agent doesn&#8217;t appear to be covered in the MIN and MAX RAM setting on your instance. Since we were copying some pretty big files across the network, that SQL Server Agent was sucking up a hefty amount of RAM, causing the server to page.  I had to lower the MAX RAM setting. Imagine explaining why you wanted to give a client&#8217;s database server less RAM than it already had.</p>
<pre>
SET QUOTED_IDENTIFIER ON;
 DECLARE @v_LocalDrive nvarchar(1)
 DECLARE @v_LocalFolder nvarchar(50)
 declare @v_timestamp nvarchar(30)
 SELECT @v_LocalDrive = 'd'
 SELECT @v_LocalFolder = 'tlogs'
 DECLARE @v_dbname nvarchar(100)
 DECLARE @v_SQL nvarchar(1000)
 DECLARE c_databases CURSOR FOR
 select name
 from sys.databases
 where recovery_model = 1
 and database_id &gt; 4
 ORDER BY [name]
 OPEN c_databases
 FETCH NEXT FROM c_databases INTO @v_dbname
 WHILE (@@fetch_status &lt;&gt; -1)
 BEGIN
 IF (@@fetch_status &lt;&gt; -2)
 BEGIN
 select @v_timestamp = convert(nvarchar, GETUTCDATE(), 112) + RIGHT('00'+ convert(varchar, datepart (hh, GETUTCDATE())),2)
 + RIGHT('00'+ convert(varchar, datepart (minute, GETUTCDATE())),2) + RIGHT('00'+ convert(varchar, datepart (ss, GETUTCDATE())),2)
 SELECT @v_SQL = 'BACKUP LOG [' + @v_dbname + '] to DISK = N''' + @v_LocalDrive + ':\' + @v_LocalFolder + '\' + @v_dbname + '_' + @v_timestamp + '.trn''' +' WITH NOFORMAT, NOINIT, NAME = N'''+ @v_dbname + '_' + @v_timestamp + ''', SKIP, REWIND, NOUNLOAD, STATS = 10'
 exec (@v_SQL)
 END
 FETCH NEXT FROM c_databases INTO @v_dbname
 END
 CLOSE c_databases
 DEALLOCATE c_databases</pre>
]]></content:encoded>
			<wfw:commentRss>http://crankydba.com/2012/03/15/sports-analogies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More Interview Questions</title>
		<link>http://crankydba.com/2012/02/09/more-interview-questions/</link>
		<comments>http://crankydba.com/2012/02/09/more-interview-questions/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 19:17:27 +0000</pubDate>
		<dc:creator>Mike Hillwig</dc:creator>
				<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://crankydba.com/?p=690</guid>
		<description><![CDATA[I wrote a post many months ago with some interview questions for my old boss to use when searching for my replacement. Tomorrow, we have a candidate interviewing to join our team.  Here are a few things from the top of my head that I just might ask. You&#8217;ll need to find your own answers, [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a <a title="Interview Questions" href="http://crankydba.com/2011/06/08/interview-questions/">post</a> many months ago with some interview questions for my old boss to use when searching for my replacement. Tomorrow, we have a candidate interviewing to join our team.  Here are a few things from the top of my head that I just might ask. You&#8217;ll need to find your own answers, though.</p>
<ul>
<li>Tell me about VLFs</li>
<li>Do you have any experience with MSX-TSX relationships in the SQL Server Agent?</li>
<li>How do you maintain INDEXes and STATISTICS in your environment today? How could you improve that?</li>
<li>When would you disable auto update of statistics?</li>
<li>How do you keep your skills current with SQL Server technology?</li>
<li>What&#8217;s the most compelling reason to upgrade from SQL 2005 to SQL 2008 R2?</li>
<li>What&#8217;s the biggest mistake you see other SQL Server DBAs make?</li>
<li>What&#8217;s your worse habit as a DBA?</li>
<li>Are you familiar with the PASS Summit or local chapters?</li>
<li>With what trace flags are you familiar?</li>
<li>What are the two types of authentication? Which is more secure?</li>
<li>Which will be faster, inserting a million rows of data or updating a million rows of data? (shamelessly stolen from <a href="http://thomaslarock.com/2012/01/the-5-dba-interview-questions-you-have-to-ask/" target="_blank">Tom LaRock</a>)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://crankydba.com/2012/02/09/more-interview-questions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selectively Updating Statistics</title>
		<link>http://crankydba.com/2012/02/03/selectively-updating-statistics/</link>
		<comments>http://crankydba.com/2012/02/03/selectively-updating-statistics/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 13:00:47 +0000</pubDate>
		<dc:creator>Mike Hillwig</dc:creator>
				<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://crankydba.com/?p=666</guid>
		<description><![CDATA[Most blogs should have a disclaimer that your mileage may vary. That&#8217;s not the case here. I can assure you that your mileage will vary. Test this before you run it against your 12 TB production data warehouse. I recently inherited a few servers that have autoupdate of statistics disabled. That&#8217;s a long story.  In [...]]]></description>
			<content:encoded><![CDATA[<p>Most blogs should have a disclaimer that your mileage may vary. That&#8217;s not the case here. I can assure you that your mileage <strong><em>will</em></strong> vary. Test this before you run it against your 12 TB production data warehouse.</p>
<p>I recently inherited a few servers that have autoupdate of statistics disabled. That&#8217;s a long story.  In other cases, we want to manually update statistics because it may take a quite some time for SQL Server to detect that it has stale statistics. We were running a script that updates all statistics across all indexes on all tables in all databases. And it was taking forever.</p>
<p>One day it hit me.</p>
<p>We&#8217;re running <a href="http://sqlfool.com" target="_blank">Michelle Ufford</a>&#8216;s <a href="http://sqlfool.com/2011/06/index-defrag-script-v4-1/" target="_blank">script</a> to reorganize and rebuild indexes. What if we could do the same for statistics? Why were we forcing the update of statistics on a static table? With a little bit of help from a <a href="http://www.littlekendra.com/2009/04/21/how-stale-are-my-statistics/" target="_blank">script</a> that <a href="http://www.littlekendra.com/" target="_blank">Kendra Little</a> wrote, I was able to put together a process that will dynamically update statistics only where needed. And we added a little more logic to set the sample rate as well. For small tables, doing a full scan makes more sense. But for large tables, this a smaller sample size is needed.</p>
<p>A lot of the values are hard coded here and should be moved to parameters. Maybe in the next version. This thing looks for five percent or 1000 rows, whichever comes first. It works in my environment. Your mileage <em><strong>will</strong></em> vary.</p>
<pre>-- Dynamic Database Statistics Update
--
-- Created: Mike Hillwig
-- 01/26/2012
--
create table #statsmaint
(databasename varchar(100),
schemaname varchar(100),
tablename varchar(100),
indexname varchar(100),
rowsupdated int,
totalrows int)
--- Stats calculation adapted from Kendra Little's script found at
--- http://www.littlekendra.com/2009/04/21/how-stale-are-my-statistics/
exec sp_msforeachdb 'use ?;
INSERT #statsmaint
SELECT DISTINCT
''?''
, s.name
, tablename=object_name(i.object_id)
,index_name=i.[name]
, si.rowmodctr
, si.rowcnt
FROM sys.indexes i (nolock)
JOIN sys.objects o (nolock) on
i.object_id=o.object_id
JOIN sys.schemas s (nolock) on
o.schema_id = s.schema_id
JOIN sys.sysindexes si (nolock) on
i.object_id=si.id
and i.index_id=si.indid
where
STATS_DATE(i.object_id, i.index_id) is not null
and o.type &lt;&gt; ''S''
and (si.rowmodctr &gt; 1000 OR cast(si.rowmodctr as float) / cast (si.rowcnt+1 as float) &gt; .05)
and ''?'' &lt;&gt; ''tempdb''
order by si.rowmodctr desc'
DECLARE @v_dbname varchar(100)
DECLARE @v_schemaname varchar(100)
DECLARE @v_tablename varchar(100)
DECLARE @v_indexname varchar(100)
DECLARE @v_SQL varchar(1000)
DECLARE @v_rowsupdated int
DECLARE @v_percentscan varchar (10)
DECLARE @v_totalrows int
DECLARE c_statistics CURSOR FOR
SELECT databasename, schemaname, tablename, indexname, rowsupdated, totalrows
FROM #statsmaint
OPEN c_statistics
FETCH NEXT FROM c_statistics INTO @v_dbname, @v_schemaname, @v_tablename, @v_indexname, @v_rowsupdated, @v_totalrows
WHILE (@@fetch_status &lt;&gt; -1)
BEGIN
IF (@@fetch_status &lt;&gt; -2)
BEGIN
SELECT @v_percentscan = '100' where @v_totalrows &lt;= 50000
SELECT @v_percentscan = '75' WHERE @v_totalrows BETWEEN 50000 AND 1000000
SELECT @v_percentscan = '50' WHERE @v_totalrows BETWEEN 1000000 AND 10000000
SELECT @v_percentscan = '25' where @v_totalrows &gt; 10000000
select @v_SQL = 'UPDATE STATISTICS ' + @v_dbname + '.' + @v_schemaname + '.' + @v_tablename + ' ' + @v_indexname + ' WITH SAMPLE ' + @v_percentscan + ' PERCENT --' + cast (@v_rowsupdated as varchar) + ' OF ' + cast(@v_totalrows as varchar) + ' ROWS UPDATED. STARTED ' + cast(current_timestamp as varchar)
print @v_sql
exec (@v_sql)
END
FETCH NEXT FROM c_statistics INTO @v_dbname, @v_schemaname, @v_tablename, @v_indexname, @v_rowsupdated, @v_totalrows
END
CLOSE c_statistics
DEALLOCATE c_statistics
drop table #statsmaint</pre>
]]></content:encoded>
			<wfw:commentRss>http://crankydba.com/2012/02/03/selectively-updating-statistics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The PNR Datatype</title>
		<link>http://crankydba.com/2012/02/02/the-pnr-datatype/</link>
		<comments>http://crankydba.com/2012/02/02/the-pnr-datatype/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 20:41:40 +0000</pubDate>
		<dc:creator>Mike Hillwig</dc:creator>
				<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://thecrankydba.com/?p=571</guid>
		<description><![CDATA[About sixty years ago, American Airlines, in conjunction with IBM, revolutionized an industry by introducing the first computer-based inventory management system called SABRE.  This was revolutionary in many ways. Not only did it change the way the travel industry booked plane tickets and hotel rooms, but it also gave the public their first view of [...]]]></description>
			<content:encoded><![CDATA[<p>About sixty years ago, American Airlines, in conjunction with IBM, revolutionized an industry by introducing the first computer-based inventory management system called SABRE.  This was revolutionary in many ways. Not only did it change the way the travel industry booked plane tickets and hotel rooms, but it also gave the public their first view of compuers in practical use. Culturally, this introduced the concept of a confirmation code. SABRE, like other systems, uses a six character code. This is frequently called a PNR or a record locator code. Next time you get a boarding pass for your flight, find your PNR. It&#8217;s not too hard to spot.</p>
<p>SABRE has evolved over the years, but the PNR code has persisted. Imagine making a flight reservation and having them give you a confirmation number that more closely resembled your bank account number. Yuck.</p>
<p>The more I think about this, the more fascinated I am with using a six character code as a data type.  In a modern relational database system, it may be completely impractical. But think back several decades. It was revolutionary.</p>
<p>Imagine using all 26 letters in the English alphabet plus 8 numbers. We don&#8217;t want to use 0 and 1 because they can be confused with O and I, respectively.  That&#8217;s 34^6 or 1,544,804,416 records that can be held before needing to recycle. Even by today&#8217;s standards, it&#8217;s quite a lot of records.</p>
<p>Using this datatype today could be a bit messy. Because we don&#8217;t store things on sequential punch cards, we&#8217;d need to have an algorithm to find the next available value. And putting a clustered index on this as a column would cause page splits for days.</p>
<p>I&#8217;ve been chewing on this idea for close to a year now, and I still can&#8217;t decide if I love it or hate it more.</p>
]]></content:encoded>
			<wfw:commentRss>http://crankydba.com/2012/02/02/the-pnr-datatype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Blogs</title>
		<link>http://crankydba.com/2012/02/01/random-blogs/</link>
		<comments>http://crankydba.com/2012/02/01/random-blogs/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 01:31:04 +0000</pubDate>
		<dc:creator>Mike Hillwig</dc:creator>
				<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://crankydba.com/?p=655</guid>
		<description><![CDATA[A couple of weeks ago, I presented at the SNESSUG and had an excellent time. They&#8217;re a great group and were a lot of fun. One of my slides was to &#8220;Beware of Advice from Random Blogs.&#8221; I say this because there is just so much bad advice out there. Know your sources. Challenge the [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks ago, I presented at the SNESSUG and had an excellent time. They&#8217;re a great group and were a lot of fun. One of my slides was to &#8220;Beware of Advice from Random Blogs.&#8221;</p>
<p><a href="http://crankydba.com/wp-content/uploads/2012/02/Slide06.jpg"><img class="aligncenter size-medium wp-image-656" title="Beware of Advice from Random Blogs" src="http://crankydba.com/wp-content/uploads/2012/02/Slide06-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>I say this because there is just so much bad advice out there. Know your sources. Challenge the stuff you read. And more than anything, make sure you test the hell out of any script you download. Do you really want to run some script you found at Bernard&#8217;s Blog Land against your 12 TB production data warehouse and have it thrashing at your indexes? I certainly wouldn&#8217;t.</p>
<p>I work with a few people that I swear have read a few too many bad blog posts. Some of their suggested &#8220;best practices&#8221; are things that I&#8217;m constantly challenging. These are smart people. But I believe they&#8217;ve read some bad advice.</p>
<p>That said, I read a <a href="http://www.sqlskills.com/blogs/kimberly/post/Auto-update-statistics-and-auto-create-statistics-should-you-leave-them-on-andor-turn-them-on.aspx">blog post</a> from <a href="http://www.sqlskills.com/BLOGS/KIMBERLY/" target="_blank">Kimberly Tripp</a> today that made me giggle. It reaffirms something I&#8217;ve been saying for six months. And this one isn&#8217;t a random blog. So why do I take this one at face value? It comes from a reputable source, someone I&#8217;ve met, and this is someone whose advice has never failed me.</p>
<p>Read the slide above: <em>If it comes from Paul or Kimberly, it&#8217;s true.</em></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://crankydba.com/2012/02/01/random-blogs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top Ten Operational Mistakes at SNESSUG</title>
		<link>http://crankydba.com/2012/01/11/top-ten-operational-mistakes-at-snessug/</link>
		<comments>http://crankydba.com/2012/01/11/top-ten-operational-mistakes-at-snessug/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 15:10:31 +0000</pubDate>
		<dc:creator>Mike Hillwig</dc:creator>
				<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://crankydba.com/?p=645</guid>
		<description><![CDATA[Tonight, I&#8217;m presenting my Top Ten Operational Mistakes at the Southern New England SQL Server User Group  meeting. I gave this presentation at SQL Saturday in South Florida and it was a lot of fun. I&#8217;ve updated it slightly to include a warning on avoiding advice from random bloggers. My benchmark there is if someone [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight, I&#8217;m presenting my Top Ten Operational Mistakes at the <a href="http://www.snessug.org/" target="_blank">Southern New England SQL Server User Group </a> meeting.</p>
<p>I gave this presentation at SQL Saturday in South Florida and it was a lot of fun. I&#8217;ve updated it slightly to include a warning on avoiding advice from random bloggers. My benchmark there is if someone says you should always or never do something, they&#8217;re not right.</p>
<p><a href="http://crankydba.com/wp-content/uploads/2012/01/Top-10-Operational-Mistakes-to-Avoid-2012.pdf">Top 10 Operational Mistakes to Avoid 2012</a></p>
]]></content:encoded>
			<wfw:commentRss>http://crankydba.com/2012/01/11/top-ten-operational-mistakes-at-snessug/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Confirming Objects Modified</title>
		<link>http://crankydba.com/2011/11/15/confirming-objects-modified/</link>
		<comments>http://crankydba.com/2011/11/15/confirming-objects-modified/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 15:12:12 +0000</pubDate>
		<dc:creator>Mike Hillwig</dc:creator>
				<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://crankydba.com/?p=632</guid>
		<description><![CDATA[I work in a hosting environment, and frequently our clients will ask us to promote a stored procedure (or some other schema object) through the DEV, TEST, Production environments. We have one client that is really big on seeing some type of evidence that we did what we say we did. I wrote this little [...]]]></description>
			<content:encoded><![CDATA[<p>I work in a hosting environment, and frequently our clients will ask us to promote a stored procedure (or some other schema object) through the DEV, TEST, Production environments. We have one client that is really big on seeing some type of evidence that we did what we say we did.</p>
<p>I wrote this little nugget that generates enough confirmation for the client&#8217;s relationship manager to demonstrate that we did indeed move their code. And it seems to make the client happy.</p>
<pre>set nocount on
go

DECLARE @dbname VARCHAR(30)
DECLARE @num_objects INT
DECLARE @object_type VARCHAR(3)

SELECT @dbname = &#039;userdatabasename&#039; -- Use the database where the objects were moved
SELECT @num_objects = 1   -- Use the number of objects moved.
SELECT @object_type = &#039;P&#039; -- Use P for procedures, F for functions, U for tables, V for views, etc. 

DECLARE @SQL VARCHAR (1000)

select @@servername

SELECT @sql = &#039;select top &#039; + cast(@num_objects as varchar) +&nbsp;
&#039; left(name,30) as object, object_id, modify_date from &#039; + @dbname +
&#039;.sys.objects where type = &#039;&#039;&#039; + @object_type + &#039;&#039;&#039;&lt;/pre&gt;
&lt;pre&gt;order by modify_date desc&#039;

EXEC (@sql)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://crankydba.com/2011/11/15/confirming-objects-modified/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting All Databases to SIMPLE Recovery Mode</title>
		<link>http://crankydba.com/2011/11/07/setting-all-databases-to-simple-recovery-mode/</link>
		<comments>http://crankydba.com/2011/11/07/setting-all-databases-to-simple-recovery-mode/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 18:00:26 +0000</pubDate>
		<dc:creator>Mike Hillwig</dc:creator>
				<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://crankydba.com/?p=628</guid>
		<description><![CDATA[I&#8217;m cleaning up some stuff in my dev environment today, and I have some pretty big transaction log files. These have gotten big even though I do regular full and transaction log backups. In order to do some maintenance work, I wrote this little nugget this morning. It&#8217;s anther script that generates a script. Again, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m cleaning up some stuff in my dev environment today, and I have some pretty big transaction log files. These have gotten big even though I do regular full and transaction log backups. In order to do some maintenance work, I wrote this little nugget this morning. It&#8217;s anther script that generates a script.</p>
<p>Again, this is for my DEV environment. I&#8217;d never advise someone to run all databases in SIMPLE recovery mode in a production environment unless there was a very specific need to do that.</p>
<pre>
set nocount on
go
select 'ALTER DATABASE [' + name + '] SET RECOVERY SIMPLE'
from sys.databases
where database_id &gt; 6
and recovery_model_desc = 'FULL'</pre>
]]></content:encoded>
			<wfw:commentRss>http://crankydba.com/2011/11/07/setting-all-databases-to-simple-recovery-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

