<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'SSMS' and 'disaster recovery'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=SSMS,disaster+recovery&amp;orTags=0</link><description>Search results matching tags 'SSMS' and 'disaster recovery'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Why is disaster recovery an afterthought?</title><link>http://sqlblog.com/blogs/aaron_bertrand/archive/2009/06/21/why-is-disaster-recovery-an-afterthought.aspx</link><pubDate>Sun, 21 Jun 2009 16:44:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:14802</guid><dc:creator>AaronBertrand</dc:creator><description>&lt;p&gt;I think that people have been lulled into the false sense of security that you can set up a SQL Server database, leave all the defaults in place, and never have to do anything.&amp;nbsp; While it is true that Microsoft has added many features to SQL Server that make the "hard" parts of being a DBA easier, there is no question in my mind that many people have over-compensated and adopted an attitude of "set it and forget it."&amp;nbsp; I can't really blame them, I guess, but I am still amazed when these same people get bitten by lack of maintenance or planning, and have no idea how to resolve the situation.&lt;/p&gt;&lt;p&gt;The most common scenario is when users first set up a database and accept the defaults (e.g. FULL RECOVERY), because it sounds good and must be the best option.&amp;nbsp; They may or may not set up full nightly or backups (or that may be "someone else's job"), but very rarely do they understand the importance of log backups.&amp;nbsp; So a few weeks or months go by, and everything seems to be working great, and then all of a sudden the drive that their log is on runs out of disk space.&amp;nbsp; (And as an aside, this is often C:\, and is often also the drive that their data is on.)&amp;nbsp; This is because their data file has only grown to 500 MB, but their log file is now 40 GB.&amp;nbsp; I wish I was exaggerating, but I &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.newusers/browse_thread/thread/840e954cac537501/f1ad5bed6f365201" title="http://groups.google.com/group/microsoft.public.sqlserver.newusers/browse_thread/thread/840e954cac537501/f1ad5bed6f365201" target="_blank"&gt;see&lt;/a&gt; &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.server/browse_thread/thread/1aafe907da5f1aea/62c6eb7e9991d064" title="http://groups.google.com/group/microsoft.public.sqlserver.server/browse_thread/thread/1aafe907da5f1aea/62c6eb7e9991d064" target="_blank"&gt;this&lt;/a&gt; &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.clients/browse_thread/thread/1bcc62a851e3ff38/178198f2591a413c" title="http://groups.google.com/group/microsoft.public.sqlserver.clients/browse_thread/thread/1bcc62a851e3ff38/178198f2591a413c" target="_blank"&gt;all&lt;/a&gt; &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.replication/browse_thread/thread/df05fa5ea19d98b0/af41a402a257ea9e" title="http://groups.google.com/group/microsoft.public.sqlserver.replication/browse_thread/thread/df05fa5ea19d98b0/af41a402a257ea9e" target="_blank"&gt;the&lt;/a&gt; &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.setup/browse_thread/thread/d25e49cd689e566b/d1749245a6958716" title="http://groups.google.com/group/microsoft.public.sqlserver.setup/browse_thread/thread/d25e49cd689e566b/d1749245a6958716" target="_blank"&gt;time&lt;/a&gt;.&amp;nbsp; And in most cases these people are looking for the "quick fix" : tell me how to shrink the file, so I can have my space back, then I'll go back to ignoring the situation.&amp;nbsp; They don't realize (and don't want to understand) that shrinking the log file in and of itself is not going to fix anything.&amp;nbsp; It gives them temporary breathing room, but that just means they are going to have to run the SHRINKFILE command in a repetitive loop, days or weeks apart.&amp;nbsp; Tibor has some great advice about this &lt;a href="http://sqlblog.com/blogs/tibor_karaszi/archive/2007/02/25/leaking-roof-and-file-shrinking.aspx" title="http://sqlblog.com/blogs/tibor_karaszi/archive/2007/02/25/leaking-roof-and-file-shrinking.aspx" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="http://tr.im/StopShrinking" title="http://tr.im/StopShrinking" target="_blank"&gt;here&lt;/a&gt; - the latter is a bit long but, trust me, it is really worth the read. &lt;/p&gt;&lt;p&gt;For a long time I tried to figure out how people got into these situations in the first place.&amp;nbsp; Some of them are involuntary DBAs, for sure - they need an app, which needs a database, and they can't become a full-fledged DBA just to support this one app, and they can't always predict their long-term file growth needs or understand why they may need disaster recovery or how it can be accomplished.&amp;nbsp; I then realized that SQL Server actually encourages this behavior in the "New Database" wizard.&amp;nbsp; Since I always use CREATE DATABASE DDL to create databases, I didn't realize that the UI populates so many defaults for you (though, granted, some of those defaults are the same if you use DDL and omit those options).&amp;nbsp; Why can't SQL Server be more helpful in this case?&amp;nbsp; Most of these involuntary DBAs are using the UI to create a database, and the defaults are horrible, if we're being honest.&amp;nbsp; Here are a couple of ways that I think the defaults could be much better:&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight:bold;"&gt;General tab&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;img src="http://sqlblog.com/blogs/aaron_bertrand/attachment/14802.ashx" height="387" width="745"&gt;&amp;nbsp;&lt;br&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="margin-left:40px;font-weight:bold;"&gt;Initial Size &lt;/p&gt;&lt;p style="margin-left:40px;"&gt;2 MB data file, and 1 MB log file?&amp;nbsp; I guess this is okay if you are planning to store a single table that never grows.&amp;nbsp; But for most applications, this is not going to be sufficient, and you are going to start experiencing autogrowth events almost immediately.&amp;nbsp; And if your data is growing significantly, both your data and log files are going to have these events occurring quite frequently.&amp;nbsp; Why would you want to make your transactions wait for these events all the time, instead of picking a better starting size?&amp;nbsp; Couldn't the default be generated dynamically by some formula of free space on the drive, the size of other databases on the system, and globally observed usage practices?&lt;br&gt;&lt;/p&gt;&lt;p style="margin-left:40px;font-weight:bold;"&gt;Autogrowth&lt;/p&gt;&lt;p style="margin-left:40px;"&gt;1 MB for data, 10 percent for log?&amp;nbsp; Terrible.&amp;nbsp; I think this should be dynamic and based on the initial size you specified for the files, and % should never, EVER, EVER be a default for data or log.&amp;nbsp; The problem is kind of like doubling your kids' allowance every week; eventually, it will put you in the poorhouse.&amp;nbsp; If you grow by 10% every time, that chunk gets bigger and bigger, and unless you are on zippy SSDs or similar, the growth event takes longer and longer - even with instant file initialization.&amp;nbsp; Of course all transactions have to wait for this file growth to complete, so making that period more predictable is in your best interests.&lt;/p&gt;&lt;p style="margin-left:40px;"&gt;&lt;span style="font-weight:bold;"&gt;Path &lt;/span&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-left:40px;"&gt;Personally, I think the drive letters should be dynamically selected based on free space available, or even better, if an HBA is detected or a SAN is otherwise present, users should be reminded that that is likely the best location.&amp;nbsp; If you still choose smallish drives (and especially C:\), this should pop up a warning, giving some guesstimate
about how long the database will "survive" on this drive if the data
grows at, say, 1MB/day or 10MB/day.&amp;nbsp; Same for log.&amp;nbsp; This may help to prevent
some people from just plopping data or log or both on a small C:\ when
there is a much bigger D:\ or E:\ available.&amp;nbsp; Of course C:\ is the default based on the initial installation of SQL Server, and they are getting better about this in the setup wizard, but have a long way to go.&amp;nbsp; There should be much better guidance on placing data and log on different drives.&lt;br&gt;&lt;/p&gt;&lt;span style="font-weight:bold;"&gt;Options tab&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;div style="margin-left:40px;font-weight:bold;"&gt;Recovery model&lt;/div&gt;&lt;p style="margin-left:40px;"&gt;This is the big one, in my opinion.&amp;nbsp; The option to place the database in full recovery by default should be accompanied with, at the very least, a reminder that disaster recovery is important.&amp;nbsp; Also it could be useful to explain WHY full is preferential, and a link to documentation describing the different recovery models (and why log backups are important).&amp;nbsp; It would be better to have a tab that allows them to set up both a full and log backup schedule, before the database can even be created.&amp;nbsp; By default the schedule could be a full backup every night at midnight, and log backups throughout the day, every 15 or 20 minutes.&amp;nbsp; This should be a very easy set of options and should work much more predictably than the maintenance plans (the main problem with maintenance plans is that when you add a database not all plans automatically pick it up).&amp;nbsp; Finally, the backups should *not* be allowed to go to the same drive as the data or log; another poor default in the maintenance plan wizard.&amp;nbsp; There should actually be a way to provide SQL Server with a default network share for backups for all new databases. &lt;br&gt;&lt;/p&gt;&lt;p&gt;So why is disaster recovery an afterthought?&amp;nbsp; Part of it is a need for better education.&amp;nbsp; But part of it is because the defaults encourage people to use techniques which are nowhere near the realm of "best practice."&amp;nbsp; Personally I think some very minor tweaks to the "New Database" wizard could make some giant strides in reducing the number of people who get surprised and burned by ginormous log files.&lt;br&gt;&lt;/p&gt;</description></item></channel></rss>