<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Santech Solutions</title>
	
	<link>http://www.santechsolutions.co.uk</link>
	<description>Microsoft SQL Server Specialists</description>
	<lastBuildDate>Wed, 10 Mar 2010 12:37:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SantechSolutions" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="santechsolutions" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>SQL Snippet: Who owns that SQL Server Job?</title>
		<link>http://www.santechsolutions.co.uk/sql-snippet-who-owns-that-sql-server-job/</link>
		<comments>http://www.santechsolutions.co.uk/sql-snippet-who-owns-that-sql-server-job/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 12:37:00 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[SQL Server Administration]]></category>
		<category><![CDATA[SQL Server Agent Jobs]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[SQL Server Administrations]]></category>
		<category><![CDATA[SQL Server Jobs]]></category>
		<category><![CDATA[T-SQL Tips]]></category>

		<guid isPermaLink="false">http://www.santechsolutions.co.uk/?p=187</guid>
		<description><![CDATA[Here is a handy T-SQL script that will list all SQL Server Agent Job owners by job.
From an administration perspective, this query can come in handy when you need to ensure/validate the job owners on your server. One common mistake that I have seen is that when a user creates a new SQL Server Agent [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Here is a handy T-SQL script that will list all SQL Server Agent Job owners by job.</p>
<p>From an administration perspective, this query can come in handy when you need to ensure/validate the job owners on your server. One common mistake that I have seen is that when a user creates a new SQL Server Agent Job via SQL Server Management Studio, by default their Login will be assigned as the owner of the job. This is often not a desirable choice of owner and so it&#8217;s good idea to do a little house keeping every once in a while and check who the current Job Owners are for your environment.</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> <br />
&nbsp; &nbsp; A<span style="color: #66cc66;">.</span>Name <span style="color: #993333; font-weight: bold;">AS</span> JobName<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; B<span style="color: #66cc66;">.</span>name <span style="color: #993333; font-weight: bold;">AS</span> JobOwner<br />
<span style="color: #993333; font-weight: bold;">FROM</span> dbo<span style="color: #66cc66;">.</span>sysjobs A<br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> master<span style="color: #66cc66;">.</span>sys<span style="color: #66cc66;">.</span>syslogins B <span style="color: #993333; font-weight: bold;">ON</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; A<span style="color: #66cc66;">.</span>owner_sid <span style="color: #66cc66;">=</span> B<span style="color: #66cc66;">.</span>sid</div></div>
<h3>More Handy SQL Snippets</h3>
<ul>
<li><a title="What SQL Server Agent Jobs were running at that time?" href="http://www.johnsansom.com/index.php/2009/12/sql-agent-jobs-time-query/">What SQL Server Agent Jobs were running at &#8220;that&#8221; time?</a></li>
<li><a title="Most Costly SQL Server Queries" href="http://www.johnsansom.com/index.php/2009/05/how-to-identify-the-most-costly-sql-server-queries-using-dmvs/?preview=true&amp;preview_id=499&amp;preview_nonce=25ddb9893e">How to identify the most costly SQL Server queries using DMV’s</a></li>
<li><a title="Highest SQL Server Waits by Percentage" href="http://www.johnsansom.com/index.php/2009/12/sql-snippet-wait-types/">Highest SQL Server Waits by Percentage</a></li>
<li><a title="Identify All Active SQL Server Sessions" href="http://www.johnsansom.com/index.php/2009/06/dmv-query-to-identify-all-active-sql-server-sessions/">Identify All Active SQL Server Sessions</a></li>
</ul>
<p>I hope you find this SQL Snippet useful in your administration of SQL Server. If you have any questions regarding this snippet, SQL Server Agent Jobs or anything to do with SQL Server then let me know!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=0cypzgBr1hk:vYCBLfUsMho:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=0cypzgBr1hk:vYCBLfUsMho:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?i=0cypzgBr1hk:vYCBLfUsMho:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=0cypzgBr1hk:vYCBLfUsMho:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=0cypzgBr1hk:vYCBLfUsMho:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=0cypzgBr1hk:vYCBLfUsMho:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?i=0cypzgBr1hk:vYCBLfUsMho:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.santechsolutions.co.uk/sql-snippet-who-owns-that-sql-server-job/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Snippet: SQL Server Wait Types</title>
		<link>http://www.santechsolutions.co.uk/sql-server-wait-types/</link>
		<comments>http://www.santechsolutions.co.uk/sql-server-wait-types/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 16:44:30 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[Dynamic Management Views (DMV)]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[DMV]]></category>
		<category><![CDATA[SQL Server Wait Types]]></category>

		<guid isPermaLink="false">http://www.santechsolutions.co.uk/?p=181</guid>
		<description><![CDATA[Here is a handy little SQL Snippet that will return information about those all important SQL Server Wait Types for your server. It uses the SQL Server Dynamic Management View (DMV) sys.dm_os_wait_stats in order to extrapolate the desired information. A column has also been added to provide details of the percentage of total wait time that [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a handy little SQL Snippet that will return information about those all important SQL Server Wait Types for your server. It uses the SQL Server Dynamic Management View (DMV) <a title="sys.dm_os_wait_stats" href="http://msdn.microsoft.com/en-us/library/ms179984%28SQL.90%29.aspx">sys.dm_os_wait_stats</a> in order to extrapolate the desired information. A column has also been added to provide details of the percentage of total wait time that a particular Wait Type is responsible for.</p>
<p>T-SQL Query to rank SQL Server Wait Types by highest percentage of total wait time</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span><br />
&nbsp; &nbsp; wait_type<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; waiting_tasks_count<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; max_wait_time_ms<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; resource_wait_time_ms <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span>wait_time_ms <span style="color: #66cc66;">-</span> signal_wait_time_ms<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; PercentOfAllResourceWaitTime <span style="color: #66cc66;">=</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span>cast<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>wait_time_ms <span style="color: #66cc66;">-</span> signal_wait_time_ms<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> decimal<span style="color: #66cc66;">&#40;</span>19<span style="color: #66cc66;">,</span>2<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> sum<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>wait_time_ms <span style="color: #66cc66;">-</span> signal_wait_time_ms<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> sys<span style="color: #66cc66;">.</span>dm_os_wait_stats<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">*</span> 100<br />
<span style="color: #993333; font-weight: bold;">FROM</span> sys<span style="color: #66cc66;">.</span>dm_os_wait_stats<br />
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <br />
&nbsp; &nbsp; PercentOfAllResourceWaitTime <span style="color: #993333; font-weight: bold;">DESC</span></div></div>
<p>I hope you find this SQL Snippet useful in your administration of SQL Server. If you have any queries regarding this snippet, SQL Server Wait Types or anything to do with SQL Server whatsoever then be sure to let me know!</p>
<h2>Further Reading</h2>
<ul>
<li>SQL Server Best Practice Article: <a title="SQL Server Best Practice Article: Performance Tuning Wait Queus" href="http://msdn.microsoft.com/en-us/library/cc966413.aspx">Performance Tuning Wait Queues</a></li>
<li>More DMV Queries: <a title="Identify All Active SQL Server Sessions" href="http://www.johnsansom.com/index.php/2009/06/dmv-query-to-identify-all-active-sql-server-sessions/">Identify All Active SQL Server Sessions</a></li>
<li>How to identify the most <a title="How to identify the most costly SQL Server queries using DMVs" href="http://www.johnsansom.com/index.php/2009/05/how-to-identify-the-most-costly-sql-server-queries-using-dmvs/?preview=true&amp;preview_id=499&amp;preview_nonce=25ddb9893e">costly SQL Server queries</a> using DMV’s</li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=0BFGD-WfdbM:URnOLjD4djM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=0BFGD-WfdbM:URnOLjD4djM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?i=0BFGD-WfdbM:URnOLjD4djM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=0BFGD-WfdbM:URnOLjD4djM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=0BFGD-WfdbM:URnOLjD4djM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=0BFGD-WfdbM:URnOLjD4djM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?i=0BFGD-WfdbM:URnOLjD4djM:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.santechsolutions.co.uk/sql-server-wait-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server Memory Configuration, Determining MemToLeave Settings</title>
		<link>http://www.santechsolutions.co.uk/sql-server-memory-configuration-determining-memtoleave-settings/</link>
		<comments>http://www.santechsolutions.co.uk/sql-server-memory-configuration-determining-memtoleave-settings/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 11:43:15 +0000</pubDate>
		<dc:creator>John Sansom</dc:creator>
				<category><![CDATA[Memory Management]]></category>
		<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[SQL Server Administration]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Memory Settings]]></category>
		<category><![CDATA[memToLeave]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://johnsansom.com/wordpress_santech/?p=152</guid>
		<description><![CDATA[


Determining the appropriate memory configuration for a SQL Server platform is a task that all database administrators are required to perform. It is essential to ensuring that an appropriate level of performance can be provided.


I am going to discuss some of the additional memory configuration tweaking that you may wish to undertake so that your [...]]]></description>
			<content:encoded><![CDATA[<div>
<dl id="attachment_1700">
<dt></dt>
<p>Determining the appropriate memory configuration for a SQL Server platform is a task that all database administrators are required to perform. It is essential to ensuring that an appropriate level of performance can be provided.</p>
</dl>
</div>
<p>I am going to discuss some of the additional memory configuration tweaking that you may wish to undertake so that your environment can provide adequate support for workloads involving managed code, .NET CLR, Linked Servers and extended stored procedures.</p>
<h3>Establishing a good foundation</h3>
<p>Before considering additional tweaking of your SQL Server platform, it is wise to have already established a good foundation and to have addressed the basics.</p>
<p>To begin with you will want to ensure that the correct settings for both the hardware and software (Windows operating system version and SQL Server Edition) for your particular environment have been applied. You will no doubt also wish to ensure that your choice of configuration makes the maximum possible use of the resource available to you.</p>
<p>If you want to ensure the best configuration for your SQL Server environment then <a title="Contact Santech Solutions about SQL Server" href="http://www.santechsolutions.co.uk/contact/">contact </a>us now.</p>
<h3>Additional considerations when configuring SQL server memory</h3>
<p>Having established a good foundation, in addition to this you may find that the specific requirements of your individual platform require you to carry out further tweaking.</p>
<p>For example, your environment may dictate that SQL Server share the available server memory with other applications, in which case you will need to consider the distribution of memory resource between these. The ideal configuration choice is that SQL Server runs on its own dedicated server however this may not always be practical.</p>
<p>Now suppose your environment uses a fair amount of managed code such as .NET CLR. These technologies naturally require memory just as SQL Server does however one critical point to note is that the memory for these resources is allocated from outside of the SQL Server Buffer, in a portion of memory known as MemToLeave.</p>
<h3>What is MemToLeave?</h3>
<p>MemToLeave is virtual address space (VAS) that&#8217;s left un-used when SQL Server starts so that external components called by SQL Server are saved some address space. So in order for these technologies, .NET CLR, Linked Servers and extended stored procedures, to operate efficiently you must ensure that they too have access to sufficient memory.</p>
<p>This is why it is often recommended that you explicitly set the maximum amount of memory that SQL Server uses, as opposed to allowing it to consume all that is available on your server.</p>
<h4>How do I determine my MemToLeave usage?</h4>
<p>To assist in assessing your current utilisation, the T-SQL script below can be used to identify the largest available block of virtual address space (MemToLeave) outside of the buffer pool and is sourced from Christian Bolton&#8217;s Blog Post &#8211; SQL Server memtoleave, VAS and 64-bit</p>
<p>The query utilises the Dynamic Management View (DMV) sys.dm_os_virtual_address_dump which returns information about pages in the virtual address space of the calling process.</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">WITH</span> VAS_Summary<br />
<span style="color: #993333; font-weight: bold;">AS</span> <br />
<span style="color: #66cc66;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">SELECT</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Size <span style="color: #66cc66;">=</span> VAS_Dump<span style="color: #66cc66;">.</span>Size<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Reserved <span style="color: #66cc66;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; SUM<span style="color: #66cc66;">&#40;</span>CASE<span style="color: #66cc66;">&#40;</span>CONVERT<span style="color: #66cc66;">&#40;</span>INT<span style="color: #66cc66;">,</span> VAS_Dump<span style="color: #66cc66;">.</span>Base<span style="color: #66cc66;">&#41;</span> ^ 0<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHEN 0 THEN 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ELSE 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; END<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Free <span style="color: #66cc66;">=</span> SUM<span style="color: #66cc66;">&#40;</span>CASE<span style="color: #66cc66;">&#40;</span>CONVERT<span style="color: #66cc66;">&#40;</span>INT<span style="color: #66cc66;">,</span> VAS_Dump<span style="color: #66cc66;">.</span>Base<span style="color: #66cc66;">&#41;</span> ^ 0<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHEN 0 THEN 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ELSE 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; END<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">FROM</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">SELECT</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; CONVERT<span style="color: #66cc66;">&#40;</span>VARBINARY<span style="color: #66cc66;">,</span> SUM<span style="color: #66cc66;">&#40;</span>region_size_in_bytes<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#91;</span>Size<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; region_allocation_base_address <span style="color: #66cc66;">&#91;</span>Base<span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">FROM</span> sys<span style="color: #66cc66;">.</span>dm_os_virtual_address_dump<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">WHERE</span> region_allocation_base_address &amp;lt;&amp;gt; 0x0<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> region_allocation_base_address<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">UNION</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">SELECT</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; CONVERT<span style="color: #66cc66;">&#40;</span>VARBINARY<span style="color: #66cc66;">,</span> region_size_in_bytes<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#91;</span>Size<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; region_allocation_base_address <span style="color: #66cc66;">&#91;</span>Base<span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">FROM</span> sys<span style="color: #66cc66;">.</span>dm_os_virtual_address_dump<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">WHERE</span> region_allocation_base_address <span style="color: #66cc66;">=</span> 0x0<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> VAS_Dump<br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> Size<br />
<span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span><br />
&nbsp; &nbsp; SUM<span style="color: #66cc66;">&#40;</span>CONVERT<span style="color: #66cc66;">&#40;</span>BIGINT<span style="color: #66cc66;">,</span> Size<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> Free<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> 1024 <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>Total avail mem<span style="color: #66cc66;">,</span> KB<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; CAST<span style="color: #66cc66;">&#40;</span>MAX<span style="color: #66cc66;">&#40;</span>Size<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> BIGINT<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> 1024 <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>Max free size<span style="color: #66cc66;">,</span> KB<span style="color: #66cc66;">&#93;</span><br />
<span style="color: #993333; font-weight: bold;">FROM</span> VAS_Summary</div></div>
<h4>How can I tell if I need to allocate more memory to MemToLeave?</h4>
<p>There are two key indicators that express a need to assign more memory to MemToLeave.</p>
<ol>
<li>If the above T-SQL script shows that the amount of available memory is small for the requirements of your platform. (For example, your application/development team may be able to advise on the expected memory requirements of the managed code components that have been developed).</li>
<li>A more pressing indicator takes the form of a variety of warning/error messages raised by either SQL Server or the specific managed code component.</li>
</ol>
<p>For example, if the MemToLeave region is too small for .NET managed code, a common indicator of this will be the appearance of frequent &#8220;Application Domain Unload&#8221; messages appearing in the SQL Server Error log. An example message is provided below:</p>
<p>AppDomain 8 (DatabaseName.dbo[runtime].7) is marked for unload due to common language runtime (CLR) or security data definition language (DDL) operations.</p>
<p>Another indicator is an error message that occurs when using Linked Server queries, that states:</p>
<p>&#8220;There is insufficient system memory to run this query.&#8221;</p>
<p>If you encounter any of these indicators then you almost certainly need to evaluate your SQL Server usage of VAS.</p>
<h3>How do I allocate more resources to MemToLeave?</h3>
<p>In the event that you determine that you require to increase the size of the MemToLeave area, this can be done by defining the -g startup option for the SQL Server Service.</p>
<p>The value that you assign to the parameter will determine the size of the MemToLeave area of memory.</p>
<p>If you are unsure of how much additional memory to allocate to MemToLeave, then it is best to increase the volume assigned in smaller increments for example 64MB (although dependent on your specific platform), until your original indicators are no longer being raised i.e. your application domain unload messages are no longer appearing.</p>
<p>Detailed instruction for using the -g startup option can be found in the books online article, <a title="Using The SQL Server Service Startup Options" href="Using the SQL Server Service Starup Options.">Using the SQL Server Service Startup Options</a>.</p>
<p>It is important to note that increasing the size of the MemToLeave area will reduce the amount of available memory to the SQL Server Buffer Pool. For this reason it is wise to iterate your tweaking of this parameter in small increments.</p>
<h3>Summary</h3>
<p>A SQL Server DBA is responsible for ensuring the performance of the platforms they administer.</p>
<p>After completing an initial SQL Server configuration you may need to tweak your memory configuration further in order support managed code. Where appropriate, this can be achieved by using the SQL Server -g startup parameter.</p>
<p>I hope you have enjoyed reading this article and that it proves fruitful in your administration of SQL Server. If you have any questions about MemToLeave or anything whatsoever about SQL Server then <a title="Contact Santech Solutions about SQL Server Consulting" href="http://www.santechsolutions.co.uk/contact/">contact </a>Santech now.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=EalV95s78ok:goq5l07GJD4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=EalV95s78ok:goq5l07GJD4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?i=EalV95s78ok:goq5l07GJD4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=EalV95s78ok:goq5l07GJD4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=EalV95s78ok:goq5l07GJD4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SantechSolutions?a=EalV95s78ok:goq5l07GJD4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SantechSolutions?i=EalV95s78ok:goq5l07GJD4:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.santechsolutions.co.uk/sql-server-memory-configuration-determining-memtoleave-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
