<?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>ASP.NET MSSQL Webhosting Blog &#187; MSSQL Server</title>
	<atom:link href="http://www.mywebhostingblog.net/tag/mssql-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mywebhostingblog.net</link>
	<description>ASP.NET, MSSQL and Windows dedicated server articles</description>
	<lastBuildDate>Tue, 10 Nov 2009 19:53:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Error 916 Connecting SQL 2005 DB with MSSMS (Express) 2008</title>
		<link>http://www.mywebhostingblog.net/aspnet-web-hosting/error-916-connecting-ms-sql-2005-db-with-mssms-express-2008/</link>
		<comments>http://www.mywebhostingblog.net/aspnet-web-hosting/error-916-connecting-ms-sql-2005-db-with-mssms-express-2008/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 03:21:36 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[ASP.NET Web Hosting]]></category>
		<category><![CDATA[MSSMS]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[MSSQL Server]]></category>
		<category><![CDATA[remote connection]]></category>
		<category><![CDATA[SQL 2005]]></category>
		<category><![CDATA[SQL 2008]]></category>

		<guid isPermaLink="false">http://www.mywebhostingblog.net/?p=558</guid>
		<description><![CDATA[Since eUKhost has started providing Windows 2008 Server with Shared hosting as well as with Windows dedicated Server hosting there has been allot of new errors coming across. Also ASP .NET with Visual Studio 2008 and MS SQL 2008 has been widely used after the final release of Windows 2008 Server along with MS SQL [...]]]></description>
			<content:encoded><![CDATA[<p>Since eUKhost has started providing <strong>Windows 2008 Server</strong> with <strong>Shared hosting</strong> as well as with <strong>Windows dedicated Server host</strong>ing there has been allot of new errors coming across. Also<strong> ASP .NET</strong> with Visual Studio 2008 and MS SQL 2008 has been widely used after the final release of <strong>Windows 2008 Server</strong> along with<strong> MS SQL 2008</strong>. The most command error that we have seen in combination of<strong> MS SQL 2005</strong> and <strong>SQL 2008</strong> is:</p>
<p><code>TITLE: Microsoft SQL Server Management Studio<br />
------------------------------</code></p>
<p><code>Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)<br />
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&amp;LinkId=20476</code></p>
<p><code>------------------------------<br />
ADDITIONAL INFORMATION:<br />
</code><br />
<code>An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)<br />
------------------------------</code></p>
<p><span id="more-558"></span><br />
<code>The server principal "my_db_user" is not able to access the database "any_other_db_on_the_server" under the current security context. (Microsoft SQL Server, Error: 916)<br />
</code><br />
<code>For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&amp;ProdVer=09.00.1399&amp;EvtSrc=MSSQLServer&amp;EvtID=916&amp;LinkId=20476</code></p>
<p>This is something similar to the image below:</p>
<div id="attachment_567" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-567" title="microsoft-sql-server-management-studio-error-9162" src="http://www.mywebhostingblog.net/wp-content/uploads/2009/07/microsoft-sql-server-management-studio-error-9162-300x96.jpg" alt="Error Connecting to MS SQL 2005 DB Remotely Management Studio 2008" width="300" height="96" /><p class="wp-caption-text">Error Connecting to MS SQL 2005 DB Remotely Management Studio 2008</p></div>
<p>This error happen to appear while remotely connecting a database on <strong>Microsoft SQL server 2005</strong> with any version of <strong>Microsoft SQL Server Management Studio 2008</strong>, It will not appear if you connect the <strong>SQL server 2005</strong> with <strong>Microsoft SQL Server Management Studio Express 2005</strong>. And the link that has been specified in the error above is of any no use, also the error started to be reported more for a <strong>Windows Shared hosting</strong> clients rather than the one with <strong>Windows dedicated server</strong>. Because the problem only appears to happen if you connect with a user that has access to a particular database and not with the user that has administrator access over the <strong>Microsoft SQL server</strong>. I had to scratch my head for the solution as it seems to be related more to the permissions on the database user. Now the interesting thing here is that the <strong>SQL database</strong> that in the error is different than the <strong>MSSQL database</strong> on which the user has its access on.</p>
<p>After allot of searching on the web I found that this is a bug on all versions of Microsoft SQL Server Management Studio (Express) 2008 and there is a simple work around to access your database remotely with no errors at all. Here is what that is required:</p>
<p>1) Connect to the <strong>MS SQL</strong> server with the user credentials in <strong>MSSMS (Express) 2008</strong>.<br />
2) Bring Object Explorer Details window by selecting View &#8211;&gt; Object Explorer Details in menu (or just by hitting F7)<br />
3) In Object Explorer window click at Databases folder<br />
4) In Object Explorer Details Window right-click at the column header and deselect Collation<br />
5) Refresh Databases folder.</p>
<p>Refer to the image below for better understanding:</p>
<div id="attachment_568" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-568" title="microsoft-sql-server-management-studio-remove-collation2" src="http://www.mywebhostingblog.net/wp-content/uploads/2009/07/microsoft-sql-server-management-studio-remove-collation2-300x238.jpg" alt="Fix Failed to retrieve data for this request Error: 916 Management studio" width="300" height="238" /><p class="wp-caption-text">Fix Failed to retrieve data for this request Error: 916 Management studio</p></div>
<p>That is it. This will give you the desired access over your database and you will be happily make changes as per your need.<br />
This is just another complicated error by Microsoft which has a very simple fix.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywebhostingblog.net/aspnet-web-hosting/error-916-connecting-ms-sql-2005-db-with-mssms-express-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>About MSSQL Server</title>
		<link>http://www.mywebhostingblog.net/mssql-server-hosting/about-mssql-server/</link>
		<comments>http://www.mywebhostingblog.net/mssql-server-hosting/about-mssql-server/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 06:36:32 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[MSSQL Server]]></category>
		<category><![CDATA[Microsoft SQL]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.mywebhostingblog.net/?p=29</guid>
		<description><![CDATA[The architecture of Microsoft MSSQL Server is mainly divided into three components: 1. SQLOS: which implements the basic services required by MS SQL Server, including thread scheduling, I/O stat management and memory management. 2. Relational Engine: which implements the relational database components including support for databases, tables, queries and stored procedures as well as implementing [...]]]></description>
			<content:encoded><![CDATA[<p>The architecture of <strong>Microsoft MSSQL Server</strong> is mainly divided into three components:</p>
<p>1. <strong>SQLOS</strong>: which implements the basic services required by <strong>MS SQL Server</strong>, including thread scheduling, I/O stat management and memory management.</p>
<p>2. <strong>Relational Engine:</strong> which implements the relational database components including support for databases, tables, queries and stored procedures as well as implementing the type system.</p>
<p>3. <strong>Protocol Layer:</strong> which exposes the <strong>MS SQL Server </strong>functionality.</p>
<p><strong>SQLOS</strong></p>
<p><span id="more-29"></span></p>
<p>SQLOS is the base component in the <strong>Windows</strong> <strong>SQL Server</strong> architecture. It implements functions normally associated with the <strong>Operating System</strong>, thread scheduling, memory management, I/O management, buffer pool management, resource management, synchronization primitives and locking, and deadlock detection. Because the requirements of <strong>Windows SQL Server</strong> are highly specialized, it implements its own memory and thread management system, rather than using the generic one implemented in the OS. <strong>SQLOS</strong> also includes synchronization primitives for locking as well as monitoring for the worker threads to detect and recover from deadlocks.</p>
<p><strong>SQLOS</strong> handles the memory requirements of <strong>MS SQL Server</strong> as well. Reducing disc I/O is one of the primary goals of specialized memory management in SQL Server. It maintains a buffer pool, which is used to cache data pages from the disc, and to satisfy the memory requirements for the query processor, and for other internal data structures. <strong>SQLOS</strong> monitors all the memory allocated from the buffer pool, ensuring that the components return unused memory to the pool, and shuffles data out of the cache to make room for newer data. For changes that are made to the data in buffer, <strong>SQLOS</strong> writes the data back to the disc lazily, that is when the disc subsystem is either free, or there have been significant numbers of changes made to the cache, while still serving requests from the cache. For this, it implements a Lazy Writer, which handles the task of writing the data back to persistent storage.</p>
<p><strong>WIndows SQL Server</strong> normally supports up to 2 GB memory on x86 hardware, though it can be configured to use up to 64 GB if the Address Windowing Extension is used in the supporting operating system. For x64 hardware, it supports 8 TB of memory, and 7 TB for IA-64 systems (currently it is limited by Windows Server 2003 SP1 to 1TB). However, when running x86 versions of SQL Server on x64 hardware, it can access 4 GB of memory without any special configuration.</p>
<p><strong>Relational Engine:</strong></p>
<p>The Relational engine implements the relational data store using the capabilities provided by<strong> SQLOS</strong>, which is exposed to this layer via the private <strong>SQLOS</strong> API. It implements the type system, to define the types of the data that can be stored in the tables, as well as the different types of data items (such as tables, indexes, logs etc) that can be stored. It includes the Storage Engine, which handles the way data is stored on persistent storage devices and provides methods for fast access to the data. The storage engine implements log-based transaction to ensure that any changes to the data are ACID compliant. It also includes the query processor, which is the component that retrieves data. <strong>MSSQL</strong> queries specify what data to retrieve, and the query processor optimizes and translates the query into the sequence of operations needed to retrieve the data. The operations are then performed by worker threads, which are scheduled for execution by <strong>SQLOS</strong>.</p>
<p><strong>Protocol Layer:</strong></p>
<p>Protocol layer implements the external interface to <strong>MS SQL Server.</strong> All operations that can be invoked on <strong>MSSQL Server</strong> are communicated to it via a <strong>Microsoft</strong>-defined format, called Tabular Data Stream (TDS). TDS is an application layer protocol, used to transfer data between a database server and a client. Initially designed and developed by Sybase Inc. for their Sybase <strong>MS SQL Server</strong> relational database engine in 1984, and later by Microsoft in <strong>Microsoft MS SQL Server</strong>, TDS packets can be encased in other physical transport dependent protocols, including TCP/IP, Named pipes, and Shared memory. Consequently, access to <strong>MSSQL Server</strong> is available over these protocols. In addition, the <strong>MSSQL Server</strong> API is also exposed over web services.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywebhostingblog.net/mssql-server-hosting/about-mssql-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Secure MS SQL &#8211; BEST PRACTICES</title>
		<link>http://www.mywebhostingblog.net/aspnet-web-hosting/secure-ms-sql-best-practices/</link>
		<comments>http://www.mywebhostingblog.net/aspnet-web-hosting/secure-ms-sql-best-practices/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 07:16:50 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[ASP.NET Web Hosting]]></category>
		<category><![CDATA[MSSQL Server]]></category>
		<category><![CDATA[Window Hosting]]></category>
		<category><![CDATA[SQL Engine]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.mywebhostingblog.net/?p=280</guid>
		<description><![CDATA[There are several points that Microsoft suggests before configuring your MS SQL Server. BEST PRACTICES ACCORDING TO MICROSOFT Install only those components that you will use immediately. Microsoft recommends that you create a list of components that you will be using, and only enable those. If the need arises, you can install the additional components [...]]]></description>
			<content:encoded><![CDATA[<p>There are several points that Microsoft suggests before configuring your MS SQL Server.</p>
<p><strong>BEST PRACTICES ACCORDING TO MICROSOFT</strong></p>
<ul>
<li> Install only those components that you will use immediately.<strong> Microsoft recommends</strong> that you create a list of components that you will be using, and only enable those. If the need arises, you can install the additional components at that time. The components in a<strong> SQL Server</strong> installation are the <strong>Database</strong> <strong>Engine</strong>, Analysis Services Engine, <strong>Reporting Services</strong>, Integration Services, Notification Services, and Documents and Samples.<span id="more-280"></span></li>
</ul>
<ul>
<li> Enable only the optional features you will use, and review optional feature usage before doing an in-place upgrade and disable unneeded features. Microsoft recommends that you create a list of the optional features that you will use, and only turn those on. If this is an existing SQL Server that is being upgraded, they recommend creating the same list, and disabling any optional features not on the list. These optional features are CLR Integration, OLE Automation, remote use of a dedicated administrator connection, Database Mail and<strong> SQL Mail,</strong> <strong>OpenRowset </strong>and <strong>OpenDataSource </strong>functions, <strong>SQL Server </strong>Web Assistant, and xp_cmdshell availability.</li>
</ul>
<ul>
<li> Develop a policy with respect to permitted network connectivity choices and for the usage of optional features. <strong>Microsoft </strong>recommends defining policies that would be company wide on Connectivity Choices and the use of optional features. They also recommend using <strong>SQL Server Surface Area Configuration</strong> to standardize this policy and documenting exceptions to the policy on a perinstance basis.</li>
</ul>
<ul>
<li> Turn off unneeded services by setting the service to either Manual startup or Disabled. <strong>Microsoft</strong> recommends going into the service management area and setting all services that you will not be using.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mywebhostingblog.net/aspnet-web-hosting/secure-ms-sql-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable SQL 2005 Remote Connections</title>
		<link>http://www.mywebhostingblog.net/aspnet-web-hosting/enable-sql-2005-remote-connections/</link>
		<comments>http://www.mywebhostingblog.net/aspnet-web-hosting/enable-sql-2005-remote-connections/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 19:53:44 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[ASP.NET Web Hosting]]></category>
		<category><![CDATA[MSSQL Server]]></category>
		<category><![CDATA[Browser service]]></category>
		<category><![CDATA[remote connection]]></category>
		<category><![CDATA[Windows firewall]]></category>

		<guid isPermaLink="false">http://www.mywebhostingblog.net/?p=33</guid>
		<description><![CDATA[Enable remote connections for SQL Server 2005 Express or SQL Server 2005 Developer Edition You must enable remote connections for each instance of SQL Server 2005 that you want to connect to from a remote computer. To do this, follow these steps: 1.    Click Start, point to Programs, point to Microsoft SQL Server 2005, point [...]]]></description>
			<content:encoded><![CDATA[<h3 id="tocHeadRef">Enable remote connections for SQL Server 2005 Express or SQL Server 2005 Developer Edition</h3>
<p><script type="text/javascript"><!--
loadTOCNode(2, 'moreinformation');
// --></script>You must enable <strong>remote connections</strong> for each instance of <strong>SQL Server 2005</strong> that you want to connect to from a<strong> remote computer</strong>. To do this, follow these steps:</p>
<p>1.    Click Start, point to Programs, point to<strong> Microsoft SQL Server 2005</strong>, point to Configuration Tools, and then click <strong>MS SQL Server</strong> Surface Area Configuration.<br />
2.    On the <strong>MS SQL Server 2005</strong> Surface Area Configuration page, click Surface Area Configuration for Services and Connections.<br />
3.    On the <strong>Surface Area Configuration</strong> for Services and Connections page, expand <strong>Database </strong>Engine, click <strong>Remote Connections</strong>, click Local and remote connections, click the appropriate protocol to enable for your environment, and then click Apply.</p>
<p>Note Click OK when you receive the following message:<br />
Changes to Connection Settings will not take effect until you restart the <strong>Database </strong>Engine service.<br />
4.    On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Service, click Stop, wait until the <strong>MSSQLSERVER </strong>service stops, and then click Start to restart the <strong>MSSQLSERVER </strong>service.</p>
<h3 id="tocHeadRef">Enable the SQL Server Browser service</h3>
<p><script type="text/javascript"><!--
loadTOCNode(2, 'moreinformation');
// --></script>If you are running <strong>MS SQL Server 2005</strong> by using an <strong>instance name</strong> and you are not using a specific <strong>TCP/IP</strong> port number in your connection string, you must enable the <strong>SQL Server Browser </strong>service to allow for <strong>remote connections</strong>. For example,<strong> MS SQL Server 2005 Express</strong> is installed with a default instance name of <var>Computer Name</var>\SQLEXPRESS. You are only required to enable the SQL Server Browser service one time, regardless of how many instances of <strong>SQL Server 2005</strong> you are running. To enable the <strong>MS SQL Server </strong>Browser service, follow these steps.</p>
<p><span id="more-33"></span></p>
<p><strong>Important</strong> These steps may increase your security risk. These steps may also make your computer or your network more vulnerable to attack by malicious users or by malicious software such as viruses. We recommend the process that this article describes to enable programs to operate as they are designed to, or to implement specific program capabilities. Before you make these changes, we recommend that you evaluate the risks that are associated with implementing this process in your particular environment. If you choose to implement this process, take any appropriate additional steps to help protect your system. We recommend that you use this process only if you really require this process.</p>
<p>1.    Click Start, point to Programs, point to <strong>Microsoft SQL Server 2005</strong>, point to Configuration Tools, and then click <strong>SQL Server Surface Ar</strong>ea Configuration.<br />
2.    On the <strong>MS SQL Server 2005</strong> Surface Area Configuration page, click Surface Area Configuration for Services and Connections.<br />
3.    On the Surface Area Configuration for Services and Connections page, click <strong>SQL Server Browser</strong>, click Automatic for Startup type, and then click Apply.</p>
<p>Note When you click the Automatic option, the <strong>SQL Server Browser service</strong> starts automatically every time that you start <strong>Microsoft Windows</strong>.<br />
4.    Click Start, and then click OK.</p>
<p><strong>Note</strong> When you run the <strong>MS SQL Server</strong> Browser service on a computer, the computer displays the instance names and the connection information for each instance of SQL Server that is running on the computer. This risk can be reduced by not enabling the SQL Server Browser service and by connecting to the instance of SQL Server directly through an assigned TCP port. Connecting directly to an instance of <strong>SQL Server </strong>through a TCP port is beyond the scope of this article. For more information about the SQL Server Browser server and connecting to an instance of SQL Server, see the following topics in SQL Server Books Online:</p>
<p><strong>•    SQL Server Browser Service<br />
•    Connecting to the SQL Server Database Engine<br />
•    Client Network Configuration</strong></p>
<h3 id="tocHeadRef">Create exceptions in Windows Firewall</h3>
<p><script type="text/javascript"><!--
loadTOCNode(2, 'moreinformation');
// --></script>These steps apply to the version of <strong>Windows Firewall</strong> that is included in <strong>Windows XP</strong> <strong>Service Pack 2 (SP2) </strong>and in <strong>Windows Server 2003</strong>. If you are using a different firewall system, see your <strong>firewall</strong> documentation for more information.</p>
<p>If you are running a firewall on the computer that is running <strong>SQL Server 2005</strong>, external connections to <strong>SQL Server 2005 </strong>will be blocked unless <strong>SQL Server 2005</strong> and the<strong> SQL Server Browser service</strong> can communicate through the <strong>firewall</strong>. You must create an exception for each instance of <strong>SQL Server 2005</strong> that you want to accept remote connections and an exception for the <strong>SQL Server Browser service</strong>.</p>
<p><strong>MS SQL Server 2005</strong> uses an <strong>instance </strong>ID as part of the path when you install its program files. To create an exception for each instance of <strong>MS SQL Server</strong>, you must identify the correct instance ID. To obtain an instance ID, follow these steps:</p>
<p>1.    Click Start, point to Programs, point to <strong>Microsoft SQL Server 2005</strong>, point to Configuration <strong>Tools</strong>, and then click <strong>SQL Server</strong> Configuration Manager.<br />
2.    In <strong>SQL Serve</strong>r Configuration Manager, click the SQL Server Browser service in the right pane, right-click the instance name in the main window, and then click Properties.<br />
3.    On the <strong>SQL Server </strong>Browser Properties page, click the Advanced tab, locate the instance ID in the property list, and then click OK.</p>
<p>To open Windows Firewall, click <strong class="uiterm">Start</strong>, click <strong class="uiterm">Run</strong>, type <span class="userInput">firewall.cpl</span>, and then click <strong class="uiterm">OK</strong>.</p>
<h4 id="tocHeadRef">Create an exception for MS SQL Server 2005 in Windows Firewall</h4>
<p><script type="text/javascript"><!--
loadTOCNode(3, 'moreinformation');
// --></script>To create an exception for <strong>MS SQL Server 2005</strong> in <strong>Windows Firewall</strong>, follow these steps:</p>
<p>1.    In <strong>Windows Firewall</strong>, click the Exceptions tab, and then click Add Program.<br />
2.    In the Add a Program window, click Browse.<br />
3.    Click the <strong>C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe</strong> executable program, click Open, and then click OK.</p>
<p>Note The path may be different depending on where <strong>SQL Server 2005</strong> is installed. <strong>MSSQL.1</strong> is a placeholder for the instance ID that you obtained in step 3 of the previous procedure.<br />
4.    Repeat steps 1 through 3 for each instance of SQL Server 2005 that needs an exception.</p>
<h4 id="tocHeadRef">Create an exception for the MS SQL Server Browser service in Windows Firewall</h4>
<p><script type="text/javascript"><!--
loadTOCNode(3, 'moreinformation');
// --></script>To create an exception for the SQL Server Browser service in Windows Firewall, follow these steps:</p>
<p>1.    In Windows <strong>Firewall</strong>, click the Exceptions tab, and then click Add Program.<br />
2.    In the Add a Program <strong>window</strong>, click Browse.<br />
3.    Click the <strong>C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe</strong> executable program, click Open, and then click OK.</p>
<p>Note The path may be different depending on where <strong>MS SQL Server 2005</strong> is installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywebhostingblog.net/aspnet-web-hosting/enable-sql-2005-remote-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server has encountered 1 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file.</title>
		<link>http://www.mywebhostingblog.net/mssql-server-hosting/sql-server-has-encountered-1-occurrences-of-io-requests-taking-longer-than-15-seconds-to-complete-on-file/</link>
		<comments>http://www.mywebhostingblog.net/mssql-server-hosting/sql-server-has-encountered-1-occurrences-of-io-requests-taking-longer-than-15-seconds-to-complete-on-file/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 19:24:06 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[MSSQL Server]]></category>
		<category><![CDATA[Window Hosting]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[stalled IO]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.mywebhostingblog.net/?p=57</guid>
		<description><![CDATA[Some times we see the error below in the event logs: &#8220;SQL Server has encountered 1 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [T:\MSSQL\DATA\%file_name%] in database [%DB_name%] (2).  The OS file handle is 0&#215;00000838.  The offset of the latest long I/O is: 0x000000ebdc0000&#8220; Do you refer it to as [...]]]></description>
			<content:encoded><![CDATA[<p>Some times we see the error below in the event logs:</p>
<p><em>&#8220;<strong>SQL Server has encountered 1 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [T:\MSSQL\DATA\%file_name%] in database [%DB_name%] (2).  The OS file handle is 0&#215;00000838.  The offset of the latest long I/O is: 0x000000ebdc0000</strong>&#8220;</em></p>
<p>Do you refer it to as a <strong>stalled IO</strong>? We always hear a questions such as, what’s wrong with SQL Server..? Why is SQL taking so long to read or write to the disk..? Let us discuss why it is not a MS SQL Server problem:</p>
<p><strong>MS SQL Server</strong> does data file reads and writes almost exclusively as asynchronous IO, using the <strong>win32 </strong>APIs ReadFile, WriteFile, ReadFileScatter and WriteFileGather. Each of these APIs behave in a fairly similar steps, the caller sends in a handle to the file, some memory location to read or write, the size of the block and a structure that tells the kernel how to handle the IO. In <strong>MS SQL Server’s </strong>case, how to handle the IO is Asynchronously, please.  The call returns immediately so that the thread issuing so that the IO can get out of the way and make life happy for other users who are also waiting got their query to return.</p>
<p>The catch here is that, ordinarily the time between the Asynchronous call to read or write and the completion of the read or write should be on the order of 10ms. The longer it takes for an IO to return the more noticeable a performance impact there is to end users.</p>
<p><span id="more-57"></span></p>
<p>Prior to <strong>MS SQL Server 2000 SP4</strong> the only way you would be able to tell if your<strong> IO</strong>s were taking longer than expected would be to use<strong> System Monitor</strong> and watch the <strong>PhysicalDisk</strong>\Avg Disk sec./read, write and transfer counter.  This is a relatively acceptable method when the cause of your IO bottleneck is the latency of the physical disk, you might be surprised to find out that’s not the only thing that might slow down an IO!</p>
<p>Once a user mode application issues an IO request it’s the equivalent of putting a package in the mail, there’s nothing to do but wait.  While you may not have anything to do once you’ve dropped the package the parcel carriers job has just begun, what with all the processing and labeling and transit – you get the idea.  Likewise for the <strong>kernel</strong>.  Once an IO transitions over to kernel mode it’s transformed into something called and <strong>IRP </strong>(interrupt request packet) and begins a trek down levels of filter drivers, virus scanners  and device drivers before it finally makes its way home to a physical device.</p>
<p>Windows exposes methods for device and software manufactures to be notified of, and participate in, IOs.  Filter drivers are one method of doing this, and it allows for great functionality of verifying you aren’t writing a file with a virus pattern, or backing up a file as it’s being written.  The problem here is that the filter driver can hold up an IO for an extended period of time, and this time isn’t reflected in the Sysmon counter.</p>
<p>So what are you to do? You’ve put your specially crafted package in the mail, but the intended recipient still hasn’t got it.</p>
<p>The approach taken in <strong>MS SQL Server</strong> is to make note of the time the <strong>IO </strong>started, the offset of the IO within the file then check back a short time later to make sure all IOs have completed.  If an IO is still outstanding and 15 seconds have elapsed then the warning is printed to the <strong>errorlog </strong>to alert the system administrator that something’s amiss.</p>
<p>When you see this message the first thing you need to check is the <strong>physical disk</strong> counters in sysmon to ensure that the disks are servicing IOs in a reasonable period of time.  If those appear to fine then start looking at what filter drivers are installed on your system, are there any known issues with them, or just disable them if you don’t need them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywebhostingblog.net/mssql-server-hosting/sql-server-has-encountered-1-occurrences-of-io-requests-taking-longer-than-15-seconds-to-complete-on-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
