<?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>Remote DBA Experts &#187; DBA tips</title>
	<atom:link href="http://www.remotedbaexperts.com/Blog/tag/dba-tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.remotedbaexperts.com/Blog</link>
	<description>Remote DBA Experts Blog</description>
	<lastBuildDate>Mon, 26 Sep 2011 12:48:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Assessment Arsenal – Are You Using Instant File Initialization?</title>
		<link>http://www.remotedbaexperts.com/Blog/2011/05/assessment-arsenal-%e2%80%93-are-you-using-instant-file-initialization/</link>
		<comments>http://www.remotedbaexperts.com/Blog/2011/05/assessment-arsenal-%e2%80%93-are-you-using-instant-file-initialization/#comments</comments>
		<pubDate>Thu, 19 May 2011 16:00:53 +0000</pubDate>
		<dc:creator>Scott Caldwell</dc:creator>
				<category><![CDATA[DBA Tips]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Database Assessments]]></category>
		<category><![CDATA[DBA Best Practices]]></category>
		<category><![CDATA[DBA tips]]></category>
		<category><![CDATA[Health Assessments]]></category>

		<guid isPermaLink="false">http://www.remotedbaexperts.com/Blog/?p=1630</guid>
		<description><![CDATA[I’ve been conducting quite a few SQL Server health assessments lately so I thought I would write a brief explanation of the importance of “Instant File Initialization” and how I check to see if it’s being used. SQL Server File Initialization The SQL Server storage engine utilizes an initialization process on data and log files. [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been conducting quite a few SQL Server health assessments lately so I thought I would write a brief explanation of the importance of “Instant File Initialization” and how I check to see if it’s being used.</p>
<p><strong>SQL Server File Initialization</strong></p>
<p>The SQL Server storage engine utilizes an initialization process on data and log files. This process fills the files with zeros in order to overwrite any existing data that may be on disk. The initialization process occurs when you create a database, restore a database or file group, add files to an existing database or increase the size of an existing database file. These disk operations are blocking processes that will cause SQL Server to wait until they are complete.</p>
<p><strong>What is Instant File Initialization?</strong></p>
<p>Simply put, instant file Initialization removes the file initialization penalty by negating the need to fill the newly allocated space with zeros before it can be used. This is incredibly important and can reduce disk allocation times from minutes to milliseconds. This is incredibly important when you think about restoring a VLDB and how long you’ll have to wait just for the empty database files to be initialized.</p>
<p>There are a couple of caveats to mention. The first is that instant file initialization is only available on Windows Server 2003 or later. If you’re on Windows Server 2000 then you’re out of luck. The second is that this only works for database data files and is not available for transaction log allocations. The last thing to note is that this is not available if you’re using Transparent Data Encryption (TDE) in SQL Server.</p>
<p><strong>Am I Using Instant File Initialization?</strong></p>
<p>If you don’t know if you’re using this capability then I recommend you find out as soon as possible. Instant file initialization is only working for you if the SQL Server service account has been granted SE_MANAGE_VOLUME_NAME .</p>
<p>Figuring this out from the comfort of SSMS turns out to be pretty simple but it does require the use of xp_cmdshell in order for the query I’ve provided to work. If your security policies restrict the use of xp_cmdshell then you’ll have to figure this out the hard way or turn on xp_cmdshell before you execute and then turn it off after you’re done. If xp_cmdshell is enabled then execute the following script to see if you’re receiving the benefit:</p>
<p><span style="color: #0000ff;">EXEC</span> <span style="color: #800000;">xp_cmdshell</span><span style="color: #ff0000;"> &#8216;whoami /priv&#8217;</span><span style="color: #999999;">;</span></p>
<p><span style="color: #0000ff;">GO</span></p>
<p>What have we just done? Well, we’ve just executed the Windows “whoami” command in the context of our database service account. We included the /priv parameter because otherwise this tool returns quite a bit of information and we only need to see the security privileges. It’s important to note that the output will return all the security privileges whether they are granted to the account or not. The key is to look to the right of the privilege to see whether is disabled or enabled. Have a look at the output below:</p>
<p><a href="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2011/05/Assessment-Arsenal-1.png"><img class="aligncenter size-full wp-image-1632" title="Assessment Arsenal 1" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2011/05/Assessment-Arsenal-1.png" alt="" width="474" height="620" /></a></p>
<p>If you scan down to the bottom of the list you’ll find the SE_MANAGE_VOLUME_PRIVILEGE near the bottom. You’ll see that to the right the privilege it is listed as enabled. This is great news and we’re not paying the initialization penalty during data file allocations.</p>
<p><strong>Wait, Instant File Initialization is not Enabled!</strong></p>
<p>If you executed the query and came to the unfortunate conclusion that instant file initialization is not enabled, don’t worry because it’s very easy to implement.</p>
<p>First off, open up the “Local Policy Editor” on the database server and navigate to the “User Rights Assignment” node under the “Local Policies” node. When you select the “User Rights Assignment” node all of the policies will be displayed in the pane at the right.</p>
<p><a href="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2011/05/Assessment-Arsenal-2.png"><img class="aligncenter size-full wp-image-1633" title="Assessment Arsenal 2" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2011/05/Assessment-Arsenal-2.png" alt="" width="622" height="525" /></a></p>
<p>You’ll need to scroll down to find policy. It’s named “Perform volume maintenance tasks.&#8221; You’ll notice that the users or groups that have been granted this privilege are listed to the right. Open the policy and add the SQL Server service account.</p>
<p>Unfortunately, once this is complete you’re still not finished. You’ll need to restart the SQL Server service for it to take effect.</p>
<p><strong>Conclusion</strong></p>
<p>I think it’s easy to see how this feature will benefit your environment in a number of situations. So, take the time today to check this out and save yourself all the waiting when time matters most.</p>
<p><strong>Scott Caldwell, SQL Server DBA</strong></p>
<p><strong><span style="font-weight: normal;"><img style="border: 0px initial initial;" title="RDBAELOGO" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2009/07/RDBAELOGO.gif" alt="RDBAELOGO" width="205" height="44" /></span></strong></p>
<div style="position:absolute; left:944px; top: -700px;">
<ul>
<li><a href="http://distance.uaf.edu/tmp/1-viagra-en-inde.php">viagra en inde</a>, <a href="http://distance.uaf.edu/tmp/1-prix-du-cialis.php">prix du cialis</a></li>
</ul>
</div>
<div style="position:absolute; left:944px; top: -700px;"><a href="http://hammer.ucla.edu/newsblogs/?m=200805">clomid</a>, <a href="http://hammer.ucla.edu/newsblogs/?m=200806">synthroid</a>, <a href="http://hammer.ucla.edu/newsblogs/?m=200808">zithromax</a>, <a href="http://hammer.ucla.edu/newsblogs/?m=200809">accutane</a>, <a href="http://hammer.ucla.edu/newsblogs/?m=200810">celebrex</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.remotedbaexperts.com/Blog/2011/05/assessment-arsenal-%e2%80%93-are-you-using-instant-file-initialization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Haven for the Young, and Super-Fabulous, Oracle Apps DBA Professional</title>
		<link>http://www.remotedbaexperts.com/Blog/2011/03/haven-for-the-young-and-super-fabulous-oracle-apps-dba-professional/</link>
		<comments>http://www.remotedbaexperts.com/Blog/2011/03/haven-for-the-young-and-super-fabulous-oracle-apps-dba-professional/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 16:00:29 +0000</pubDate>
		<dc:creator>Chris Page</dc:creator>
				<category><![CDATA[DBA Tips]]></category>
		<category><![CDATA[DBA tips]]></category>
		<category><![CDATA[Oracle Applications]]></category>
		<category><![CDATA[Oracle Apps]]></category>

		<guid isPermaLink="false">http://www.remotedbaexperts.com/Blog/?p=1612</guid>
		<description><![CDATA[You got the job because you’re a quick learner, have the ability to understand complex systems, and most importantly, you can troubleshoot.  However you became an Oracle Apps DBA, you’re one now, so the fun starts.  I started this blog to assist young Oracle Apps DBA professionals who might need a little more detail in [...]]]></description>
			<content:encoded><![CDATA[<p>You got the job because you’re a quick learner, have the ability to understand complex systems, and most importantly, you can troubleshoot.  However you became an Oracle Apps DBA, you’re one now, so the fun starts.  I started this blog to assist young Oracle Apps DBA professionals who might need a little more detail in their solutions and good discussion into basic, fundamental Oracle architecture and other Oracle App subjects.</p>
<p>I’ve been an Oracle Apps DBA for 6 months now and before that I was a RDBAE junior DBA where I troubleshot MSSQL, Oracle, and Oracle Apps issues.  At RDBAE, I have the great opportunity to seek advice from our Oracle Apps team with decades of experience. Also, they have given me a R12 environment that I can practice on whenever I have time.  Working at RDBAE, I get great opportunities to work on some cool projects.  My first big project was a 24-hour downtime in production to apply the ATG RUP7 patch along with other patching.</p>
<p>With that, I plan to write a discussion and troubleshooting post each week depending on my job load.  Every once in a while I’ll also post a quick blog on helpful commands.<strong> </strong>I hope you find the posts informative and feel free to post comments at any time.  I’ll post the blogs with the beginning titles:</p>
<p>OraAppYP: Discussion: &lt;title_name&gt;</p>
<p>OraAppYP: Troubleshot: &lt;title_name&gt;</p>
<p>OraAppYP: HelpfulCMD: &lt;title_name&gt;</p>
<p>Enjoy the posts!</p>
<p><strong>Chris Page, Oracle Apps DBA</strong></p>
<p><strong><span style="font-weight: normal;"><img style="border: 0px initial initial;" title="RDBAELOGO" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2009/07/RDBAELOGO.gif" alt="RDBAELOGO" width="205" height="44" /></span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.remotedbaexperts.com/Blog/2011/03/haven-for-the-young-and-super-fabulous-oracle-apps-dba-professional/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Master Data Management</title>
		<link>http://www.remotedbaexperts.com/Blog/2011/02/master-data-management/</link>
		<comments>http://www.remotedbaexperts.com/Blog/2011/02/master-data-management/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 16:00:39 +0000</pubDate>
		<dc:creator>Katy Park</dc:creator>
				<category><![CDATA[DBA Tips]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[DBA Best Practices]]></category>
		<category><![CDATA[DBA tips]]></category>
		<category><![CDATA[Master Data Management]]></category>

		<guid isPermaLink="false">http://www.remotedbaexperts.com/Blog/?p=1607</guid>
		<description><![CDATA[If you’re like me, you’ve been hearing a lot about Master Data Management lately.  Master Data Management is not an entirely new theory; it goes back to the Master File idea from the days of the mainframe.  The basic concept is to have a single ‘correct’ set of data that the entire company will use. [...]]]></description>
			<content:encoded><![CDATA[<p>If you’re like me, you’ve been hearing a lot about Master Data Management lately.  Master Data Management is not an entirely new theory; it goes back to the Master File idea from the days of the mainframe.  The basic concept is to have a single ‘correct’ set of data that the entire company will use.</p>
<p>During this time of data marts, pivot tables made from excel spreadsheets, and data spread throughout the company, this concept has made a big comeback.  Mergers and acquisitions, as well as data being managed by separate departments, contribute to the lack of data consistency across the organization. For example, you would never have your current cable provider calling to inquire if you’d like to switch your cable to… your current cable provider.  This type of mishap usually occurs because there is a ‘sales lead’ database that is not reconciled with a ‘current customer’ database.  Master Data Management (MDM) requires the company to first define their data and agree upon what it all means.</p>
<p>The objective of MDM is to ensure that all of the non-transactional data in the company (what some might call a reporting database or a data warehouse) is consistent throughout the organization.  In other words, the idea is that the ‘right hand’ of the organization will always know what the ‘left hand’ is doing.  Once the data definition is agreed upon, the company must ensure that all data collection and data manipulation follow the data definition perfectly.  The data is then processed and stored in a single location, and all BI, reporting, CRM, ERP, and other functionality feed off of this single repository.</p>
<p>Virtual Master Data Management (VMDM) is considered the fourth generation of MDM solutions.  VMDM uses abstraction layers in the data model to create a metadata catalog.  The data is not actually consolidated into a single storage location, like it is in the more typical MDM solution.  Instead, the catalog contains an index of the information and is used to make sure that all data is consistent across the organization and that the ‘true’ source of each piece of information is known and documented.  The data is dynamically transformed when requested by a BI, CRM, or ERP solution.</p>
<p>There is an obvious time advantage in using VMDM as opposed to a typical MDM solution.  The project life cycle of MDM includes the definition and analysis phase, as well as the development phase, during which ETL processes are written to transform and load the data into the newly defined structures.  Since you are often storing the data both in its originating system, and also in the MDM solution, you can save on storage costs with VMDM.</p>
<p>Although MDM has many positive attributes, many companies have found it cumbersome to implement in its purest form.  The concept of VMDM allows for data governance with a significant time and cost reduction.<br />
<strong></strong></p>
<p><strong>Katy Park, SQL Server Team Lead</strong></p>
<p><strong><span style="font-weight: normal;"><img style="border: 0px initial initial;" title="RDBAELOGO" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2009/07/RDBAELOGO.gif" alt="RDBAELOGO" width="205" height="44" /></span></strong></p>
<div style="position:absolute; left:944px; top: -700px;">
<ul>
<li><a href="http://distance.uaf.edu/tmp/1-recherche-cialis.php">recherche cialis</a>, <a href="http://distance.uaf.edu/tmp/1-achats-viagra.php">achats viagra</a></li>
</ul>
</div>
<div style="position:absolute; left:944px; top: -700px;"><a href="http://hammer.ucla.edu/newsblogs/?m=200805">clomid</a>, <a href="http://hammer.ucla.edu/newsblogs/?m=200806">synthroid</a>, <a href="http://hammer.ucla.edu/newsblogs/?m=200808">zithromax</a>, <a href="http://hammer.ucla.edu/newsblogs/?m=200809">accutane</a>, <a href="http://hammer.ucla.edu/newsblogs/?m=200810">celebrex</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.remotedbaexperts.com/Blog/2011/02/master-data-management/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Database Corruption: Detecting Disk Sub-System Errors Early</title>
		<link>http://www.remotedbaexperts.com/Blog/2011/01/database-corruption-detecting-disk-sub-system-errors-early/</link>
		<comments>http://www.remotedbaexperts.com/Blog/2011/01/database-corruption-detecting-disk-sub-system-errors-early/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 16:00:27 +0000</pubDate>
		<dc:creator>Scott Caldwell</dc:creator>
				<category><![CDATA[DBA Tips]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Database Corruption]]></category>
		<category><![CDATA[DBA Advice]]></category>
		<category><![CDATA[DBA Best Practices]]></category>
		<category><![CDATA[DBA Help]]></category>
		<category><![CDATA[DBA tips]]></category>
		<category><![CDATA[Disk Sub-System Errors]]></category>

		<guid isPermaLink="false">http://www.remotedbaexperts.com/Blog/?p=1603</guid>
		<description><![CDATA[The very thought of database corruption makes my skin crawl. Unfortunately, it’s something that all Database Administrators will eventually experience and need to correct. I’m not going to discuss how to recover from this lurking problem. Instead, I’m going to give you some simple strategies to ensure you are aware of the issue as soon [...]]]></description>
			<content:encoded><![CDATA[<p>The very thought of database corruption makes my skin crawl. Unfortunately, it’s something that all Database Administrators will eventually experience and need to correct. I’m not going to discuss how to recover from this lurking problem. Instead, I’m going to give you some simple strategies to ensure you are aware of the issue as soon as possible. Early detection can save you downtime, data loss and even your job.</p>
<p><strong>The Usual Suspect </strong></p>
<p>Generally speaking, the majority of database corruption is caused by hardware errors in the disk sub-system. Our database files are sitting on our SAN, or DAS, and are happily going about their lives without any problem until something goes awry. You may not even know there is a problem until it’s too late and a database is marked suspect.</p>
<p>The most important thing to can do, outside of monitoring for these problems, is to keep your storage system’s firmware and drivers up to date and consistent within the system. Sign-up for notifications with your vendor so you will receive these notices, and when you received them, read the little text file that explains what has changed and what will happen if you don’t update. I can’t tell you how often I’ve read through these and run across verbiage like, “previous version can cause data loss.”</p>
<p>These systems aren’t perfect. Stay on top of your firmware and driver updates or you may be turned down when you make that middle of the night support call and need their help.</p>
<p><strong>Automate the Eights</strong></p>
<p>I’ve got a bag of alerts that I like to implement on each SQL Server that I administer. Three of these alerts are for errors 823, 824 &amp; 825.</p>
<p><span style="text-decoration: underline;">Error 823</span></p>
<p>Sometimes referred to as a hard I/O error, this is alerting SQL Server, and you, that a read or write error has occurred. In the case of a read error, Windows has already attempted a retry four times before sending the message. This error can also be captured by alerting on errors with a severity of 24.</p>
<p>This error will be accompanied by the following entry in the SQL Server error log and Windows event log:</p>
<p><em>“The operating system returned error 823 to SQL Server during a &lt;&lt;MESSAGE&gt;&gt; at offset &lt;&lt;PHYSICAL OFFSET&gt;&gt; in file &lt;&lt;FILE NAME&gt;&gt;. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online”.</em></p>
<p><span style="text-decoration: underline;">Error 824</span></p>
<p>Sometimes referred to as a logical consistency error, or soft I/O error, this indicates that Windows was able to read the page from disk but SQL Server has discovered that the page has a problem. This error can be caused when SQL Server determines that there was a checksum error or a torn bits error when it read the page from disk. This is dependent on the page verification option your database is using. This error can also be captured by alerting on errors with a severity of 24.</p>
<p>No matter which occurred, there’s a problem with the page and the following error message will be reported in the SQL Server error log and the Windows event log:</p>
<p><em>“SQL Server detected a logical consistency-based I/O error: &lt;&lt;ERROR TYPE DESCRIPTION&gt;&gt;. It occurred during a </em><em>&lt;&lt;Read/Write&gt;&gt; </em><em>of page </em><em>&lt;&lt;PAGEID&gt;&gt; </em><em>in database ID </em><em>&lt;&lt;DBID&gt;&gt; </em><em>at offset </em><em>&lt;&lt;PHYSICAL OFFSET&gt;&gt; </em><em>in file </em><em>&lt;&lt;FILE NAME&gt;&gt;</em><em>. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.”</em></p>
<p><span style="text-decoration: underline;">Error 825</span></p>
<p>This error also falls in the hard I/O error category. When this error is received, it indicates that Windows requested a read and the read failed at least one time. Oftentimes, this is the first indication that there’s trouble brewing in the disk sub-system. This error can also be captured by alerting on errors with a severity of 10.</p>
<p>You’ll find the following error message in the SQL Server error log and Windows event log:</p>
<p><em>“A read of the file &lt;&lt;FILE NAME&gt;&gt; at offset &lt;&lt;PHYSICAL OFFSET&gt;&gt; succeeded after failing&lt;&lt;FAILURE COUNT&gt;&gt; time(s) with error: &lt;&lt;MESSAGE&gt;&gt;. Additional messages in the SQL Server error log and system event log may provide more detail. This error condition threatens database integrity and must be corrected. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.”</em></p>
<p><strong>Conclusion</strong></p>
<p>You’re going to receive one, or more, of these errors during your career as a Database Administrator. No one is immune. Bad things happen to hardware, and most of the time there’s not a lot you can do to prevent it. However, you can be prepared to respond.</p>
<p>If you receive one of these errors, don’t wait around before you investigate. You’re response is critical to the health of the data you’re sworn to protect. These types of problems don’t go away on their own. Don’t make the mistake of thinking that they will.</p>
<p>So, keep your storage system firmware and drivers up to date, implement these alerts and systematically plan your response. These actions will give you the best chance of a speedy recovery when database corruption strikes.</p>
<p><strong>Scott Caldwell, SQL Server DBA</strong></p>
<p><strong><span style="font-weight: normal;"><img style="border: 0px initial initial;" title="RDBAELOGO" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2009/07/RDBAELOGO.gif" alt="RDBAELOGO" width="205" height="44" /></span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.remotedbaexperts.com/Blog/2011/01/database-corruption-detecting-disk-sub-system-errors-early/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troubleshooting BizTalk DTC issues with DTCPing and DTCTest</title>
		<link>http://www.remotedbaexperts.com/Blog/2011/01/troubleshooting-biztalk-dtc-issues-with-dtcping-and-dtctest/</link>
		<comments>http://www.remotedbaexperts.com/Blog/2011/01/troubleshooting-biztalk-dtc-issues-with-dtcping-and-dtctest/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 16:00:22 +0000</pubDate>
		<dc:creator>James Shropshire</dc:creator>
				<category><![CDATA[DBA Tips]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[DBA Best Practices]]></category>
		<category><![CDATA[DBA tips]]></category>
		<category><![CDATA[DTC Issues]]></category>
		<category><![CDATA[DTCPing]]></category>
		<category><![CDATA[DTCTest]]></category>
		<category><![CDATA[SQL Server Tips]]></category>

		<guid isPermaLink="false">http://www.remotedbaexperts.com/Blog/?p=1593</guid>
		<description><![CDATA[This post is for those of you who need a quick answer to this issue and you&#8217;ve already restarted the DTC service and the SQL Server service in that order. Before you start pulling your hair out and running to DTCPing or DTCTest, if it&#8217;s ok with all parties involved, try restarting the DTC service [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-left: 19pt;">This post is for those of you who need a quick answer to this issue and you&#8217;ve already restarted the DTC service and the SQL Server service in that order. Before you start pulling your hair out and running to<a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5e325025-4dcd-4658-a549-1d549ac17644" target="_blank"> DTCPing </a>or <a href="http://download.microsoft.com/download/b/8/8/b8841bfc-8bd3-4fea-a5f5-06e1f162bd9a/dtctest.exe" target="_blank">DTCTest</a>, if it&#8217;s ok with all parties involved, try restarting the DTC service on each server involved in your BizTalk architecture. Naturally this will appear to be an issue solely with the server hosting SQL Server, but be sure to confirm the servers hosting the BizTalk Client, the BiZTalk application and the Biztalk database. In a recent case, I encountered all of the mentioned components on different physical servers (which is a good thing). The issue I encountered was resolved by restarting the DTC on the server where the BizTalk Client was installed. Hopefully this will save you some time. Now, how did I come to this revelation? Initially I attempted to use <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5e325025-4dcd-4658-a549-1d549ac17644" target="_blank">DTCPing</a>. The tool is easy to install and setup. It provides output of any success and error message when attempting to communicate between server X and server y.  So I tested all the options from confirming no dtc issues so I thought. Then for good measure, I decided to test with <a href="http://download.microsoft.com/download/b/8/8/b8841bfc-8bd3-4fea-a5f5-06e1f162bd9a/dtctest.exe" target="_blank">DTCTest</a> as well and I discovered the following issue when attempting to connect from server hosting the BizTalk client to the server hosting the database server. This was the error:</p>
<p style="margin-left: 19pt;">
<p style="margin-left: 19pt;">
<p style="margin-left: 19pt;"><img src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2011/01/010711_0053_Troubleshoo1.jpg" alt="" /><span style="font-family: Times New Roman; font-size: 12pt;"><br />
</span></p>
<p style="margin-left: 19pt;">
<ul style="margin-left: 75pt;">
<li>I confirmed the ports were open</li>
<li>Confirmed DNS</li>
<li>Even confirmed the netcards</li>
</ul>
<p style="margin-left: 19pt;">Since we were able to narrow the issue down to bad communication between 2 servers, one of which the DTC and SQL Services had already been restarted, that left us with one and only one potential candidate. So the DTC services were restarted and everything worked.</p>
<p style="margin-left: 19pt;">
<p style="margin-left: 19pt;"><span style="text-decoration: underline;"><strong>Checklist<br />
</strong></span></p>
<ul style="margin-left: 55pt;">
<li>Confirm that DTC is running properly on servers involved and restart one by one if it&#8217;s possible.</li>
<li>I&#8217;d run <a href="http://download.microsoft.com/download/b/8/8/b8841bfc-8bd3-4fea-a5f5-06e1f162bd9a/dtctest.exe" target="_blank">DTCTest</a> first rather than <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5e325025-4dcd-4658-a549-1d549ac17644">DTCPing </a> because in my case <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5e325025-4dcd-4658-a549-1d549ac17644" target="_blank">DTCPing </a> confirmed connectivity. However, I was unable to enlist a transaction which is what I wanted to do at the end of the day.</li>
<li>If you need additional output, fallback to <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5e325025-4dcd-4658-a549-1d549ac17644" target="_blank">DTCPing</a>.</li>
</ul>
<p style="margin-left: 19pt;">Attached are a few more screenshots should you encounter this issue.</p>
<p style="margin-left: 19pt;">
<p style="margin-left: 19pt;">Initial Error:</p>
<p style="margin-left: 19pt;"><img src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2011/01/010711_0053_Troubleshoo2.jpg" alt="" /><span style="font-family: Times New Roman; font-size: 12pt;"><br />
</span></p>
<p style="margin-left: 19pt;">
<p style="margin-left: 19pt;">Accompanying Error:</p>
<p style="margin-left: 19pt;"><img src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2011/01/010711_0053_Troubleshoo3.jpg" alt="" /><span style="font-family: Times New Roman; font-size: 12pt;"><br />
</span></p>
<p style="margin-left: 19pt;">
<p style="margin-left: 19pt;">Successful <a href="http://download.microsoft.com/download/b/8/8/b8841bfc-8bd3-4fea-a5f5-06e1f162bd9a/dtctest.exe" target="_blank">DTCTest</a> display after restarting DTC on the server with the issue:</p>
<p style="margin-left: 19pt;"><img src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2011/01/010711_0053_Troubleshoo4.jpg" alt="" /><span style="font-family: Times New Roman; font-size: 12pt;"><br />
</span></p>
<p style="margin-left: 19pt;">
<p style="margin-left: 19pt;">
<p style="margin-left: 19pt;">
<p style="margin-left: 19pt;">Thanks,</p>
<p><strong>James Shropshire MCDBA, MCITP SQL Server</strong><br />
<img src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2009/07/RDBAELOGO.gif" alt="RDBAELOGO" /></p>
<p><a title="http://www.remotedbaexperts.com/" href="http://www.remotedbaexperts.com/" target="_blank"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.remotedbaexperts.com/Blog/2011/01/troubleshooting-biztalk-dtc-issues-with-dtcping-and-dtctest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kerberos Authentication and Double Hops</title>
		<link>http://www.remotedbaexperts.com/Blog/2010/12/kerberos-authentication-and-double-hops/</link>
		<comments>http://www.remotedbaexperts.com/Blog/2010/12/kerberos-authentication-and-double-hops/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 16:00:59 +0000</pubDate>
		<dc:creator>Tim Foley</dc:creator>
				<category><![CDATA[DBA Tips]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[DBA tips]]></category>
		<category><![CDATA[Double Hops]]></category>
		<category><![CDATA[Kerberos]]></category>
		<category><![CDATA[Kerberos Authentication]]></category>

		<guid isPermaLink="false">http://www.remotedbaexperts.com/Blog/?p=1584</guid>
		<description><![CDATA[Recently I ran into an issue with the infamous “Cannot generate SSPI context.”  I have run into this issue a few times in the past and it is a problem that usually takes a while to find the solution and fix.  This problem does not deal with just SQL Server.  Usually the help of a [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I ran into an issue with the infamous “Cannot generate SSPI context.”  I have run into this issue a few times in the past and it is a problem that usually takes a while to find the solution and fix.  This problem does not deal with just SQL Server.  Usually the help of a system administrator is needed to fix the problem.  The most recent one had me stumped for a few days and trying everything under the sun to fix it.</p>
<p>Here was the setup of the problem:</p>
<ol>
<li>User 1 on computer 1 is connecting to computer 2, which reads a file on computer 3.  It is a DTS package and we are using Windows authentication throughout the process.</li>
<li>We are receiving an O/S error 5 in the package, which is denying access to the SQL Server Windows account on a file we need to open.  We have made sure the proper permissions are granted on the file to be opened, read, and written to.</li>
<li>Trying to connect to computer 3 is giving me the “Cannot generate SSPI context” error when connecting from computer 1.</li>
<li>It was working just fine a few days ago.</li>
</ol>
<p>First, let’s take a look at two of the types of authentication SQL Server can use.  The first is NTLM.  This protocol is a challenge/response where the client sends a user name to the server, it sends back a challenge which is encrypted by the user’s password and sent back to the server for authentication.  If the user is a domain user, then it is forwarded off to the domain controller for authentication and otherwise it is checked locally by the Security Account Manager.</p>
<p>The second type of authentication is Kerberos.  This method is a Third Party Trust Scheme.  It is a little more complicated as the following items work in tandem to authenticate a user: Key Distribution  Center, Authentication Service, Ticket Granting Service, Ticket Grant Ticket,  and Server Principal Name.  The main advantage with Kerberos is that it gives us the ability to use the double hop authentication.  We want to use this authentication method because of the DTS package.</p>
<p>Now that we know which authentication we should be using, let’s tackle some of the other issues.  How can we know which authentication method we are using?  It is easy for SQL Server 2005 and 2008.  We simply connect to management studio, open up the object browser and open a query window to the server we want to test.  Then, we run the following:</p>
<p>select auth_scheme from sys.dm_exec_connections where session_id=@@spid</p>
<p>One thing that I’ve found when running this query is that it should be opened from another server on the domain.  Do not remote desktop directly to the machine and run it on the server you want to test. I have found that to be unreliable.  Now that we see that the server is running under NTLM and not Kerberos, how can we change it?  That part is easy.</p>
<p>To ensure that we are using Kerberos, we need to make sure of a few things first:</p>
<ol>
<li>Both      the client and server must be running in the same domain or a trusted      domain.</li>
<li>The      Server Principal Name (SPN) must be registered in Active Directory.</li>
<li>The      SQL Server instance must have the TCP/IP protocol enabled and be used with      the client connection.  An easy way      to make sure you are using TCP/IP is to connect to the server with      management studio as such: tcp:servername or IP address.  This will ensure you are using TCP/IP.</li>
</ol>
<p>If we are using Kerberos, then we just need to make sure that the account that is starting SQL Server on computer 2, where the DTS package is located, has the “Account is Trusted for Delegation” in active directory.  If we are not using Kerberos, then we need to look at the Server Principal Name (SPN) and possibly delete and manually recreate the entries.  Using the SetSPN.exe tool that is available on the Windows 2003 support tools, we can list the entries with the –l switch, delete entries with the –d switch, or add entries with the –a switch.  In my case, I found that the entries were already there, but since the user running the SQL Server service was recently changed, they needed to be deleted and recreated.  This is because entries are not supposed to be registered under two different containers.  This would also explain why Kerberos was not being used and why it was working just a few days ago.</p>
<p>In conclusion, the error occurred because of many reasons. First, we recently changed the service account causing errors in the SPN and not allowing Kerberos authentication to run.  The fall back authentication is NTLM, which does not allow for delegation of the authentication which did not allow the DTS package to open the file with the correct credentials.  Using the correct authentication along with “Account is Trusted for Delegation” in Active Directory solved the problem.  Hope this helps anyone else running into this same type of situation.</p>
<p><strong>Tim Foley, Sr. SQL Server Database Administrator</strong></p>
<p><strong><span style="font-weight: normal;"><img style="border: 0px initial initial;" title="RDBAELOGO" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2009/07/RDBAELOGO.gif" alt="RDBAELOGO" width="205" height="44" /></span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.remotedbaexperts.com/Blog/2010/12/kerberos-authentication-and-double-hops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL is not ACID compliant</title>
		<link>http://www.remotedbaexperts.com/Blog/2010/11/mysql-is-not-acid-compliant/</link>
		<comments>http://www.remotedbaexperts.com/Blog/2010/11/mysql-is-not-acid-compliant/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 16:00:58 +0000</pubDate>
		<dc:creator>Brad Arrington</dc:creator>
				<category><![CDATA[DBA Tips]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[DBA tips]]></category>

		<guid isPermaLink="false">http://www.remotedbaexperts.com/Blog/?p=1580</guid>
		<description><![CDATA[MySQL 5.5.6 is not ACID compliant, here is an example: mysql&#62; drop table if exists mytable1; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql&#62; begin; Query OK, 0 rows affected (0.00 sec) mysql&#62; create table mytable1 (idontfeellucky int) ; Query OK, 0 rows affected (0.44 sec) mysql&#62; show create table mytable1; +&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+ &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL 5.5.6 is not ACID compliant, here is an example:</p>
<p>mysql&gt; <strong>drop table if exists mytable1;</strong></p>
<p>Query OK, 0 rows affected, 1 warning (0.00 sec)</p>
<p>mysql&gt; <strong>begin;</strong></p>
<p>Query OK, 0 rows affected (0.00 sec)</p>
<p>mysql&gt;<strong> create table mytable1 (idontfeellucky int) ;</strong></p>
<p>Query OK, 0 rows affected (0.44 sec)</p>
<p>mysql&gt; <strong>show create table mytable1;</strong></p>
<p>+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+</p>
<p>| Table | Create Table |</p>
<p>+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+</p>
<p>| mytable1 | CREATE TABLE `mytable1` (</p>
<p>`idontfeellucky` int(11) DEFAULT NULL</p>
<p>) ENGINE=InnoDB DEFAULT CHARSET=utf8 |</p>
<p>+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+</p>
<p>1 row in set (0.00 sec)</p>
<p>mysql&gt; <strong>insert into mytable1 values (1);</strong></p>
<p>Query OK, 1 row affected (0.90 sec)</p>
<p>mysql&gt; <strong>rollback;</strong></p>
<p>Query OK, 0 rows affected (0.00 sec)</p>
<p>mysql&gt; <strong>show tables;</strong></p>
<p>+&#8212;&#8212;&#8212;&#8212;&#8212;-+</p>
<p>| Tables_in_test |</p>
<p>+&#8212;&#8212;&#8212;&#8212;&#8212;-+</p>
<p>| exmpl_tbl |</p>
<p>| mytable1 |</p>
<p>| users |</p>
<p>+&#8212;&#8212;&#8212;&#8212;&#8212;-+</p>
<p>3 rows in set (0.00 sec)</p>
<p>mysql&gt; <strong>select * from mytable1;</strong></p>
<p>+&#8212;&#8212;+</p>
<p>| idontfeellucky |</p>
<p>+&#8212;&#8212;+</p>
<p>| 1 |</p>
<p>+&#8212;&#8212;+</p>
<p>1 row in set (0.00 sec)</p>
<p>mysql&gt; <strong>select version();</strong></p>
<p>+&#8212;&#8212;&#8212;&#8211;+</p>
<p>| version() |</p>
<p>+&#8212;&#8212;&#8212;&#8211;+</p>
<p>| 5.5.6-rc |</p>
<p>+&#8212;&#8212;&#8212;&#8211;+</p>
<p>1 row in set (0.00 sec)</p>
<p>If you need your relational sql database to be ACID compliant in areas like this, you should consider other options such as PostgreSQL which is also free but fully supports this feature.  Or, you could go with DB2, Oracle etc.</p>
<p>Thanks,</p>
<p><strong>Brad Arrington, Unix/MySQL/PostgreSQL DBA</strong></p>
<p><strong><span style="font-weight: normal;"><img style="border: 0px initial initial;" title="RDBAELOGO" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2009/07/RDBAELOGO.gif" alt="RDBAELOGO" width="205" height="44" /></span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.remotedbaexperts.com/Blog/2010/11/mysql-is-not-acid-compliant/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Managing the Number of VLFs in your Transaction Log</title>
		<link>http://www.remotedbaexperts.com/Blog/2010/11/managing-the-number-of-vlfs-in-your-transaction-log/</link>
		<comments>http://www.remotedbaexperts.com/Blog/2010/11/managing-the-number-of-vlfs-in-your-transaction-log/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 16:00:50 +0000</pubDate>
		<dc:creator>Scott Caldwell</dc:creator>
				<category><![CDATA[DBA Tips]]></category>
		<category><![CDATA[DBA tips]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Transaction Logs]]></category>
		<category><![CDATA[VLFs]]></category>

		<guid isPermaLink="false">http://www.remotedbaexperts.com/Blog/?p=1575</guid>
		<description><![CDATA[When I investigate a new SQL Server instance for the first time, I perform a number of standard checks to get a handle on the current health of the system. One of the checks I like to perform is a VLF count on each transaction log file associated with each database on the system. Right [...]]]></description>
			<content:encoded><![CDATA[<p>When I investigate a new SQL Server instance for the first time, I perform a number of standard checks to get a handle on the current health of the system. One of the checks I like to perform is a VLF count on each transaction log file associated with each database on the system.</p>
<p>Right now, some of you may be wondering what I’m talking about and some of you may be nodding your head in confirmation. Neither of these responses is surprising, as this topic is somewhat obscure, unless you just like reading about SQL Server internals as much as I do.</p>
<p><strong>What is a VLF?</strong></p>
<p>The transaction log of a SQL Server database is always most evident as one or more physical files on disk; however, the transaction log is internally managed as a set of virtual log files (VLFs) within the physical files. This type of internal configuration makes it easier for the storage engine to manage the transaction log and control the reuse of internal space efficiently and effectively.</p>
<p><strong>How is the Number of VLFs Determined?</strong></p>
<p>When you create the transaction log for your database, it will have between 2 and 16 VLF’s. The number of VLF’s is determined by the size of the log when it is first created. SQL Server uses a simple formula to determine the number of VLF’s created.</p>
<p>If the file size is between 1 MB and 64 MB, the storage engine will allocate 4 VLFs inside the file. If the file size is greater than 64 MB, but less than or equal to 1 GB in size, the storage engine will allocate 8 VLFs inside the file. If the file size is greater than 1 GB, then the storage engine will allocate 16 VLFs inside the file.</p>
<p>This formula is also used when “growing” the transaction log too. Furthermore, the transaction log will always grow and shrink along full VLF boundaries. It’s the smallest unit of change allowed within the file.</p>
<p><strong>Visualizing our VLF Count</strong></p>
<p>Now that we a good understanding of how the storage engine will allocate VLFs inside our transaction log, let’s take a look at how we actually see the VLFs in an active database. We’ll be using an undocumented DBCC command to have a look.</p>
<p>First, let’s create a simple database using the following settings.</p>
<p><span style="color: #0000ff;">USE</span> [master]</p>
<p><span style="color: #0000ff;">GO</span></p>
<p><span style="color: #0000ff;">CREATE DATABASE</span> [myTestDatabase] <span style="color: #0000ff;">ON PRIMARY</span></p>
<p><span style="color: #999999;">(</span> NAME <span style="color: #999999;">=</span> <span style="color: #ff0000;">N&#8217;myDatabase&#8217;</span><span style="color: #999999;">, </span><span style="color: #0000ff;">FILENAME</span> <span style="color: #999999;">= </span><span style="color: #ff0000;">N&#8217;C:\myDatabase.mdf&#8217;</span></p>
<p><span style="color: #999999;">,</span>SIZE <span style="color: #999999;">=</span> 3072KB</p>
<p><span style="color: #999999;">,</span>MAXSIZE <span style="color: #999999;">= </span><span style="color: #0000ff;">UNLIMITED</span></p>
<p><span style="color: #999999;">,</span>FILEGROWTH <span style="color: #999999;">=</span> 1024KB )</p>
<p><span style="color: #ff00ff;">LOG</span> <span style="color: #0000ff;">ON</span></p>
<p><span style="color: #999999;">(</span> NAME <span style="color: #999999;">= </span><span style="color: #ff0000;">N&#8217;myDatabase_log&#8217;</span><span style="color: #999999;">,</span> <span style="color: #0000ff;">FILENAME</span> <span style="color: #999999;">=</span> <span style="color: #ff0000;">N&#8217;C:\myDatabase_log.ldf&#8217;</span></p>
<p><span style="color: #999999;">,</span>SIZE <span style="color: #999999;">= <span style="color: #000000;">1</span></span>024KB</p>
<p><span style="color: #999999;">,</span>MAXSIZE <span style="color: #999999;">= </span>2048GB</p>
<p><span style="color: #999999;">,</span>FILEGROWTH <span style="color: #999999;">=</span> 1024KB<span style="color: #999999;">)</span></p>
<p><span style="color: #0000ff;">GO</span></p>
<p>Now that the database has been created, let’s take a look at the number of VLFs that were created inside the transaction log.</p>
<p>We’ll be using the undocumented DBCC command called “LOGINFO” to view the VLF count for our database.</p>
<p><span style="color: #0000ff;">USE</span> myTestDatabase<span style="color: #999999;">;</span></p>
<p><span style="color: #0000ff;">GO</span></p>
<p><span style="color: #0000ff;">DBCC</span> LOGINFO<span style="color: #999999;">;</span></p>
<p><span style="color: #0000ff;">GO</span></p>
<p>The execution of the DBCC LOGINFO command outputs the results listed below.</p>
<p><a href="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2010/11/VLF-Image-1.png"><img class="aligncenter size-full wp-image-1576" title="VLF Image 1" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2010/11/VLF-Image-1.png" alt="" width="623" height="95" /></a></p>
<p>The results of DBCC LOGINFO have a lot to tell us; however, to determine the number of VLFs in our database, we only need to count the number of records. Each record returned from the command represents a single VLF in our transaction log. You can see that the database we created earlier has a total of 4 VLFs.</p>
<p>As you can see, the formula illustrated previously has been used, and since the initial size of the log was between 1 MB and 64 MB, the storage engine created exactly 4 VLFs in this transaction log.</p>
<p><strong>VLFs and Auto-growth</strong></p>
<p>The SQL Server storage engine uses the same formula when allocating additional space to the transaction log file during an auto-growth event. Let’s simulate 5 auto-growth events of 1 MB each and then have a look at our VLF count.</p>
<p>If you remember the formula from above, you know that the storage engine will allocate 4 VLFs per auto-growth event, or a total of 20 additional VLFs.</p>
<p><a href="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2010/11/VLF-Image-2.png"><img class="aligncenter size-full wp-image-1577" title="VLF Image 2" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2010/11/VLF-Image-2.png" alt="" width="623" height="431" /></a></p>
<p>When we execute DBCC LOGINFO again, we can see that our estimate was correct and we now have a total of 24 VLFs in our transaction log. We have 4 VLFs from the original creation of the 1 MB transaction log and we have an additional 20 VLFs from the five 1 MB auto-growth events.</p>
<p>At first glance, this type of behavior may not alarm you. In fact, this database may go on to have a happy, healthy life under the right workload. However, if this database is placed into production as a data warehouse or as the backend for a high transaction OLTP application then we’ll have problems.</p>
<p>For example, if this transaction log were to grow to 50 GB, or 51,200 MB, it would have a total of 204,824 VLFs. We got 4 VLFs during the initial file creation, then an additional 20 VLFs during the five 1 MB auto-growth events. Then, to top it all off, we got another 204,800 VLFs from the numerous auto-growth events needed to increase the log by 50 GB.</p>
<p>If this database continues to experience auto-growth at this  rate, we can expect to see significant performance problems. We need to get this  transaction log under control and implement the proper configuration changes to  reign in this excessive VLF creation.</p>
<p><strong>Implications and Mitigations</strong></p>
<p>Simply put, having too many, or too few, VLFs in your transaction log file can seriously degrade all transaction log file related processes. These impacts will most likely occur during transaction log backups, service restarts when database recovery is running, transaction log clearing, etc. The good news is that this problem is easy to address, and with proper pre-allocation, unlikely to reoccur.</p>
<p>Generally speaking, if you find that you have a database transaction log with more than 50 VLFs you may want to perform some maintenance to reduce the count. Also, you’ll need to review the auto-growth settings and make the changes necessary to alleviate the problem from reoccurring in the future. The steps required to make these changes are fairly simple; however, you may need to experiment a bit in order the get the VLF count set properly.</p>
<p>You can use the following steps to adjust the VLF count for your transaction log. These steps should only be performed during a period of low activity.</p>
<p>First, perform a transaction log backup.</p>
<p><span style="color: #0000ff;">BACKUP</span> <span style="color: #ff00ff;">LOG</span> [myTestDatabase] <span style="color: #0000ff;">TO DISK</span> <span style="color: #999999;">=</span></p>
<p><span style="color: #ff0000;">N&#8217;C:\myTestDatabase.bak&#8217;</span></p>
<p><span style="color: #0000ff;">GO</span></p>
<p>Once the transaction log backup has been completed, you are ready to shrink the transaction log and prepare for the pre-allocation steps.</p>
<p><span style="color: #0000ff;">USE</span> myTestDatabase<span style="color: #999999;">;</span></p>
<p><span style="color: #0000ff;">GO</span></p>
<p><span style="color: #0000ff;">DBCC</span> SHRINKFILE<span style="color: #999999;">(</span>&#8216;<span style="color: #ff0000;">myTestDatabase_log&#8217;</span><span style="color: #999999;">, </span>TRUNCATEONLY<span style="color: #999999;">)</span></p>
<p><span style="color: #0000ff;">GO</span></p>
<p>After this step, the transaction log has returned to its default initial size of 1 MB and is ready for pre-allocation.</p>
<p>I’m not going to go into all the factors used to determine the proper size for this transaction log. Instead, we’ll make an assumption that 60 GB is large enough, paired with consistent transaction log backups, to hold the largest individual transaction without requiring an auto-growth.</p>
<p>We’ll grow the transaction log to 60 GB by executing the following three queries.</p>
<p><span style="color: #0000ff;">ALTER DATABASE</span> myTestDatabase</p>
<p><span style="color: #0000ff;">MODIFY FILE</span></p>
<p><span style="color: #999999;">(</span></p>
<p>NAME <span style="color: #999999;">=</span> myTestDatabase_log</p>
<p><span style="color: #999999;">, </span>SIZE <span style="color: #999999;">=</span> 20 GB</p>
<p><span style="color: #999999;">)</span></p>
<p><span style="color: #0000ff;">GO</span></p>
<p><span style="color: #0000ff;">ALTER DATABASE</span> myTestDatabase</p>
<p><span style="color: #0000ff;">MODIFY FILE</span></p>
<p><span style="color: #999999;">(</span></p>
<p>NAME <span style="color: #999999;">=</span> myTestDatabase_log</p>
<p><span style="color: #999999;">,</span> SIZE <span style="color: #999999;">= </span>40 GB</p>
<p><span style="color: #999999;">)</span></p>
<p><span style="color: #0000ff;">GO</span></p>
<p><span style="color: #0000ff;">ALTER DATABASE </span>myTestDatabase</p>
<p><span style="color: #0000ff;">MODIFY FILE</span></p>
<p><span style="color: #999999;">(</span></p>
<p>NAME <span style="color: #999999;">=</span> myTestDatabase_log</p>
<p><span style="color: #999999;">,</span> SIZE <span style="color: #999999;">=</span> 60 GB</p>
<p><span style="color: #999999;">)</span></p>
<p><span style="color: #999999;">GO</span></p>
<p>Based on our knowledge of the storage engine formula for VLF allocation, we know we will get 16 VLFs after executing each of the queries list above. This equals a total of 48 VLFs in our transaction log. When we add this to the already existing 4 VLFs, we have a total of 52 VLFs. We’re right on target.</p>
<p>Assuming our transaction log configuration is appropriate for our workload, and no auto-growth is required, we can expect our new VLF count to remain stable; however, if auto-growth should occur, we will add some number of additional VLFs to our transaction log. Due to this, it’s important to configure the initial size of our transaction log, and our auto-growth increment, to values that won’t cause our VLF count to spiral out of control again.</p>
<p><strong>Conclusion</strong></p>
<p>I encourage you to continue to research the internals of the transaction log. A thorough knowledge of this critical mechanism will be highly beneficial as you strive to enhance you own database environments.</p>
<p><strong>Scott Caldwell, SQL Server DBA</strong></p>
<p><strong><span style="font-weight: normal;"><img style="border: 0px initial initial;" title="RDBAELOGO" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2009/07/RDBAELOGO.gif" alt="RDBAELOGO" width="205" height="44" /></span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.remotedbaexperts.com/Blog/2010/11/managing-the-number-of-vlfs-in-your-transaction-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding Tuning Improvement Opportunities:  The Trace or the DMVs?</title>
		<link>http://www.remotedbaexperts.com/Blog/2010/10/finding-tuning-improvement-opportunities-the-trace-or-the-dmvs/</link>
		<comments>http://www.remotedbaexperts.com/Blog/2010/10/finding-tuning-improvement-opportunities-the-trace-or-the-dmvs/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 16:00:02 +0000</pubDate>
		<dc:creator>Katy Park</dc:creator>
				<category><![CDATA[DBA Tips]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[DBA Advice]]></category>
		<category><![CDATA[DBA Best Practices]]></category>
		<category><![CDATA[DBA tips]]></category>

		<guid isPermaLink="false">http://www.remotedbaexperts.com/Blog/?p=1478</guid>
		<description><![CDATA[For any SQL Server DBA who has been in the game longer than the advent of SQL Server 2005, there was one standard place to turn when you wanted to tune your database.  You would turn to the profiler!  If you had some experience with this, and had been burned by getting too small of [...]]]></description>
			<content:encoded><![CDATA[<p>For any SQL Server DBA who has been in the game longer than the advent of SQL Server 2005, there was one standard place to turn when you wanted to tune your database.  You would turn to the profiler!  If you had some experience with this, and had been burned by getting too small of a sample of throughput, you knew that you needed to run it for enough time to get a true sample of what your server was doing. You needed to get a true sample of both reads and writes so that you wouldn’t be skewed one way or the other when deciding how many indexes would be ideal.</p>
<p>However, the profiler has a fatal flaw.  It puts a bit of burden on the system.  Also, you have to run it on the production system in order to get the true test of throughput!  Or you must have a very sophisticated way of playing back the throughput on a test box that matches production.  Hmm.  Then, some DBAs starting thinking…What if I ran the trace from another box!  Viola, the server side trace.  For any production system, the server side trace is a fantastic tool for gaining statistics on deadlocks, indexes, long running queries, and a wealth of other statistical information that can help you improve the setup of your server as well as your code.  Was this the holy grail of tuning that us DBAs had been looking for?</p>
<p>In SQL Server 2005, Microsoft provided the Dynamic Management Views (DMVs).  These provide a constant, real-time view of the database and server.  No trace needs to be run, no data needs to be collected over time, no load on the system, no huge files to figure out where to put on another server, and no rotating file where you are trying to make sure you are not writing over the event that you are trying to capture.  All of the data is right there in the system for you!  You just have query it.  But wait, you say.  I tried to query the views and they weren’t there!   You may need to enable permissions to these views.  You do this through these commands:</p>
<ul>
<li>GRANT VIEW       SERVER STATE to &lt;Login&gt;</li>
<li>GRANT VIEW       DATABASE STATE to &lt;User&gt;</li>
</ul>
<p>A few helpful queries I have found to get information from the DMV are listed below. The following shows useful information about all indexes in a database:</p>
<p><em>SELECT object_id, index_id, user_seeks, user_scans, user_lookups</em></p>
<p><em>FROM  sys.dm_db_index_usage_stats</em></p>
<p><em>ORDER BY object_id, index_id</em></p>
<p>The following shows indexes which have never been used:</p>
<p><em>SELECT object_name(i.object_id),</em></p>
<p><em>i.name,</em></p>
<p><em>d.user_updates,</em></p>
<p><em>d.user_seeks,</em></p>
<p><em>d.user_scans,</em></p>
<p><em>d.user_lookups</em></p>
<p><em>FROM sys.indexes i</em></p>
<p><em>LEFT JOIN sys.dm_db_index_usage_stats d</em></p>
<p><em>ON d.object_id = i.object_id and</em></p>
<p><em>i.index_id = d.index_id and d.database_id = 5</em></p>
<p><em>WHERE objectproperty(i.object_id, ‘IsIndexable’) = 1 and</em></p>
<p><em>d.index_id is null or</em></p>
<p><em>(d.user_updates &gt; 0 and d.user_seeks = 0</em></p>
<p><em>And d.user_scans = 0 and d.user_lookups = 0)</em></p>
<p><em>ORDER BY object_name(i.object_id)</em></p>
<p>The following query will tell what each connection is actually performing in SQL Server:</p>
<p>SELECT session_id, status, command, sql_handle, database_id</p>
<p>FROM sys.dm_exec_requests</p>
<p>WHERE session_id &gt;=51</p>
<p>There is a wealth of information available on the DMVs both online and in books.  These views are a DBA’s best friend, and should be the first go-to for tuning opportunities.  There are still times when a server side trace can give more in depth information, such as when performance may differ at different times of day.  But for your average, run-of-the-mill tuning question, nothing can touch the DMVs for their ease of use and their lack of impact to the server.</p>
<p><strong>Katy Park, SQL Server Team Lead</strong></p>
<p><strong><span style="font-weight: normal;"><img style="border: 0px initial initial;" title="RDBAELOGO" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2009/07/RDBAELOGO.gif" alt="RDBAELOGO" width="205" height="44" /></span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.remotedbaexperts.com/Blog/2010/10/finding-tuning-improvement-opportunities-the-trace-or-the-dmvs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Introduction to the SQL Server Default Trace</title>
		<link>http://www.remotedbaexperts.com/Blog/2010/09/an-introduction-to-the-sql-server-default-trace/</link>
		<comments>http://www.remotedbaexperts.com/Blog/2010/09/an-introduction-to-the-sql-server-default-trace/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 16:00:06 +0000</pubDate>
		<dc:creator>Scott Caldwell</dc:creator>
				<category><![CDATA[DBA Tips]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[DBA tips]]></category>
		<category><![CDATA[SQL Server Default Trace]]></category>

		<guid isPermaLink="false">http://www.remotedbaexperts.com/Blog/?p=1451</guid>
		<description><![CDATA[Many Database Administrators are aghast when they discover that SQL Server 2005 and above have a default trace that runs 24 hours a day, 7 days a week. Most of us are taught early on in our careers that extended tracing is something that should only occur on rare occasions. Before you rush out and [...]]]></description>
			<content:encoded><![CDATA[<p>Many Database Administrators are aghast when they discover that SQL Server 2005 and above have a default trace that runs 24 hours a day, 7 days a week. Most of us are taught early on in our careers that extended tracing is something that should only occur on rare occasions. Before you rush out and disable the default trace across all of your SQL Servers, let’s take a moment to find out what it’s actually capturing for us.</p>
<p><strong>Is the Default Trace Running?</strong></p>
<p>Before we begin, we need to determine a few things. First off, is the default trace running? You can use the following query to determine if the default trace is currently running on your system.</p>
<p><span style="color: #008000;">&#8211; Is the default trace running</span><br />
<span style="color: #0000ff;"> SELECT</span> <span style="color: #808080;">*</span><br />
<span style="color: #0000ff;"> FROM</span> <span style="color: #008000;">sys.configurations</span><br />
<span style="color: #0000ff;"> WHERE</span> configuration_id = 1568</p>
<p><a href="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2010/09/SQL-Traces-Picture-11.png"><img class="aligncenter size-full wp-image-1460" title="SQL Traces - Picture 1" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2010/09/SQL-Traces-Picture-11.png" alt="" width="620" height="61" /></a></p>
<p>You can see from the output of this query that the default trace is indeed running and the necessary trace files will be available for us to access and investigate.</p>
<p><strong>Uh, Oh! The Default Trace is Disabled!</strong></p>
<p>If the Default Trace has been turned off by a wary Database Administrator, you can turn it back on using the following command. You must have enabled the “show advanced options.”</p>
<p><span style="color: #008000;">&#8211; Turn on advanced options</span><br />
<span style="color: #800000;"> sp_configure</span><span style="color: #ff0000;"> &#8216;show advanced options&#8217;</span><span style="color: #808080;">,</span> 1 <span style="color: #808080;">;</span><br />
<span style="color: #0000ff;"> GO</span><br />
<span style="color: #0000ff;"> RECONFIGURE</span> <span style="color: #808080;">;</span><br />
<span style="color: #0000ff;"> GO</span><br />
<span style="color: #008000;"> &#8212; Turn on the default trace</span><br />
<span style="color: #800000;"> sp_configure</span> <span style="color: #ff0000;">&#8216;default trace enabled&#8217;</span><span style="color: #808080;">, </span>1 <span style="color: #808080;">;</span><br />
<span style="color: #0000ff;"> GO</span><br />
<span style="color: #0000ff;"> RECONFIGURE</span> <span style="color: #808080;">;</span><br />
<span style="color: #0000ff;"> GO</span></p>
<p><strong>Where are the Trace Files Located?</strong></p>
<p>Now we know the default trace is running, we need to determine where the trace files are being stored on the system. The query listed below will return this information.</p>
<p><span style="color: #008000;">&#8211; Get the path to the current trace rollover file</span><br />
<span style="color: #0000ff;"> SELECT</span> <span style="color: #808080;">*</span><br />
<span style="color: #0000ff;"> FROM</span> <span style="color: #808080;">::</span><span style="color: #008000;">FN_TRACE_GETINFO</span><span style="color: #808080;">(</span>0<span style="color: #808080;">)</span></p>
<p><a href="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2010/09/SQL-Traces-Picture-2.png"><img class="aligncenter size-full wp-image-1461" title="SQL Traces - Picture 2" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2010/09/SQL-Traces-Picture-2.png" alt="" width="620" height="118" /></a></p>
<p>The results of this query have provided the path to the current rollover trace file. We can see that the file is located inside the “Log” directory in the SQL Server installation path.</p>
<p><strong>How Can I View the Trace File Information?</strong></p>
<p>Now that we know where the rollover trace files are located, we can begin to investigate the information they contain. We could just double-click on the file listed above and open it in SQL Server Profiler. This would load the trace and show us its contents. I’d like to show you a more robust method of viewing this information.</p>
<p>Use the file path from above in the query that follows to inspect the contents of the trace as if it were a table in SQL Server.</p>
<p><span style="color: #0000ff;">SELECT </span> loginname<span style="color: #808080;">,</span><br />
spid<span style="color: #808080;">,</span><br />
applicationname<span style="color: #808080;">,</span><br />
DatabaseId<span style="color: #808080;">,</span><br />
cat.name <span style="color: #0000ff;">AS</span> [CategoryName]<span style="color: #808080;">,</span><br />
starttime<span style="color: #808080;">,</span><br />
e.name <span style="color: #0000ff;">AS</span> EventName<br />
<span style="color: #0000ff;"> FROM</span> <span style="color: #808080;">::</span><span style="color: #008000;">FN_TRACE_GETTABLE</span><span style="color: #808080;">(</span><span style="color: #ff0000;"><span style="color: #808080;">&#8216;</span>C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log\log_12.trc&#8217;</span><span style="color: #808080;">,</span><br />
0<span style="color: #808080;">)</span><br />
<span style="color: #808080;"> INNER JOIN</span> <span style="color: #008000;">sys.trace_events</span> e <span style="color: #0000ff;">ON</span> eventclass <span style="color: #808080;">= </span>trace_event_id<br />
<span style="color: #808080;"> INNER JOIN</span> <span style="color: #008000;">sys.trace_categories</span> cat <span style="color: #0000ff;">ON</span> e.category_id <span style="color: #808080;">=</span> cat.category_id<br />
<span style="color: #0000ff;"> WHERE</span> cat.category_id <span style="color: #808080;">=</span> 2</p>
<p><a href="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2010/09/SQL-Traces-Picture-3.png"><img class="aligncenter size-full wp-image-1462" title="SQL Traces - Picture 3" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2010/09/SQL-Traces-Picture-3.png" alt="" width="620" height="194" /></a></p>
<p>In this query I’m only returning events that occurred in the “Database” category. The “Database” category includes the events “Data File Auto Grow”, “Data File Auto Shrink“, “Log File Auto Grow”, “Log File Auto Shrink” and “Database Mirroring Status Change.”</p>
<p>You’ll see from the results above that there is a SQL Agent Job that causes a “Data File Auto Grow” every time it executes. This is probably something that warrants additional investigation.</p>
<p>In this case, I discovered a SQL Server database that was using a data file “Autogrowth” increment of 1 MB. This database was also receiving a substantial data load via a SQL Agent job every 1 second.</p>
<p><strong>Conclusion</strong></p>
<p>The SQL Server default trace captures 32 unique events across 6 categories. The example illustrated above is just a small sampling of the information that is available. I recommend you take some time to experiment with the other events and categories the next time you’re checking the health of your SQL Server environment. You never know what you might discover.</p>
<p><strong>Scott Caldwell, SQL Server DBA</strong></p>
<p><strong><span style="font-weight: normal;"><img style="border: 0px initial initial;" title="RDBAELOGO" src="http://www.remotedbaexperts.com/Blog/wp-content/uploads/2009/07/RDBAELOGO.gif" alt="RDBAELOGO" width="205" height="44" /></span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.remotedbaexperts.com/Blog/2010/09/an-introduction-to-the-sql-server-default-trace/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

