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

<channel>
	<title>SQL Server with Mr. Denny &#187; DataCenter</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/sql-server/tag/datacenter/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/sql-server</link>
	<description></description>
	<lastBuildDate>Fri, 17 May 2013 17:04:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Backup Databases on Creation</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/backup-databases-on-creation/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/backup-databases-on-creation/#comments</comments>
		<pubDate>Sat, 17 Nov 2012 14:00:56 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[Backup & recovery]]></category>
		<category><![CDATA[BACKUP DATABASE]]></category>
		<category><![CDATA[CREATE TRIGGER]]></category>
		<category><![CDATA[Data Loss]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[DDL Trigger]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2008 R2]]></category>
		<category><![CDATA[SQL Server 2012]]></category>
		<category><![CDATA[T/SQL]]></category>
		<category><![CDATA[Transactions]]></category>
		<category><![CDATA[Trigger]]></category>
		<category><![CDATA[xp_create_subdir]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/?p=2194</guid>
		<description><![CDATA[One of the companies which I work with has the occasion to create new databases when they do releases of their software.  Normally this isn&#8217;t a problem, except that they are setup to use maintenance plans to handle the backup and pruning of their transaction logs.  As all the new databases are created in the [...]]]></description>
				<content:encoded><![CDATA[<p>One of the companies which I work with has the occasion to create new databases when they do releases of their software.  Normally this isn&#8217;t a problem, except that they are setup to use maintenance plans to handle the backup and pruning of their transaction logs.  As all the new databases are created in the full recovery model this can end up causing some problems for them as within 12 minutes they start getting emails saying that the transaction log backup job has failed.  And these emails will keep coming in, possibly for hours until the full backup job kicks in later that night.</p>
<p>To solve this problem, I added a DDL trigger to the server which will cause the new database to be backed up as soon as the database is created.  The trigger itself is rather simple.  Most of the trigger is setting variables.  Then I make sure that the database isn&#8217;t a database snapshot, as database snapshots can&#8217;t be backed up.  If it isn&#8217;t a snapshot we continue with everything else.</p>
<p>Then I create a subfolder for the backups to be put into (the backups for each database go into their own folder, so as this is a new database the folder needs to be created).  Then I commit the transaction, as database backups can&#8217;t be taken within a transaction.  Then we do the actual database backup.  I then throw a message to the end user using the RAISERROR statement telling them that they can ignore the other error that they are going to get about the transaction being closed before the trigger was complete.  This is just an annoyance of my needing to commit the transaction before taking the backup.  Sure I could have setup a job which takes the backup and emails if there was a failure, but that just seems to complex for something so simple.  The code for my trigger is below.</p>
<blockquote><p>CREATE TRIGGER BackupNewDatabase<br />
ON ALL SERVER<br />
FOR CREATE_DATABASE<br />
AS<br />
declare @database sysname, @event_data XML = EVENTDATA(), @folder nvarchar(4000), @file nvarchar(4000)</p>
<p>SET @database = @event_data.value(&#8216;(/EVENT_INSTANCE/DatabaseName)[1]&#8216;, &#8216;sysname&#8217;)</p>
<p>set @folder = &#8216;X:\Backups\&#8217; + @database</p>
<p>set @file = @folder + &#8216;\&#8217; + @database + &#8216;.bak&#8217;</p>
<p>if exists (select * from sys.databases where name = @database and source_database_id is null)<br />
BEGIN<br />
EXEC master.dbo.xp_create_subdir @folder</p>
<p>COMMIT</p>
<p>BACKUP DATABASE @database to disk=@file</p>
<p>raiserror( &#8216;You can ignore the error message which says that the transaction ended within the trigger.&#8217;, 16,1)<br />
END<br />
GO</p></blockquote>
<p>Hopefully you find this solution helpful if you get into a situation like this,<br />
Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/backup-databases-on-creation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lugging fuel up stairs shouldn&#8217;t have been needed</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/lugging-fuel-up-stairs-shouldnt-have-been-needed/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/lugging-fuel-up-stairs-shouldnt-have-been-needed/#comments</comments>
		<pubDate>Thu, 01 Nov 2012 18:17:29 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[Data Loss]]></category>
		<category><![CDATA[DataCenter]]></category>
		<category><![CDATA[Distaster Recovery]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/?p=2433</guid>
		<description><![CDATA[While I applaud the hard work and ingenuity of the sysadmins who works through the days after hurricane Sandy to keep the generators running, one thing kept coming to my mind.  Why was this needed? I&#8217;ve moved lots of companies into data centers before, and each time I&#8217;ve done so it has included a site [...]]]></description>
				<content:encoded><![CDATA[<p>While I applaud the <a href="http://mobile.theverge.com/2012/10/31/3581916/new-york-hurricane-sandy-stackexchange-squarespace-gawker">hard work and ingenuity of the sysadmins</a> who works through the days after hurricane Sandy to keep the generators running, one thing kept coming to my mind.  Why was this needed?</p>
<p>I&#8217;ve moved lots of companies into data centers before, and each time I&#8217;ve done so it has included a site visit during to RFP process to check on things like cooling, generator, site configuration, etc.  During these site visits I stick my head through every door that the sales guy and the engineer who are doing the tour will open.  If they won&#8217;t open a door for me they better have a damn good reason to not show me what&#8217;s in there.</p>
<p>If I went to do a site visit at a facility that was located just at sea level just a few blocks from the ocean, they&#8217;d better have some pretty impressive plans for how they are going to handle flooding.  If the answer was &#8220;we&#8217;ve never had a problem with flooding&#8221; or something similar they&#8217;d be off my list as they haven&#8217;t done their due diligence to insure that the site will be online during the worst emergencies possible.</p>
<p>Now before you start telling me that I&#8217;ve got no idea what I&#8217;m talking about, and that data centers in the North East have different problems from data centers in the South West.  I actually do as I&#8217;ve moved companies into data centers on both coasts.  Most recently I moved the data center for <a href="http://www.phreesia.com">Phreesia </a>from a managed service facility in Texas to a colo in New Jersey.  As a part of this move we looked at a number of facilities in the New York / New Jersey area.  Many of the New York City data centers were eliminated due to cost, or being just to close to the water as we didn&#8217;t want to deal with situations like this exact one.</p>
<p>The data center we settled on is in New Jersey about a 30-40 minute drive from the Phreesia office (once you get out of New York City).  While the data center is near a river, the river is a little over a mile away.  The data center itself is on a slope with a  cinder block wall on the outer edge which will divert water away in the event of a river overflow (it also protects the facility from someone driving a car or truck into the facility).  The generators and fuel pumps are all mounted on raised feet (not very tall, but tall enough) so that they keep running in the event of a flood.  The cables from the generators to the building have all been buried under the ground so that tree branches which are torn loose during the hurricane can&#8217;t cut those cables.</p>
<p>Our diligence in selecting a data center paid off.  While the folks mentioned in that article were dragging buckets of fuel up 17 floors worth of stairs the team at Phreesia just sat back and rode out the storm with their families.  The sites didn&#8217;t go down and the team didn&#8217;t have to rush into a very hazardous situation. The team was able to focus on their families and neighbors without having to worry about the systems.  Those of us that aren&#8217;t in the New York area monitored the systems remotely and founds that everything was running perfectly normally just on generator power instead of city power.</p>
<p>This entire event just shows that when doing data center evaluations the worst possible case situation needs to be planned for and expected.  If they aren&#8217;t they are going to come back and bite you.  Especially in todays world of storms which are ever increasing in destructive power.</p>
<p>If you are in a facility which has risks such as fuel pumps which are below sea level (they are in the basement and the road is at sea level) then a second data center becomes very important very quickly.  This became very clear during this hurricane when some very large important websites went offline because they didn&#8217;t have that DR facility that they could fail over to, unlike sites like <a href="http://www.stackoverflow.com">StackOverflow</a> (and <a href="http://www.serverfault.com">ServerFault </a>and the Stack Exchange network).</p>
<p>If you are at risk now is an excellent time to sit down with management and go over all the &#8220;what ifs&#8221; of your current hosting solution and think about the cost of a DR site along with the cost of not having one.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/lugging-fuel-up-stairs-shouldnt-have-been-needed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The world does not revolve around cloud computing or coding.</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/the-world-does-not-revolve-around-cloud-computing-or-coding/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/the-world-does-not-revolve-around-cloud-computing-or-coding/#comments</comments>
		<pubDate>Wed, 05 Sep 2012 14:00:02 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[DataCenter]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Social Commentary]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/?p=2329</guid>
		<description><![CDATA[Back on August 28th another ITKE poster wrote a blog post titled &#8220;The elephant not in the room&#8221; in which they talk about how if you want to work in IT in the future you better plan on working at one of the big cloud providers or you better be a programmer.  I&#8217;ve got one [...]]]></description>
				<content:encoded><![CDATA[<p>Back on August 28th another ITKE poster wrote a blog post titled &#8220;<a href="http://itknowledgeexchange.techtarget.com/trackbacks/the-elephant-not-in-the-room/">The elephant not in the room</a>&#8221; in which they talk about how if you want to work in IT in the future you better plan on working at one of the big cloud providers or you better be a programmer.  I&#8217;ve got one simple response to this.</p>
<blockquote><p>Bull Shit!</p></blockquote>
<p>While it is true that a lot of companies are moving SOME services to the cloud, most companies are not looking at moving every service to the cloud.  Even if they wanted to move everything to the cloud so that Amazon, Rackspace, Microsoft (Azure), etc. could handle the managing of the servers there are some things which will simply never sit in the public cloud.  Here&#8217;s a short list to start with&#8230;</p>
<ul>
<li>Medical Data (there&#8217;s this thing called HIPPA that requires you know who has accessed the data)</li>
<li>Confidential data</li>
<li>Any customer data from companies in Europe</li>
<li>Most legacy applications which contain personally identifiable information</li>
</ul>
<p>There are also plenty of services that IT provides that simply can&#8217;t be replaced by the cloud.  This includes things like:</p>
<ul>
<li>Network infrastructure at the office</li>
<li>DHCP, DNS, Authentication, etc. services at the office</li>
<li>Telecom Services</li>
<li>File Servers</li>
<li>Account provisioning in what ever applications are running in the cloud</li>
</ul>
<p>Even when services are moved to the oh so magical cloud there are still plenty of non-code things that need to be done by someone who works for the company who&#8217;s application will be hosted by the cloud.</p>
<ul>
<li>Virtual Machine Architecture (remember when Amazon&#8217;s EC2 had that little problem with some of the groups going offline?)</li>
<li>Application deployments (separation of duties is still a SOX requirement when applications are in the cloud)</li>
<li>Disaster Recovery planning (realistically how would the business have reacted during that EC2 outage?)</li>
<li>Disaster Recovery testing (if you plan for a disaster and don&#8217;t test the plan, you&#8217;ve got nothing useful.)</li>
<li>Scaling applications (not everything automatically scales like they marketing material says)</li>
<li>Moving applications from one cloud provider to another (if I can save $10 a month by moving from EC2 to Rackspace for example, why shouldn&#8217;t I)</li>
<li>Database Index Tuning</li>
<li>Server Patching</li>
</ul>
<p>On top of all of that, there&#8217;s other risks with moving everything that runs a company into the cloud.  Now that you no longer own the servers you can&#8217;t control what the other servers are running on the physical hardware.  So if that tier 1 application that requires millisecond response time isn&#8217;t getting it, there&#8217;s basically nothing that you can do.  And what happens where there&#8217;s an internet outage at the office and your employees can&#8217;t access the software they need to do their jobs?  Suddenly the savings of moving that tier 1 application to the cloud wasn&#8217;t the greatest plan.</p>
<p>Now there are definitely benefits to moving SOME application and services to the cloud, but the thought that everything will move to the cloud and if you want to stay employed you better learn how to write application code, is total crap.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/the-world-does-not-revolve-around-cloud-computing-or-coding/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Back To Basics: Why isn&#8217;t maintenace automatic?</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/back-to-basics-why-isnt-maintenace-automatic/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/back-to-basics-why-isnt-maintenace-automatic/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 14:00:13 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[Back To Basics]]></category>
		<category><![CDATA[Backup & recovery]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/back-to-basics-why-isnt-maintenace-automatic/</guid>
		<description><![CDATA[One of the questions which I see pop up from time to time (especially when I used to work for a VAR that wrote software for small businesses) is why doesn&#8217;t SQL Server do the maintenance automatically?  Things like checking for corruption (DBCC CHECKDB), index defragmentation, backups, etc. The reason for this is pretty basic.  [...]]]></description>
				<content:encoded><![CDATA[<p>One of the questions which I see pop up from time to time (especially when I used to work for a VAR that wrote software for small businesses) is why doesn&#8217;t SQL Server do the maintenance automatically?  Things like checking for corruption (DBCC CHECKDB), index defragmentation, backups, etc.</p>
<p>The reason for this is pretty basic.  How is the SQL Server supposed to know what settings to use, or how often to do those things?  Every database needs to have the indexes rebuild at a different interval.  There are a variety of recovery options which would change the backup policy for a database.  Not to mention that to properly build backup settings the SQL Server would need to know things like your RPO (Recovery Point Objective aka. how much data are you willing to loose in the event of a major failure).  Without a way to tell the SQL Server these sorts of things the SQL Server wouldn&#8217;t be able to properly maintain your environment.</p>
<p>So there&#8217;s the why.</p>
<p>Denny</p>
<p style="text-align: center"><a href="http://sqlexcursions.com/napa-2011-sign-up"><img class="aligncenter size-full wp-image-1838" src="http://cdn.ttgtmedia.com/ITKE/uploads/blogs.dir/20/files/2011/11/2012-napa-banner-plus-sql-denali1.jpg" alt="" width="500" height="61" /></a></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/back-to-basics-why-isnt-maintenace-automatic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What changing the recovery mode of your vCenter database really means</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/what-changing-the-recovery-mode-of-your-vcenter-database-really-means/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/what-changing-the-recovery-mode-of-your-vcenter-database-really-means/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 14:00:25 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[Recovery]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/what-changing-the-recovery-mode-of-your-vcenter-database-really-means/</guid>
		<description><![CDATA[Apparently one of the things that VMware&#8217;s support department will often recommend that people do is to change the recovery mode of the vCenter database within SQL Server from FULL to SIMPLE recovery because it will magically make a lot of disk problems go away.  While this is true, your disk space issues on the [...]]]></description>
				<content:encoded><![CDATA[<p>Apparently one of the things that VMware&#8217;s support department will often recommend that people do is to change the recovery mode of the vCenter database within SQL Server from FULL to SIMPLE recovery because it will magically make a lot of disk problems go away.  While this is true, your disk space issues on the vCenter database will go away at this point, this isn&#8217;t magic and you have have just lost some functionally that you weren&#8217;t expecting to loose.</p>
<p>The big thing that you loose when doing this is that you can no longer restore the SQL Server database to a specific point in time if you have a system failure.  If you don&#8217;t need the ability to restore so a specific point in time, and restoring to your latest full or differential backup that you have (you do know that you need to backup the vCenter databases right?) then changing the recovery mode from FULL to SIMPLE is just fine.  However if you do need that ability (and I would recommend that you have that ability so that if the vCenter server fails or someone deletes data you can get back as much trending data as possible) then you will want to leave the recovery mode as FULL, but instead setup transaction log backups (hopefully you have a DBA or a <a href="http://www.mrdenny.com/">database consultant</a> that can help you with this) so that they run every few minutes (I typically recommend every 10-15 minutes).  Just keep in mind that when selecting how often they should run in the event of a server failure you may loose up to that amount of data from the database.  So if you aren&#8217;t aloud to loose more than 10 minutes worth of data, don&#8217;t backup the log every 15 minutes, back it up every 10, or maybe every 8 just to be safe.  Make sure that you get in writing from your management that this is the config that they want so if you get yelled at you are covered.</p>
<p>If you haven&#8217;t ever backed up the transaction log your disk is probably pretty full (or totally full).  In this case you will want to shrink the database just once.  But before you do you need to know what size you should shrink it to.  This can be much easier if a DBA does it, but I&#8217;ve got faith in you to not screw it up.</p>
<p>First connect to the SQL Server using Management Studio.  Take a backup of the transaction log to disk by right clicking on the database, selecting Tasks from the context menu then selecting Backup from the pop out menu.  Select transaction log backup, set a file to backup the log to (you&#8217;ll need a lot of disk space for this) and make sure that there&#8217;s only one file listed in the file list then start the backup.  This will probably take a while.</p>
<p>If you don&#8217;t care about loosing the log for now change the database from full to simple recovery and back.  Do this by running this script.</p>
<pre class="brush: sql; title: ; notranslate">
ALTER DATABASE vcdb
SET RECOVERY SIMPLE
GO
ALTER DATABASE vcdb
SET RECOVERY FULL
GO</pre>
<p>Now do a full backup as shown above (just do a full database backup instead of a transaction log backup).</p>
<p>Now with everything running as normal wait for how ever long it&#8217;ll be between transaction log backups.  Then connect to the SQL Server in SQL Server Management Studio.  Right click on the vCenter database (vcdb) and select Reports from the context menu, then &#8220;Disk Usage&#8221; from the list of reports.  At the top it&#8217;ll give you the size of the transaction log in MB, and the graph on the right will show you a percentage breakdown of how full the transaction log file is.  Take the Used percentage and double it.  Now take that percentage and multiple it by the size of the transaction log.  That&#8217;s the minimum size you should set your transaction log for.  Personally I would round up to the 8 gig size above that size.  If you need 150 Megs of log space, set the log for 8 Gigs in size.  If you need 10 Gigs of log space, let the log for 16 Gigs of space.  A little extra space used is fine, it is better for performance of the database if we don&#8217;t need to grow this transaction log.  You can shrink the transaction log by using the DBCC SHRINKFILE statement as shown.</p>
<pre class="brush: sql; title: ; notranslate">DBCC SHRINKFILE ('vbdc_log', 8388608)</pre>
<p>Keep in mind that the number, in this case 8 Gigs, is passed in in megs.  Do NOT for any reason create any sort of scheduled task to regularly shrink any database file.  This will do nothing good and will cause performance problems of its own.  If anyone has told you to setup a job which shrinks the database file regularly they are WRONG.</p>
<p>Denny</p>
<div class="mceTemp">
<dl>
<dt><a href="http://www.sqlserverdays.be"><img class="size-full wp-image-1756" src="http://cdn.ttgtmedia.com/ITKE/uploads/blogs.dir/20/files/2011/09/sqlserverdays2011.gif" alt="SQL Server Days 2011" width="500" height="61" /></a></dt>
</dl>
</div>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/what-changing-the-recovery-mode-of-your-vcenter-database-really-means/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transaction Log files are not safe to delete</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/transaction-log-files-are-not-safe-to-delete/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/transaction-log-files-are-not-safe-to-delete/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 11:00:20 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[Recovery]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/?p=763</guid>
		<description><![CDATA[All to often I see people online saying that they detach a database then delete the log file to shrink it.  This is a very dangerous operation which can leave you with a corrupt database that you can&#8217;t do anything with. While you can normally attach a database without the log file, it doesn&#8217;t always [...]]]></description>
				<content:encoded><![CDATA[<p>All to often I see people online saying that they detach a database then delete the log file to shrink it.  This is a very dangerous operation which can leave you with a corrupt database that you can&#8217;t do anything with.<span id="more-763"></span></p>
<p>While you can normally attach a database without the log file, it doesn&#8217;t always work.  Sometimes SQL Server won&#8217;t be able to recover from this and create a new log file and you&#8217;l have lost the database.</p>
<p>If your database is growing and has gotten very large, then you&#8217;ll want to change the recorvery mode from FULL to SIMPLE.  This will help keep the transaction log file small, and is perfectly safe to do.  The only thing you will loose is the ability to do point in time restores of the transaction log.  However point in time restores are only available if you backup the transaction log (which would have prevented the log from growing out of control to begin with).</p>
<p>The reason that many people do this, is that the name of the file is misleading.  Normally logs are very safe to delete, however the transaction log isn&#8217;t your normal log file.  A transaction log keeps a record of every change to the database, along with the before and after values.  All changes are written to the transaction log before they are commited to the database itself so that if the server fails the database is left in a consistant state.</p>
<p>If your log file has simply gotten huge, and you need to make it smaller, you can use the DBCC SHRINKFILE command to shrink the log file to a smaller size.  This shouldn&#8217;t be done on a regular basis.  If you are doing this on a regular basis leave the file large it&#8217;s at the size it needs to be or change the database recovery to SIMPLE.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/transaction-log-files-are-not-safe-to-delete/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>I&#8217;ve got some money for an upgrade, what should I upgrade?</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/ive-got-some-money-for-an-upgrade-what-should-i-upgrade/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/ive-got-some-money-for-an-upgrade-what-should-i-upgrade/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 11:00:34 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[RAM]]></category>
		<category><![CDATA[Server Hardware]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/?p=733</guid>
		<description><![CDATA[So you are going along your normal day, and your boss comes up to you and tells you &#8220;We&#8217;ve got a few thousand bucks left in this years budget, what would you like to upgrade?&#8221;  Assuming that new 26&#8243; monitors for your workstation are out of the question, the boss is probably talking about a [...]]]></description>
				<content:encoded><![CDATA[<p>So you are going along your normal day, and your boss comes up to you and tells you &#8220;We&#8217;ve got a few thousand bucks left in this years budget, what would you like to upgrade?&#8221;  Assuming that new 26&#8243; monitors for your workstation are out of the question, the boss is probably talking about a server upgrade here so lets see what we can do.<span id="more-733"></span></p>
<p>1. RAM &#8211; RAM is cheep, and easy to upgrade.  For a couple of thousand bucks you could easily add another 32-64 Gigs of RAM (more if you buy off brand).</p>
<p>2. Drive Space &#8211; Disks are also cheep (not as cheep as RAM, but close).  You could drop some extra spindles in there and more tempdb off to its own drive, or even break the database into a couple of physical files and double the available IO.</p>
<p>3. Faster CPUs &#8211; CPUs usually aren&#8217;t all that cheep.  If you have dual core chips, and you want to get some core chips you are probably looking at ~$1500 per chip, so that probably isn&#8217;t an option.  Now if you have a single quad core CPU in there, you could drop a second one in double your CPU power.  This will throw off your licensing if this is an internet facing SQL Server.  Those 6 core CPUs may look might sexy, but sadly they are probably way out of your budget at ~$3k each.</p>
<p>Those are pretty much your options.  Now if your IO is being slammed that might be a good place to throw that cash, but if your IO is being slammed is it because of writes or reads?  If it&#8217;s because of writes then by all means throw the cash at the storage.  If it is because of reads, then check your hit cache ratio, and page life expediency.  If they are low, then some more RAM is in order.  This will increase the amount of data in cache, increasing the amount of time the data stays in cache, and reducing the IO requirements on to the disk to a crawl.</p>
<p>Everyone wants more CPU power in there servers.  But sadly CPU power is still very expensive, so it isn&#8217;t really going to be an upgrade option unless you&#8217;ve got a pretty small server.  Not to mention the licensing issues that can quickly lead to if you add more physical CPUs than you are licensed for.</p>
<p>All things being equal I&#8217;d probably go for the RAM upgrade.  Long term I think that&#8217;ll get you the most bang for the buck, however that&#8217;s just me.  And depending on the server I might change my mind.  Before jumping into any system upgrade think carefully about what you want to purchase, what you want to achieve, and make sure that those things cross.</p>
<p>Denny</p>
<p>P.S. My hardware prices were from Dell&#8217;s website.  Your prices will vary depending on where you do your shopping.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/ive-got-some-money-for-an-upgrade-what-should-i-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design the server to fit the database, don&#8217;t cram the database into the server</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/design-the-server-to-fit-the-database-dont-cram-the-database-into-the-server/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/design-the-server-to-fit-the-database-dont-cram-the-database-into-the-server/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 11:00:05 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[Server Hardware]]></category>
		<category><![CDATA[System Design]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/design-the-server-to-fit-the-database-dont-cram-the-database-into-the-server/</guid>
		<description><![CDATA[I am so sick and tired of people posting questions on various forums along the lines of &#8220;We just bought a Some brand and model of server and it has n hard drives in it.  How should I setup the database on these drives?&#8221; The problem with this is that you have bought a server [...]]]></description>
				<content:encoded><![CDATA[<p>I am so sick and tired of people posting questions on various forums along the lines of &#8220;We just bought a <em>Some brand and model of server</em> and it has <em>n</em> hard drives in it.  How should I setup the database on these drives?&#8221;<span id="more-629"></span></p>
<p>The problem with this is that you have bought a server with no idea how to fit the database on it and still get good performance from the server.  If you ask me this is just ass backward.  When buying a new SQL Server you should figure out what the server needs to run the database, then buy the server to match that configuration.  You may be spending a little bit more money up front, but your system will perform much better because you&#8217;ve actually designed the server to support the database rather than trying to cram the database into the server.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/design-the-server-to-fit-the-database-dont-cram-the-database-into-the-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimal Database Setup Hardware Guide</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/optimal-database-setup-hardware-guide/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/optimal-database-setup-hardware-guide/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 08:58:15 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[enterpriseitplanet.com]]></category>
		<category><![CDATA[Server Hardware]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/?p=285</guid>
		<description><![CDATA[A little while back I published an article on Enterprise IT Planet called &#8220;Optimal Database Setup Hardware Guide&#8220;.  In this article I talk about some key points that should be looked at when building a new SQL Server. Denny]]></description>
				<content:encoded><![CDATA[<p>A little while back I published an article on <a href="http://www.enterpriseitplanet.com" target="_blank">Enterprise IT Planet</a> called &#8220;<a href="http://www.enterpriseitplanet.com/networking/features/article.php/3791396" target="_blank">Optimal Database Setup Hardware Guide</a>&#8220;.  In this article I talk about some key points that should be looked at when building a new SQL Server.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/optimal-database-setup-hardware-guide/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to setup a server to read log files nightly.</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/how-to-setup-a-server-to-read-log-files-nightly/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/how-to-setup-a-server-to-read-log-files-nightly/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 11:00:12 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[Backup & recovery]]></category>
		<category><![CDATA[KILL]]></category>
		<category><![CDATA[Log Shipping]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[RESTORE LOG]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[xp_delete_file]]></category>
		<category><![CDATA[xp_dirtree]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/how-to-setup-a-server-to-read-log-files-nightly/</guid>
		<description><![CDATA[So you&#8217;ve been tasked with setting up a quick and dirty reporting server.  The goal is to restore the log files from the production server to the reporting server nightly.  The backups are simple, use the SQL Maintenance plan to backup the logs, and then copy them to the remote machine.  But how do you [...]]]></description>
				<content:encoded><![CDATA[<p>So you&#8217;ve been tasked with setting up a quick and dirty reporting server.  The goal is to restore the log files from the production server to the reporting server nightly.</p>
<p> The backups are simple, use the SQL Maintenance plan to backup the logs, and then copy them to the remote machine.  But how do you restore the logs to the reporting server nightly.</p>
<p> Well I&#8217;ve got a two step SQL job which should help you out.</p>
<p>Step 1 kills all current sessions in the database, and step 2 does the actual restores.</p>
<p>The code for step 1 is: </p>
<p><code>declare @spid varchar(20)<br />
declare cur CURSOR FOR<br />
select spid<br />
from sys.sysprocesses<br />
where dbid = db_id('Your Database Name Here') /*&lt;---Put your database name here*/<br />
and spid &gt; 50<br />
open cur<br />
fetch next from cur into @spid<br />
while @@FETCH_STATUS = 0<br />
BEGIN<br />
exec ('kill ' + @spid)<br />
fetch next from cur into @spid<br />
END<br />
close cur<br />
deallocate cur</code></p>
<p>The code for step 2 is:</p>
<p><code>create table #Files<br />
(FileName nvarchar(4000),<br />
Depth int,<br />
IsFile bit)</code><code>insert into #Files<br />
exec xp_dirtree 'd:\', 1, 1</p>
<p>delete from #Files<br />
where IsFile = 0</p>
<p>declare @FileName nvarchar(4000)<br />
declare cur CURSOR FOR SELECT FileName from #Files<br />
open cur<br />
fetch next from cur into @FileName<br />
WHILE @@FETCH_STATUS = 0<br />
BEGIN<br />
SET @FileName = 'D:\Path\To\Your\Log\Backups\' + @FileName<br />
RESTORE LOG YourDatabaseNameHere FROM <a href="mailto:DISK=@FileName">DISK=@FileName</a> WITH STANDBY='D:\Path\To\Your\StandBy\File.standby'<br />
IF @@ERROR &lt;&gt; 0<br />
exec xp_delete_file @FileName<br />
fetch next from cur into @FileName<br />
END<br />
close cur<br />
deallocate cur</p>
<p></code>I hope this makes your process easier. Now this code only works on SQL Server 2005 and up as the system stored procedures which I use were not included until SQL Server 2005.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/how-to-setup-a-server-to-read-log-files-nightly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
