<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8312343003944292169</id><updated>2011-07-30T06:01:18.709-07:00</updated><category term='Setup'/><category term='SQL Server Best Practices'/><category term='Upgrade'/><category term='SQL Server Monitoring'/><category term='SQL Server Troubleshooting'/><category term='SQL Server'/><title type='text'>Shiloh-Yukon-Katmai Discussion</title><subtitle type='html'>This blog has been setup to provide tips for troubleshooting SQL Server performance and the steps to taken to prevent possible problem scenarios. All postings on this blog are provided "AS IS" with no warranties, and confers no rights.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>35</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-7435416588351419653</id><published>2009-02-01T01:54:00.001-08:00</published><updated>2009-02-01T01:54:59.150-08:00</updated><title type='text'>My New SQL Server Blog</title><content type='html'>&lt;p&gt;Please visit my new blog. I have migrated all my posts to Spaces on Live:&lt;/p&gt;&lt;p&gt;&lt;a href="http://troubleshootingsql.spaces.live.com/"&gt;http://troubleshootingsql.spaces.live.com/&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-7435416588351419653?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/7435416588351419653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=7435416588351419653' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/7435416588351419653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/7435416588351419653'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2009/02/my-new-sql-server-blog.html' title='My New SQL Server Blog'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-144873872341950409</id><published>2008-09-06T23:07:00.001-07:00</published><updated>2008-09-06T23:07:46.543-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Katmai</title><content type='html'>&lt;p&gt;Katmai - SQL Server 2008 has been launched. I was playing around with the new features in Katmai and some of them really struck me as ground breaking changes compared to earlier versions. My speciality being the Database Engine, I have not been able to do justice to my poking around for other components like the BI part of it. Though whatever I have managed to poke around, I found the following enhancements and new features to be very impactful in the near future:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Compression&lt;/strong&gt; - Database and Backup compression is now available in Katmai. This is a boon for DBAs who manage databases which are TBs in size. Now you have Row or Page level compression to choose from. Also, you have a SP which makes an estimate of how much benefit you will derive from enabling compression or will it benefit you at all. &lt;/p&gt;  &lt;p&gt;Backup Compression is also another major boon as storing backups of VLDBs can be quite a task which have strict SLA requirements.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;T-SQL Enhancements&lt;/strong&gt; - I quite liked this one. Now I can use programming level constructs while coding in T-SQL. Eg. declare @var varchar(50) = 'Declare and Initialize!'&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;New Table Hints and Query Hints&lt;/strong&gt; - A few other tools added to the repertoire of the DBA to make queries run faster in environments where the DBA has no control over the queries being sent to the the database engine via the application.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;XEvents&lt;/strong&gt; - This is an important new feature from a troubleshooting perspective. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Policy Based Management&lt;/strong&gt; - This is another of those administration joys that a DBA will derive when using this new feature. With a few clicks, the DBA can administer multiple database environments to conform organizational policies and also have checks in place to report non-compliance.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Server Audit Tracing&lt;/strong&gt; - This is a step towards helping in meeting Compliance standards like PCI etc. No longer will you need to run profiler traces which have a tendency to affect server performance if capturing a large number of events.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Resource Governor&lt;/strong&gt; - Another new feature which provides more granularity in deciding on resource bifurcation for different applications and deciding on application priorities. This virtually allows the DBAs to decided on what kind of queries should get how much resources on the server w.r.t. CPU, Memory etc. However, one should understand the full impact and ramifications of enabling such resource throttling on the server before implementing it. Such an implementation of RG at a production level requires thorough testing as you might end up throttling an operation which you didn't intend to.&lt;/p&gt;  &lt;p&gt;Read more about &amp;quot;&lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/default.aspx" target="_blank"&gt;SQL Server 2008&lt;/a&gt;&amp;quot; here.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-144873872341950409?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/144873872341950409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=144873872341950409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/144873872341950409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/144873872341950409'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/09/katmai.html' title='Katmai'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-3452746759887606026</id><published>2008-07-28T09:02:00.000-07:00</published><updated>2008-07-28T09:06:17.396-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How to connect to Embedded Edition from SSMS</title><content type='html'>From SQL Server Management Studio, you cannot connect to a SQL Server Embedded Edition instance by just providing the server name. You need to put the following in the server name input:&lt;br /&gt;&lt;a href="file:////pipe/MSSQL$MICROSOFT##SSEE\sql\query"&gt;\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The files for an embedded edition instance should be at:&lt;br /&gt;&lt;br /&gt;C:\WINDOWS\SYSMSI\SSEE\MSSQL.2005\MSSQL\&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-3452746759887606026?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/3452746759887606026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=3452746759887606026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/3452746759887606026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/3452746759887606026'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/07/how-to-connect-to-embedded-edition-from.html' title='How to connect to Embedded Edition from SSMS'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-1642416921419748475</id><published>2008-07-26T02:00:00.000-07:00</published><updated>2008-07-26T02:12:38.976-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Using WMI to manage SQL Server 2000 services</title><content type='html'>There are quite a few blog posts out there to manage SQL Server 2005 services using the :&lt;strong&gt;\\.\root\Microsoft\SqlServer\ComputerManagement&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;However, WMI Admin Provider is not pre-installed for SQL Server 2000. It needs to be installed separately using the WMI Admin Provider Setup available along with the SQL Server 2000 Setup CD under &lt;strong&gt;x86\other\wmi&lt;/strong&gt; folder.&lt;br /&gt;&lt;br /&gt;Sample script to change SQL Server 2005 service startup account and password using WMI:&lt;br /&gt;&lt;a href="http://blogs.msdn.com/mwories/archive/2006/11/03/wmi_5F00_change_5F00_password.aspx"&gt;http://blogs.msdn.com/mwories/archive/2006/11/03/wmi_5F00_change_5F00_password.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;MSDN Documentation on Win32_Service class&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa394418.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa394418.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Sample Script to change a SQL Server 2000 instance startup account using &lt;strong&gt;root\MicrosoftSQLServer&lt;/strong&gt; namespace:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;strComputer = "." &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Set objWMIService = GetObject("winmgmts:\\" &amp;amp; strComputer &amp;amp; "\root\MicrosoftSQLServer") &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;' Obtain an instance of the the class &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;' using a key property value.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Set objShare = objWMIService.Get("Win32_Service.Name='MSSQL$SQL2000'")&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;' Obtain an InParameters object specific&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;' to the method.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Set objInParam = objShare.Methods_("Change"). _    inParameters.SpawnInstance_()&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;' Add the input parameters.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;objInParam.Properties_.Item("StartName") =  "LocalSystem"&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;objInParam.Properties_.Item("StartPassword") =  ""&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;' Execute the method and obtain the return status.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;' The OutParameters object in objOutParams&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;' is created by the provider.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Set objOutParams = objWMIService.ExecMethod("Win32_Service.Name='MSSQL$SQL2000'", "Change", objInParam)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;' List OutParams&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Wscript.Echo "Out Parameters: "Wscript.echo "ReturnValue: " &amp;amp; objOutParams.ReturnValue&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-1642416921419748475?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/1642416921419748475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=1642416921419748475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/1642416921419748475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/1642416921419748475'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/07/using-wmi-to-manage-sql-server-2000.html' title='Using WMI to manage SQL Server 2000 services'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-7159894322849851794</id><published>2008-06-08T23:20:00.000-07:00</published><updated>2008-06-09T01:46:45.870-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>RDTSC</title><content type='html'>I have seen a few cases where administrators have been concerned with CPU Drift and think that the SQL Server &lt;strong&gt;ERRORLOG&lt;/strong&gt; reporting the following message is a serious cause for concern:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Error message 1&lt;/strong&gt;&lt;br /&gt;The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.&lt;br /&gt;&lt;strong&gt;Error message 2&lt;/strong&gt;&lt;br /&gt;CPU time stamp frequency has changed from 191469 to 1794177 ticks per millisecond. The new frequency will be used&lt;br /&gt;&lt;br /&gt;The SQL Server ERRORLOG reports a variety of informational, error and warning messages and not all messages are problems. This message is just telling you that CPU frequency between one or more processors is not synchronized. And how does this affect you??&lt;br /&gt;&lt;br /&gt;Quoting from one of the below articles:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;"&lt;/span&gt;&lt;em&gt;&lt;span style="color:#ffcc00;"&gt;Generally the Microsoft SQL Server support team considers drift less than several seconds, noise.&lt;/span&gt;&lt;/em&gt;&lt;span style="font-size:180%;"&gt;"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt;&lt;br /&gt;If you are concerned that the drift values are actually affecting your test results, then it would be a good idea to have the Speed Step, Power Now etc. features turned off during your testing phase. This would require changes at the BIOS level. Also, it would be a good idea to have consulted your H/W manufacturer and find out if there are any updates that require to be installed. Once again, I reiterate unless the drift values are constantly reporting several seconds for prolonged periods, only then do we have a Beginning of a problem, otherwise these warnings are mostly noise.&lt;br /&gt;&lt;br /&gt;Additionally, trace flag (–T8033) can be used to suppress the drift warnings.  However, please do not enable this trace flag on an instance of SQL Server 2005 unless and until, you fully understand the ramifications of ignoring the drift warnings.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Related Links&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;SQL Server timing values may be incorrect when you use utilities or technologies that change CPU frequencies&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/931279/en-us"&gt;http://support.microsoft.com/kb/931279/en-us&lt;/a&gt;&lt;br /&gt;SQL Server 2005 SP2 will introduce new messages to the error log related to timing activities&lt;br /&gt;&lt;a href="http://blogs.msdn.com/psssql/archive/2006/11/27/sql-server-2005-sp2-will-introduce-new-messages-to-the-error-log-related-to-timing-activities.aspx"&gt;http://blogs.msdn.com/psssql/archive/2006/11/27/sql-server-2005-sp2-will-introduce-new-messages-to-the-error-log-related-to-timing-activities.aspx&lt;/a&gt;&lt;br /&gt;SQL Server 2005 - RDTSC Truths and Myths Discussed&lt;br /&gt;&lt;a href="http://blogs.msdn.com/psssql/archive/2007/08/19/sql-server-2005-rdtsc-truths-and-myths-discussed.aspx"&gt;http://blogs.msdn.com/psssql/archive/2007/08/19/sql-server-2005-rdtsc-truths-and-myths-discussed.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-7159894322849851794?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/7159894322849851794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=7159894322849851794' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/7159894322849851794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/7159894322849851794'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/06/rdtsc.html' title='RDTSC'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-6055317937784069550</id><published>2008-06-06T21:13:00.001-07:00</published><updated>2008-06-24T04:41:21.685-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Best Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><title type='text'>USERSTORE_TOKENPERM</title><content type='html'>&lt;p&gt;On versions of SQL Server before 9.0.3171.0, a known issue can degrade query performance on 32-bit and 64-bit systems with 2 gigabytes (GB) or more of memory. When you execute queries under the context of a login that is not a member of the &lt;b&gt;sysadmin&lt;/b&gt; fixed server role, you might encounter performance degradation symptoms that arise from a large and growing Security Token cache. These issues can include performance degradation of queries, high CPU usage for the SQL Server process, and a sharp increase in worker threads and SQL user connections. Systems that have less than 2 GB of memory should not experience these issues because normal memory usage requirements keep the Security Token cache from growing too large.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Symptoms&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;A large number of users running queries on the SQL instance and intermittently you find that the duration of queries increases intermittently&lt;/li&gt;&lt;li&gt;Most of the queries in the environment exhibit this pattern for random parameters and not any specific query/proc with any specific parameter&lt;/li&gt;&lt;li&gt;DBCC MEMORYSTATUS output for the SQL instance shows that the memory usage for SQL is gradually increasing over a period of time&lt;/li&gt;&lt;li&gt;High CPU during the problem period&lt;/li&gt;&lt;li&gt;DBCC FREEPROCCACHE or DBCC FREESYSTEMCACHE fixes the issue temporarily&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Related Articles&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;li&gt;KB article &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;927396"&gt;927396&lt;/a&gt;: Queries take a longer time to finish running when the size of the TokenAndPermUserStore cache grows in SQL Server 2005&lt;/li&gt;&lt;li&gt;KB article &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;933564"&gt;933564&lt;/a&gt;: FIX: A gradual increase in memory consumption for the USERSTORE_TOKENPERM cache store occurs in SQL Server 2005&lt;/li&gt;&lt;li&gt;KB article &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;937745"&gt;937745&lt;/a&gt;: FIX: You may receive error messages when you try to log in to an instance of SQL Server 2005 and SQL Server handles many concurrent connections &lt;/li&gt;&lt;li&gt;&lt;a href="http://blogs.msdn.com/psssql/archive/2008/06/16/query-performance-issues-associated-with-a-large-sized-security-cache.aspx"&gt;http://blogs.msdn.com/psssql/archive/2008/06/16/query-performance-issues-associated-with-a-large-sized-security-cache.aspx&lt;/a&gt;&lt;/li&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-6055317937784069550?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/6055317937784069550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=6055317937784069550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/6055317937784069550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/6055317937784069550'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/06/userstoretokenperm.html' title='USERSTORE_TOKENPERM'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-8791362630441971024</id><published>2008-06-06T21:06:00.001-07:00</published><updated>2008-06-06T21:06:08.059-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Allow Updates Option</title><content type='html'>&lt;p&gt;SQL Server 2005 doesn't have the allow updates option. So, if you execute:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;sp_configure 'allow_updates',1&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;and then if you execute &lt;strong&gt;reconfigure&lt;/strong&gt;, you would get the following error:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Msg 5808, Level 16, State 1, Line 2       &lt;br /&gt;Ad hoc update to system catalogs is not supported.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;After this all changes to the &lt;strong&gt;sp_configure&lt;/strong&gt; settings followed by a reconfigure would yield this error. To rectify this, you will have to change the &lt;strong&gt;allow_updates&lt;/strong&gt; option back to 0 and run reconfigure. As per SQL Server 2005 Books Online:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;This option is still present in the sp_configure stored procedure, although its functionality is unavailable in Microsoft SQL Server 2005 (the setting has no effect). In SQL Server 2005, direct updates to the system tables are not supported. &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Changing the allow updates option will cause the RECONFIGURE statement to fail. Changes to the allow updates option should be removed from all scripts.&lt;/em&gt; &lt;/p&gt;  &lt;p&gt;So, if in case you use allow_updates in any script in SQL Server 2005, please refrain from doing so. Updates to the system catalogs are not permitted in SQL Server 2005 and any attempt/changes made to the System Resource database would get you into an unsupported scenario.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-8791362630441971024?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/8791362630441971024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=8791362630441971024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/8791362630441971024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/8791362630441971024'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/06/allow-updates-option.html' title='Allow Updates Option'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-3611479871539229058</id><published>2008-06-02T05:30:00.001-07:00</published><updated>2008-06-02T05:30:24.589-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>WMI Tracing</title><content type='html'>&lt;p&gt;A lot of companies find the need to monitor all DDL and DML activity on the server for Compliance reasons. Though SQL Profiler Traces provides this functionality by using Stored Procedures and Functions. These system stored procedures can be used from within your own applications to create traces manually, instead of using SQL Server Profiler. This allows you to write custom applications specific to the needs of your enterprise. However, you might choose not to use this approach due to the overhead of running profiler traces on the server. You can use &lt;a href="http://yukonspace.blogspot.com/2007/09/server-side-profiler-traces.html"&gt;server side profiler traces&lt;/a&gt; which tend to have a lesser performance impact on the server. &lt;/p&gt;  &lt;p&gt;Another method is to use WMI Events to monitor SQL Server Events. Consider the following example, let's say you want to monitor the SQL Server events for all Update Statistics Events. Then you can use script below to create the WMI Alert and also the job to put the event details into a SQL Server database table.&lt;/p&gt;  &lt;p&gt;&amp;lt;script&amp;gt;&lt;/p&gt;  &lt;p&gt;USE TestDB   &lt;br /&gt;GO&lt;/p&gt;  &lt;p&gt;-- Creating the table to store the DDL Events&lt;/p&gt;  &lt;p&gt;CREATE TABLE [dbo].[UPD_STATS_Events](   &lt;br /&gt;[AlertTime] [datetime] NULL,    &lt;br /&gt;[SPID] [int] NULL,    &lt;br /&gt;[DBName] [nvarchar](100) NULL,    &lt;br /&gt;[TextData] [nvarchar](max) NULL    &lt;br /&gt;) ON [PRIMARY] &lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;-- Adding the job to run when the WMI Alert is raised&lt;/p&gt;  &lt;p&gt;EXEC msdb.dbo.sp_add_job @job_name=N'Capture Update Statistics Events',    &lt;br /&gt;@enabled=1,     &lt;br /&gt;@description=N'Job for responding to DDL events' ;    &lt;br /&gt;GO&lt;/p&gt;  &lt;p&gt;-- Adding the job step&lt;/p&gt;  &lt;p&gt;EXEC msdb.dbo.sp_add_jobstep   &lt;br /&gt;@job_name = N'Capture Update Statistics Events',    &lt;br /&gt;@step_name=N'Insert data into Update Statistics Events table',    &lt;br /&gt;@step_id=1,     &lt;br /&gt;@on_success_action=1,     &lt;br /&gt;@on_fail_action=2,     &lt;br /&gt;@subsystem=N'TSQL',     &lt;br /&gt;@command= N'INSERT INTO UPD_STATS_Events    &lt;br /&gt;(AlertTime, Spid,DBName,TextData)    &lt;br /&gt;VALUES (getdate(), $(ESCAPE_NONE(WMI(SPID))),     &lt;br /&gt;''$(ESCAPE_SQUOTE(WMI(DatabaseName)))'',    &lt;br /&gt;''$(ESCAPE_SQUOTE(WMI(TSQLCommand)))'')',    &lt;br /&gt;@database_name=N'TestDB' ;    &lt;br /&gt;GO&lt;/p&gt;  &lt;p&gt;-- Set the job server for the job to the current instance of SQL Server.   &lt;br /&gt;EXEC msdb.dbo.sp_add_jobserver @job_name = N'Capture DDL Events' ;    &lt;br /&gt;GO    &lt;br /&gt;-- Add an alert that responds to all DBCC events for    &lt;br /&gt;-- the default instance. To monitor deadlocks for a different instance,    &lt;br /&gt;-- Change MSSQLSERVER to the name of the instance.    &lt;br /&gt;-- For the named instance you need to use \\.\root\Microsoft\SqlServer\ServerEvents\&amp;lt;INSTANCE NAME&amp;gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;EXEC msdb.dbo.sp_add_alert @name=N'Respond to DDL Events',     &lt;br /&gt;@wmi_namespace=N'\\.\root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER',     &lt;br /&gt;@wmi_query=N'SELECT * FROM UPDATE_STATISTICS',     &lt;br /&gt;@job_name='Capture DBCC Events' ;    &lt;br /&gt;GO&lt;/p&gt;  &lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;  &lt;p&gt;Whenever an update statistics task is fired against a database, the time when the command was executed, the SPID number, the database name and the T-SQL Command command associated with the event would be put into the table in the TestDB database.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8040"&gt;Service Broker should be enabled for the MSDB and the database in which you are storing the event details.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Information about the namespaces can be found on MSDN. Also, you could use &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&amp;amp;DisplayLang=en"&gt;WMI Code Creator&lt;/a&gt; to browse through the namespace and the classes available and their properties. &lt;/p&gt;  &lt;p&gt;Furthermore, you can also use the &lt;a href="http://msdn.microsoft.com/en-US/library/ms141130.aspx"&gt;WMI Event Watcher Task&lt;/a&gt; or the &lt;a href="http://msdn.microsoft.com/en-us/library/ms141744.aspx"&gt;WMI Data Reader Task&lt;/a&gt; of SQL Server 2005 SSIS to perform the same.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-3611479871539229058?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/3611479871539229058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=3611479871539229058' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/3611479871539229058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/3611479871539229058'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/06/wmi-tracing.html' title='WMI Tracing'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-8136147252509438108</id><published>2008-05-30T20:32:00.001-07:00</published><updated>2008-09-14T01:21:01.613-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Upgrade'/><category scheme='http://www.blogger.com/atom/ns#' term='Setup'/><title type='text'>The product instance been patched with more recent updates</title><content type='html'>&lt;p&gt;I have seen a few SQL Server 2005 Failover Clusters running into this issue. Recently, a KB Article was published explaining 2 methods (&lt;a href="http://support.microsoft.com/?kbid=934749"&gt;KB934749&lt;/a&gt;) to resolve this issue.&lt;/p&gt;  &lt;p&gt;One scenario when you can run into this issue is when you have a SQL Server 2005 Failover Cluster patched with Service Pack 2 or higher and you add a new node to the Failover Cluster, you could run into the issue then.&lt;/p&gt;  &lt;p&gt;Another scenario is that the SQL Server binaries on the one node got upgraded to a higher build but one of the member nodes was not upgraded due to some fatal error. But this is a very very &lt;em&gt;rare&lt;/em&gt; scenario because SQL Server 2005 setup makes sure it patches all the member nodes where the SQL instance is not &lt;em&gt;active&lt;/em&gt; before patching the node on which the SQL instance is installed.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-8136147252509438108?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/8136147252509438108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=8136147252509438108' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/8136147252509438108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/8136147252509438108'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/05/product-instance-been-patched-with-more.html' title='The product instance been patched with more recent updates'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-1550010448115675725</id><published>2008-05-30T18:38:00.001-07:00</published><updated>2008-05-30T18:53:27.562-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Best Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><title type='text'>SQL Best Practices Analyzer - II</title><content type='html'>&lt;p&gt;I have already blogged about this in a previous post of mine (&lt;a title="Best Practice Analyzer" href="http://yukonspace.blogspot.com/2008/03/best-practice-analyzer.html"&gt;Best Practice Analyzer&lt;/a&gt;) but I was recently working on the SQL Server 2005 version of the tool and thought that this deserved a second mention. &lt;/p&gt;  &lt;p&gt;This tool has been enhanced a lot and provides a great deal more information than it's SQL 2000 counterpart. This creates a XML data output file in your &lt;strong&gt;&lt;em&gt;%appdata%/Microsoft/SQL BPA&lt;/em&gt;&lt;/strong&gt; folder. This output can be imported using the SQL BPA UI and then a set of reports can be generated to check the following:&lt;/p&gt;  &lt;li&gt;Gathers configuration information from an instance of SQL Server. &lt;/li&gt;  &lt;li&gt;Performs specific tests on the instance of SQL Server. &lt;/li&gt;  &lt;li&gt;Proactively verifies that the configuration is set according to recommended best practices. Some high level checks are even performed on the Operating System level. &lt;/li&gt;  &lt;li&gt;Reports all settings that differ from the default settings. &lt;/li&gt;  &lt;li&gt;Reports recent changes in the instance of SQL Server.    &lt;p&gt;&amp;#160;&lt;/p&gt;    &lt;p&gt;On a broader level, the tool verifies the above mentioned based on rules divided into the following categories:&lt;/p&gt;    &lt;ol&gt;     &lt;li&gt;&lt;b&gt;Security rules&lt;/b&gt; &lt;/li&gt;      &lt;li&gt;&lt;b&gt;Database Engine rules&lt;/b&gt; &lt;/li&gt;      &lt;li&gt;&lt;b&gt;Analysis Services rules&lt;/b&gt; &lt;/li&gt;      &lt;li&gt;&lt;b&gt;Replication rules&lt;/b&gt; &lt;/li&gt;      &lt;li&gt;&lt;b&gt;Integration Services rules&lt;/b&gt; &lt;/li&gt;   &lt;/ol&gt;    &lt;p&gt;For example, if you applied the initial release version of SQL Server 2005 SP2, existing SQL Server 2005 maintenance plans and SSIS packages that contain cleanup tasks might run those tasks at shorter intervals. The tool if it scans your SQL Server instance and finds out if you are on a build lower than the one mentioned in &lt;a href="http://support.microsoft.com/?kbid=933508"&gt;KB933508&lt;/a&gt;, then it would provide the recommendation to apply the fix.&lt;/p&gt;    &lt;p&gt;The SQL BPA UI can be used to run scans on remote machines also. So, there is no need to install the tool on the SQL Server box which you want to scan. You can also configure the type of scan you want the SQL BPA tool to perform on your server.&lt;/p&gt;    &lt;p&gt;Microsoft PSS also has the capability to include this tool as a part of the &lt;a href="http://support.microsoft.com/kb/830232"&gt;PSSDIAG&lt;/a&gt; collection that they send out to collect diagnostic data from the instance based on the need to collect BPA analytics data. &lt;/p&gt;    &lt;p&gt;For a more detailed information about the above mentioned points, you can always refer the &lt;strong&gt;&lt;em&gt;SQL Server Best Practices Analyzer Help&lt;/em&gt;&lt;/strong&gt; chm file. &lt;/p&gt; &lt;/li&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-1550010448115675725?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/1550010448115675725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=1550010448115675725' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/1550010448115675725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/1550010448115675725'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/05/sql-best-practices-analyzer-ii.html' title='SQL Best Practices Analyzer - II'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-6555534044978050162</id><published>2008-05-25T13:09:00.001-07:00</published><updated>2008-05-30T18:55:43.196-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Connect: SQL Server</title><content type='html'>&lt;p&gt;I have spoken to a lot of people who are not really aware of the right medium of submitting product feedback for SQL Server or reporting defects online. The &lt;a href="http://connect.microsoft.com/"&gt;CONNECT &lt;/a&gt;site for MS is the way to go here. For reporting SQL Server related issues, please use the link &lt;a href="http://connect.microsoft.com/sqlserver"&gt;http://connect.microsoft.com/sqlserver&lt;/a&gt;    &lt;br /&gt;    &lt;br /&gt;Product Wishes can also be filed here. If you do submit product defect that can be fixed then the Dev team will definitely fix it. Fixing a part of the code requires lot of strategic thinking as well as testing. One of the biggest reasons why some fixes are rejected is because of the fact this current change in the code would impact a lot of other parts of the product which is working seamlessly fine or has the possibility of impacting a fully functional error free component in an adverse manner.    &lt;br /&gt;    &lt;br /&gt;So, in future if you do need to submit product feedback, please do so at &lt;a href="http://connect.microsoft.com/sqlserver"&gt;Connect: SQL Server&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We always welcome feedback regarding our Products and want our user community to tell us how to improve the same and what features they think they would be benefited with the most.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-6555534044978050162?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/6555534044978050162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=6555534044978050162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/6555534044978050162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/6555534044978050162'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/05/connect-sql-server.html' title='Connect: SQL Server'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-2297079787168812661</id><published>2008-05-11T08:51:00.000-07:00</published><updated>2008-05-11T09:09:42.797-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><title type='text'>Cluster Failovers</title><content type='html'>We do get quite a few issues regarding root cause analysis for Cluster Failovers. Failovers mostly happen due to the IsAlive check failing for the SQL Server resource after which the following two conditions arise:&lt;br /&gt;&lt;br /&gt;1. SQL Server service restarts on the same cluster node&lt;br /&gt;2. SQL Server resource fails over to a member cluster node&lt;br /&gt;&lt;br /&gt;So, for looking into the possible root causes of a cluster failover, a SQL version of the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=cebf3c7c-7ca5-408f-88b7-f9c79b7306c0&amp;amp;DisplayLang=en"&gt;MPS Reports &lt;/a&gt;capture is required from the node on which SQL is currently active. From the data requested by the PSS Engineer, the following files would be of utmost importance:&lt;br /&gt;&lt;br /&gt;1. All the SQL Server ERRORLOGs&lt;br /&gt;2. Windows Event Logs (System/Application)&lt;br /&gt;3. Cluster Log&lt;br /&gt;&lt;br /&gt;Based on the SQL Server ERRORLOGs, we would check for any errors or tell-tale signs which would point us to why the IsAlive check failed for the SQL Server resource. After that, we would look into the cluster log and the windows event logs to find out co-relation among the events during the failover time on the server.&lt;br /&gt;&lt;br /&gt;Since, the cluster log rolls over and also the SQL Server ERRORLOGs can roll over very quickly if a job is in place to recycle if after a certain size, it is a very good idea to save the &lt;em&gt;cluster log&lt;/em&gt; and the &lt;em&gt;SQL Server ERRORLOG(s)&lt;/em&gt; right after the failover to prevent them from rolling over and overwriting valuable data from the problem time period.&lt;br /&gt;&lt;br /&gt;Sometimes, a post mortem analysis provides us a hypothesis of what happened but doesn't paint the picture completely due to lack of data from the period the problem happened. Based on the nature of the problem, the PSS Engineer might ask to you to do the following for the the next problem occurrence along :&lt;br /&gt;&lt;br /&gt;1. Capture a light-weight PSSDIAG round the clock with file rollover&lt;br /&gt;2. Or a filtered dump of the SQL Process during the problem period if there is heavy blocking on the server or if the failover had occurred due to memory dump(s) on the server&lt;br /&gt;3. OR a round the clock Perfmon log if there were possible external memory pressure on the server. This can be configured while capturing a PSSDIAG&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-2297079787168812661?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/2297079787168812661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=2297079787168812661' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/2297079787168812661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/2297079787168812661'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/05/cluster-failovers.html' title='Cluster Failovers'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-6699365566744999006</id><published>2008-05-11T07:46:00.000-07:00</published><updated>2008-05-11T08:25:57.826-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><title type='text'>Deadlock Troubleshooting</title><content type='html'>Deadlock troubleshooting has always been a bit tricky. A deadlock is a special type of blocking scenario, but blocking and deadlocking are not the same thing. Deadlocks are a natural side effect of blocking. The most typical deadlock solution is either a stored proc/app code optimization, or a change in the database schema or indexing strategy.&lt;br /&gt;&lt;br /&gt;To capture a deadlock graph in the SQL Server ERRORLOG, use the following trace flags:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;For SQL Server 2000: 1204 &amp;amp; 3605&lt;/li&gt;&lt;li&gt;For SQL Server 2005: 1112&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Refer Bart Duncan's Weblog for deadlock troubleshooting. Bart was an Escalation Engineer for SQL Server and his blog article spanning three parts for deadlock troubleshooting is probably the most definitive guide for this topic.&lt;/p&gt;&lt;p&gt;&lt;a href="http://blogs.msdn.com/bartd/archive/2006/09/09/747119.aspx"&gt;http://blogs.msdn.com/bartd/archive/2006/09/09/747119.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The -T1204 output can be interpreted using the following file: &lt;a href="http://blogs.msdn.com/bartd/attachment/747119.ashx"&gt;http://blogs.msdn.com/bartd/attachment/747119.ashx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;If you find that your SQL Server is encountering deadlocks, then what data do you need to collect:&lt;/p&gt;&lt;p&gt;1. SQL Server Profiler traces with the following events:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;All statement level events &lt;/li&gt;&lt;li&gt;Showplan All events because the statement that is chosen as the deadlock victim will not have a Statistics Profile Event as it would have been terminated&lt;/li&gt;&lt;li&gt;Lock: Deadlock and if you are using SQL Server 2005, then capture Deadlock Graphs as well&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;2. Perfmon Logs &lt;/p&gt;&lt;p&gt;3. SQL 2000 &lt;a href="http://support.microsoft.com/kb/271509/"&gt;Blocker Script &lt;/a&gt;output/SQL 2005 &lt;a href="http://blogs.msdn.com/psssql/archive/2007/02/21/sql-server-2005-performance-statistics-script.aspx"&gt;PerfStats&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Additionally, if as a developer if you are concerned about your statements being terminated due to deadlocks, then you must build a &lt;em&gt;retry&lt;/em&gt; logic into your code for handling the deadlock and resubmitting the query. This can be done using a try-catch block withing the query batch that you are executing.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-6699365566744999006?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/6699365566744999006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=6699365566744999006' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/6699365566744999006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/6699365566744999006'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/05/deadlock-troubleshooting.html' title='Deadlock Troubleshooting'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-4715771443071621100</id><published>2008-05-11T07:13:00.000-07:00</published><updated>2008-05-11T07:44:31.563-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><title type='text'>SQL Nexus</title><content type='html'>This is a tool that is used by the Microsoft PSS team to analyze PSS Diag data. This tool has the capability of loading the Profiler Traces collected (provided &lt;a href="http://yukonspace.blogspot.com/2008/03/rml-utilities.html"&gt;ReadTrace&lt;/a&gt; is installed on the box).&lt;br /&gt;&lt;br /&gt;In addition to this, it also loads the other .OUT files and the &lt;a href="http://blogs.msdn.com/psssql/archive/2007/02/21/sql-server-2005-performance-statistics-script.aspx"&gt;PerfStats &lt;/a&gt;script output file into the Nexus database. I use this tool regularly to analyze PSSDIAG data due to the following reasons:&lt;br /&gt;&lt;br /&gt;1. Saves me time from manually opening each file and looking through them&lt;br /&gt;2. Based on the graphs provided in the reports, I can quickly drilldown to the major bottleneck&lt;br /&gt;&lt;br /&gt;The SQL Nexus reports act as a brilliant guide when you are analyzing &lt;a href="http://support.microsoft.com/kb/830232"&gt;PSSDIAG &lt;/a&gt;for the following scenarios:&lt;br /&gt;&lt;br /&gt;1. High CPU&lt;br /&gt;2. Blocking&lt;br /&gt;3. High IO&lt;br /&gt;4. General Performance Problems&lt;br /&gt;&lt;br /&gt;Since, the SQL Nexus Reports use Reporting Services client-side report viewer, you can create your own reports to work against the Nexus database and then deploy them to the &lt;strong&gt;%appdata%/SQL Nexus/Reports&lt;/strong&gt; folder. Once, this is done, the new reports would show up along with the defult reports every time SQL Nexus is launched.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;What are the advantages of this tool?&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1. Shows aggregation reports for the Profiler Traces loaded into it&lt;br /&gt;2. Blocking and wait statistics information based on the PerfStats script output. This helps in analyzing blocking on the server&lt;br /&gt;3. Since, the data collected are loaded into tables, you can run queries against the database to draw inferences. If you use these queries frequently enough, you can create your own reports and deploy them to the above mentioned location&lt;br /&gt;4. You can export the data from the SQL Nexus Reports into files (.XLS,.PDF,.JPG etc) and send them as reports&lt;br /&gt;5. The reports let you narrow down to specific time frames which makes analysis easier&lt;br /&gt;&lt;br /&gt;Download location: &lt;a href="http://www.codeplex.com/sqlnexus"&gt;http://www.codeplex.com/sqlnexus&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-4715771443071621100?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/4715771443071621100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=4715771443071621100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/4715771443071621100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/4715771443071621100'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/05/sql-nexus.html' title='SQL Nexus'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-8222675810197041265</id><published>2008-03-22T08:56:00.000-07:00</published><updated>2008-05-11T07:45:05.997-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><title type='text'>RML Utilities</title><content type='html'>The Microsoft Download site has a tool called RML Utilities which can be used to process the profiler traces collected from a SQL Server instance.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL Profiler Traces are very helpful when we need to perform a Bottleneck Analysis in any SQL environment or you need to find out the before &amp;amp; after picture. But the daunting task remains in analyzing the Profiler Traces.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL Server provides an in-built function fn_trace_gettable() to load the collected profiler traces into a SQL Server database table. Please refer for more details: &lt;a href="http://msdn2.microsoft.com/en-us/library/ms188425.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms188425.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Then you can run queries on this table to draw inferences from the profiler traces collected during that period. Lets say you wanted to find out all queries that had a duration above 10,000 and group the results by host name, then you could write a query in the following manner:&lt;br /&gt;&lt;br /&gt;SELECT hostname, count(*) as counts&lt;br /&gt;FROM tbl_trace&lt;br /&gt;WHERE Duration &gt; 10000&lt;br /&gt;GROUP BY hostname&lt;br /&gt;&lt;br /&gt;This is a tool that is used by Microsoft PSS to analyze SQL Server Profiler Traces collected by the PSSDIAG utility.&lt;br /&gt;&lt;br /&gt;For more details, please refer:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Replay Markup Language&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/?kbid=944837"&gt;http://support.microsoft.com/?kbid=944837&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;RML Utilities (x86) Download&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=7EDFA95A-A32F-440F-A3A8-5160C8DBE926&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=7EDFA95A-A32F-440F-A3A8-5160C8DBE926&amp;amp;displaylang=en&lt;/a&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=7EDFA95A-A32F-440F-A3A8-5160C8DBE926&amp;amp;displaylang=en#Instructions"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;RML Utilities (x64) Download&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=B60CDFA3-732E-4347-9C06-2D1F1F84C342&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=B60CDFA3-732E-4347-9C06-2D1F1F84C342&amp;amp;displaylang=en&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-8222675810197041265?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/8222675810197041265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=8222675810197041265' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/8222675810197041265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/8222675810197041265'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/03/rml-utilities.html' title='RML Utilities'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-3101566199619812714</id><published>2008-03-22T08:38:00.000-07:00</published><updated>2008-03-22T08:53:57.170-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Best Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><title type='text'>Best Practice Analyzer</title><content type='html'>I have seen a lot of people asking "&lt;strong&gt;Are we following best practices for our SQL Servers&lt;/strong&gt;?".  The Best Practice Analyzer cantry and guide you along a path which would lead to the right answer. A simple answer is not possible because of the following reasons:&lt;br /&gt;&lt;br /&gt;1. We are not conversant with your environment and setup&lt;br /&gt;2. We do not know what kind of business implementation this SQL Sever is&lt;br /&gt;3. We do not know what constraints are present which prevents some of the best practices from being followed&lt;br /&gt;4. We do not know which data/databases are critical/non-critical etc. and also do not know what kind of SLAs need to be met.&lt;br /&gt;&lt;br /&gt;Even then, an attempt is made using the Best Practice Analyzer to verify if common best practices are being implemented across your SQL Server. It creates a repository on the our server and stores the analysis  for the server in the database which can be used at a later date.&lt;br /&gt;&lt;br /&gt;The SQL Server 2005 Best Practices Analyzer (BPA) gathers data from Microsoft Windows and SQL Server configuration settings. BPA uses a predefined list of SQL Server 2005 recommendations and best practices to determine if there are potential issues in the database environment.&lt;br /&gt;&lt;br /&gt;This tool is available at&lt;br /&gt;For SQL Server 2000&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=B352EB1F-D3CA-44EE-893E-9E07339C1F22&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=B352EB1F-D3CA-44EE-893E-9E07339C1F22&amp;amp;displaylang=en&lt;/a&gt;&lt;br /&gt;For SQL Server 2005&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=DA0531E4-E94C-4991-82FA-F0E3FBD05E63&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=DA0531E4-E94C-4991-82FA-F0E3FBD05E63&amp;amp;displaylang=en&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-3101566199619812714?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/3101566199619812714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=3101566199619812714' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/3101566199619812714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/3101566199619812714'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2008/03/best-practice-analyzer.html' title='Best Practice Analyzer'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-2013159944280481727</id><published>2007-12-29T12:17:00.000-08:00</published><updated>2007-12-29T12:42:48.352-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><title type='text'>Transaction Log Growth</title><content type='html'>&lt;strong&gt;&lt;u&gt;My Transaction Log is Growing!!!&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The transaction log growth issue... What do we do?? A few things not to do when this happens:&lt;br /&gt;&lt;br /&gt;1. Delete the LDF file of the database&lt;br /&gt;2. Create a new LDF file if there is no space in the existing transaction log and if the SQL Server ERRORLOG is reporting 900* messages. (Personal opinion.. Seen a lot of situations where this is has gone horribly wrong on production environments)&lt;br /&gt;3. Take the database offline&lt;br /&gt;4. Restart the SQL Server service&lt;br /&gt;&lt;br /&gt;Now that the above steps are avoided, what is to be done. Simple set of steps can be done to shrink the T-LOG of the database in question using the steps mentioned in the KB Article below. My troubleshooting steps involve the following:&lt;br /&gt;&lt;br /&gt;1. Check the current SQL Server ERRORLOG for any 900* error messages related to the T-LOG&lt;br /&gt;2. If you have enough disk space and the database is not in SIMPLE recovery, make a backup of the transaction log so that the you can most of the current active virtual log files&lt;br /&gt;3. Use DBCC SQLPERF (LOGSPACE) to find out the current used percentage of the transaction log for the database in question&lt;br /&gt;4. If it's SQL Server 2005, find out the log reuse value in the sys.databases catalog view output&lt;br /&gt;5. Find out if there are any open transactions using DBCC OPENTRAN command. KILL the transaction if you can ascertain that this open transaction can be redone or recovered later.&lt;br /&gt;6. Try shrinking the T-LOG using DBCC SHRINFILE or if it is in SIMPLE recovery, try using BACKUP LOG WITH TRUNCATE_ONLY command. But be advised that this truncate command will truncate your transaction log.&lt;br /&gt;OR&lt;br /&gt;You can even try firing a CHECKPOINT into the database and then trying to truncate the transaction log.&lt;br /&gt;&lt;br /&gt;Another important thing is to make sure that your autogrowth considerations are taken into account. The following article should help you decide what needs to done in deciding the autogrowth of a database file: &lt;a href="http://support.microsoft.com/kb/315512/en-us"&gt;http://support.microsoft.com/kb/315512/en-us&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For more information, see the following topics in SQL Server Books Online:&lt;br /&gt;• Shrinking the transaction log&lt;br /&gt;• DBCC SHRINKFILE (Transact-SQL)&lt;br /&gt;• Truncating the transaction log&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Useful articles&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span&gt;How to use the DBCC SHRINKFILE statement to shrink the transaction log file in SQL Server 2005 &lt;/span&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/907511/en-us"&gt;http://support.microsoft.com/kb/907511/en-us&lt;/a&gt;&lt;br /&gt;INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/272318/en-us"&gt;http://support.microsoft.com/kb/272318/en-us&lt;/a&gt;&lt;br /&gt;INF: How to Shrink the SQL Server 7.0 Transaction Log&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/256650/en-us"&gt;http://support.microsoft.com/kb/256650/en-us&lt;/a&gt;&lt;br /&gt;How to stop the transaction log of a SQL Server database from growing unexpectedly&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/873235/en-us"&gt;http://support.microsoft.com/kb/873235/en-us&lt;/a&gt;&lt;br /&gt;A transaction log grows unexpectedly or becomes full on a computer that is running SQL Server&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/317375/en-us"&gt;http://support.microsoft.com/kb/317375/en-us&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Common Reasons for T-LOG growth&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1. Wrong autogrowth values (Mostly high percentage values)&lt;br /&gt;2. Index rebuild operations for database done infrequently with database in full recovery model or with log shipping/mirroring enabled&lt;br /&gt;3. Something failing in your replication topology&lt;br /&gt;4. BULK insert/update operations&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-2013159944280481727?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/2013159944280481727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=2013159944280481727' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/2013159944280481727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/2013159944280481727'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/12/transaction-log-growth.html' title='Transaction Log Growth'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-7576596393180130258</id><published>2007-10-28T04:13:00.000-07:00</published><updated>2007-10-28T04:29:03.990-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><title type='text'>Disk Contention Issues</title><content type='html'>&lt;span&gt;&lt;br /&gt;It is recommended that Average Disk Queue Length for disks be less than 2 * number of spindles on the disk. So if your disk had 10 spindles, then values above 20 woud be a cause of concern. But on a SAN, this particular counter can be misleading at times.&lt;br /&gt;&lt;br /&gt;You might want to the check the following counters under perfmon too:&lt;br /&gt;&lt;br /&gt;Physical Disk:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ffcc00;"&gt;Avg. Disk Secs/Write&lt;br /&gt;Avg. Disk Secs/Read&lt;br /&gt;Avg. Disk Secs/Transfer&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Logical Disk&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ffcc00;"&gt;Avg. Disk Secs/Write&lt;br /&gt;Avg. Disk Secs/Read&lt;br /&gt;Avg. Disk Secs/Transfer&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Also, you would want to find out if there are a lot of Split I/O operations happening on the server.&lt;br /&gt;&lt;br /&gt;For disks on which SQL Server Data (MDF,NDF) and Log (LDF) files reside, we recommend that these counters show values less that 30 milli-seconds. If they are constantly showing values of 0.5 and above, then we have a disk contention issue on our hands.&lt;br /&gt;&lt;br /&gt;The disk contention could be due to these reasons:&lt;br /&gt;&lt;br /&gt;1. There is an underlying H/W issue. This could mean that some driver or firmware needs an upgrade (essentially all your firmware/drivers should always be on the latest builds available) or it could be a problem with the SAN configuration or it could be that this particular SAN is not dedicated to SQL Server.&lt;br /&gt;&lt;br /&gt;2. &lt;strong&gt;&lt;u&gt;OR&lt;/u&gt;&lt;/strong&gt; it could be that the disk contention is due to the fact that the queries executing on SQL Server are performing excessive amount of reads due to sub-optimal plans. Sub-optimal plans would be generated if your indexes are out of shape or if your statistics are skewed. This would require a statistics update with a full scan. (Statistics maintenance, please refer: &lt;span style="color:#3333ff;"&gt;&lt;a href="http://yukonspace.blogspot.com/2007/10/statistics-update.html"&gt;http://yukonspace.blogspot.com/2007/10/statistics-update.html&lt;/a&gt;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;3. &lt;strong&gt;&lt;u&gt;OR&lt;/u&gt;&lt;/strong&gt; it could be that the disk activity on the disks has increased over a period of time due to increase in data or addition of new databases. In such a case, it would be a good idea to provide a separate disk or storage area for some of the databases as the current activity might be too much for the disk to handle. Sometimes, load balancing for physical storage also helps in alleviating a disk contention issue.&lt;br /&gt;&lt;br /&gt;Also, it would be a good idea to check if you are receiving any stuck/stalled IO warnings in the SQL Server ERRORLOGs. Please refer &lt;span style="color:#3333ff;"&gt;&lt;a href="http://yukonspace.blogspot.com/2007/09/stuck-stalled-io-messages.html"&gt;http://yukonspace.blogspot.com/2007/09/stuck-stalled-io-messages.html&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Related Articles&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span&gt;Improving SQL Server Performance&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms998577.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms998577.aspx&lt;/a&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Troubleshooting Performance Problems in SQL Server 2005&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/tsprfprb.mspx"&gt;http://www.microsoft.com/technet/prodtechnol/sql/2005/tsprfprb.mspx&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;span&gt;&lt;p&gt;&lt;br /&gt;Application performance troubleshooting with SQL Server&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/224587"&gt;http://support.microsoft.com/kb/224587&lt;/a&gt; &lt;/p&gt;&lt;p&gt;I/O Related DMVs for SQL Server 2005&lt;/p&gt;&lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms190314.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms190314.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Sometimes, it's also worthwhile checking the activity on tempdb and finding out if the contention is due to tempdb activity. The links below could be helpful:&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/workingwithtempdb.mspx"&gt;http://www.microsoft.com/technet/prodtechnol/sql/2005/workingwithtempdb.mspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/328551"&gt;http://support.microsoft.com/kb/328551&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-7576596393180130258?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/7576596393180130258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=7576596393180130258' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/7576596393180130258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/7576596393180130258'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/10/disk-contention-issues.html' title='Disk Contention Issues'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-7568989737004697830</id><published>2007-10-24T08:23:00.000-07:00</published><updated>2007-10-24T09:14:57.598-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Best Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><title type='text'>How to update statistics for large databases</title><content type='html'>Statistics are something that the SQL Optimizer depends on to generate a plan. The more outdated your statistics are, greater are the chances that your query optimizer will land up with a sub-optimal plan.&lt;br /&gt;&lt;br /&gt;So what do you do when you have a database which is highly transactional in nature and is quite large in size. So, you might land up in a scenario where the database is online 24X7 and there is no downtime window where you can update your statistics with a FULLSCAN.&lt;br /&gt;&lt;br /&gt;Before we get into what my opinion is about updating statistics of a database is, lets make sure we understand what I mean by statistics being "&lt;strong&gt;up-to-date&lt;/strong&gt;". Statistics being up-to-date is the sampling rate used while updating statistics was 100% or they were updated with a FULLSCAN. Statistics updated using AUTO UPDATE STATISTICS property of a database will not update statistics with a FULLSCAN contrary to popular belief. The sole reason for this being is that suppose a table has 1 GB of data and a query on the database initiated a AUTO UPDATE  of a STAT on this database, then if the sampling was 100%, then your query duration would take an eternity.&lt;br /&gt;&lt;br /&gt;So, if you have a large database:&lt;br /&gt;1. Ensure that the AUTO UPDATE STATS is turned on for  the database. This would provide for some relief to the database&lt;br /&gt;2. Identify which tables need to have their statistics updated with a fullscan. Only those would be required which have the maximum number of queries running on them&lt;br /&gt;3. Next identify a period when the database usage is low. This is the time when you can use to update the stats of the other tables which did not qualify the list in #2.&lt;br /&gt;4. Use a script to update statistics of the tables indentified step # 2 probably based on rowmodctr values (ROWMODCTR: Counts the total number of inserted, deleted, or updated rows since the last time statistics were updated for the table. In SQL Server 2005, this is not going to be always helpful [Ref: &lt;a href="http://msdn2.microsoft.com/en-us/library/ms190283.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms190283.aspx&lt;/a&gt;]. But in SQL 2000, this could be used as a deciding factor)&lt;br /&gt;&lt;br /&gt;Sample Script&lt;br /&gt;============&lt;br /&gt;&lt;br /&gt;Let's say I had identified 4 tables in STEP 2:&lt;br /&gt;&lt;br /&gt;CREATE TABLE UPD_STATS_TBL (tblname varchar(10), dt_updated datetime, rowmodctr bigint)&lt;br /&gt;&lt;br /&gt;SELECT * FROM UPD_STATS_TBL&lt;br /&gt;tblname  dt_updated                            rowmodctr&lt;br /&gt;TBL1       2007-10-24 21:13:46.123  20000&lt;br /&gt;TBL2      2007-10-23 21:13:46.123   400000&lt;br /&gt;TBL3      2007-10-22 21:13:46.123   508000&lt;br /&gt;TBL4      2007-10-24 20:13:46.123   87000&lt;br /&gt;&lt;br /&gt;**************************************************&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;CREATE PROC UPD_STATS_DB&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;AS&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;DECLARE @tbl varchar(10)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;UPDATE upd_stats_tbl SET rowmodctr = (SELECT MAX(rowmodctr) from sys.sysindexes where id=OBJECT_ID(tblname))&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;SELECT TOP 1 @tbl = tblname &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;FROM UPD_STATS_TBL&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;WHERE rowmodctr &gt; &lt;threshold&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;ORDER BY dt_updated&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;DECLARE @stmt varchar (100)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;SET @stmt = 'UPDATE STATISTICS'+SPACE(1)+@tbl+SPACE(1)+'WITH FULLSCAN'&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;EXEC (@stmt)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;UPDATE upd_stats_tbl SET dt_updated = (SELECT GETDATE())&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffcc00;"&gt;&lt;strong&gt;WHERE tblname = @tbl&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;**************************************************&lt;br /&gt;&lt;br /&gt;NOTE: You could refine this down to the table statistic if you wanted to.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-7568989737004697830?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/7568989737004697830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=7568989737004697830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/7568989737004697830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/7568989737004697830'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/10/how-to-update-statistics-for-large.html' title='How to update statistics for large databases'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-2088493899407982550</id><published>2007-10-24T08:04:00.000-07:00</published><updated>2007-10-24T08:14:57.671-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Best Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><title type='text'>Missing Indexes in SQL Server 2005</title><content type='html'>Indexes are essential in making sure that your queries have effecient query plans and for SELECTS, you don't end up doing searches on HEAPS.&lt;br /&gt;&lt;br /&gt;One of the biggest improvements in SQL Server 2005 is that it tracks all the transactions happening on the server and makes a list of indexes which could prove beneficial for those queries. Of course, one index might be beneficial for one query but detrimental to another. So, it is highly essential that we test the feasibility of implementing these indexes on a production environment before rolling out changes to our indexes.&lt;br /&gt;&lt;br /&gt;&lt;a name="sectionToggle1"&gt; The missing indexes feature is on by default. No controls are provided to turn the feature on or off, or to reset any of the tables returned when the dynamic management objects are queried. When SQL Server is restarted, all of the missing index information is dropped. This feature can only be disabled if an instance of SQL Server is started by using the -x argument with the sqlservr command-prompt utility.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ffcc00;"&gt;So, the first thing I would do if a query or a set of queries are running slowly in SQL Server, I would query the DMVs related to these missing indexes and find out if there are an indexes related to the tables on which those slow running queries are executing. This feature becomes highly useful when the following conditions are true:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ffcc00;"&gt;1. NO CPU bottleneck&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ffcc00;"&gt;2. NO Blocking on the server&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ffcc00;"&gt;3. NO Disk bottleneck&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;You can view a list of all the missing indexes using Performance Dashboard which can be used with SQL Server 2005 Service Pack 2 and above.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Relate Links for Missing Indexes&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;About Missing Indexes&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms345524.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms345524.aspx&lt;/a&gt;&lt;br /&gt;Finding Missing Indexes&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms345417.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms345417.aspx&lt;/a&gt;&lt;br /&gt;Limitations of this feature&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms345485.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms345485.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-2088493899407982550?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/2088493899407982550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=2088493899407982550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/2088493899407982550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/2088493899407982550'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/10/missing-indexes-in-sql-server-2005.html' title='Missing Indexes in SQL Server 2005'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-8917886176640812892</id><published>2007-10-13T04:25:00.000-07:00</published><updated>2007-10-13T04:32:16.839-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><title type='text'>SQL Server is not configured for Remote Connections</title><content type='html'>This is one of the most common error messages when users use default settings to connect to a SQL Server Express Instance.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;ERROR&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Sqlcmd: Error: Microsoft SQL Native Client: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Please refer the following article to make sure that your SQL Express Instance is configured to accept Remote Connections:&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;a href="http://support.microsoft.com/kb/914277"&gt;http://support.microsoft.com/kb/914277&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Also, make sure from the SQL Server Configuration Manager that TCP/IP and Named Pipes are enabled and you have VIA protocol disabled.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-8917886176640812892?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/8917886176640812892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=8917886176640812892' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/8917886176640812892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/8917886176640812892'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/10/sql-server-is-not-configured-for-remote.html' title='SQL Server is not configured for Remote Connections'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-4250216534622567431</id><published>2007-10-12T22:24:00.000-07:00</published><updated>2007-10-12T22:27:55.021-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Federated Servers</title><content type='html'>&lt;p&gt;To achieve the high levels of performance required by the largest Web sites, a multitier system typically balances the processing load for each tier across multiple servers. SQL Server 2005 shares the database processing load across a group of servers by horizontally partitioning the data in a SQL Server database. These servers are managed independently, but cooperate to process the database requests from the applications; such a cooperative group of servers is called a federation.&lt;/p&gt;&lt;p&gt;A federated database tier can achieve very high levels of performance only if the application sends each SQL statement to the member server that has most of the data required by the statement. This is referred to as collocating the SQL statement with the data required by the statement. Collocating SQL statements with the required data is not a requirement unique to federated servers. It is also required in clustered systems.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Federated Server Tier&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;There is one instance of SQL Server on each member server.&lt;/p&gt;&lt;p&gt;Each member server has a member database. The data is spread through the member databases.&lt;/p&gt;&lt;p&gt;The tables from the original database are horizontally partitioned into member tables. There is one member table per member database, and distributed partitioned views are used to make it appear as if there was a full copy of the original table on each member server.&lt;/p&gt;&lt;p&gt;The application layer must be able to collocate SQL statements on the member server that contains most of the data referenced by the statement.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Backing Up and Restoring Federated Database Servers&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;In a federated-database-server tier that is built by using distributed partitioned views, the member servers form one logical unit. Therefore, you must coordinate the recovery of the member databases to make sure that they remain synchronized correctly.&lt;/p&gt;&lt;p&gt;SQL Server 2005 does not require that you coordinate backups across member servers. Backups can be independently taken from each database, without regard for the state of the other member databases. Because the backups do not have to be synchronized, there is no processing overhead for synchronization and no blockage of running tasks.&lt;/p&gt;&lt;p&gt;The most important aspect of recovering a set of member databases is the same as recovering any other database: Plan and test the recovery procedures before you put the databases into production. You must set up processes to restore all the databases to the same logical point in time. SQL Server includes features to support the recovery of all member databases to the same point in time.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Pros&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;1. Federated servers if implemented correctly are a great way to load balance a database server environment and is very similar to a database farm implementation.&lt;/p&gt;&lt;p&gt;2. This would greatly allow you to distribute the load on your servers based on any of the following criteria:&lt;/p&gt;&lt;p&gt;a. Geographic location&lt;/p&gt;&lt;p&gt;b. Traffic in terms of users&lt;/p&gt;&lt;p&gt;c. Traffic in terms of transactions&lt;/p&gt;&lt;p&gt;d. Database table size&lt;/p&gt;&lt;p&gt;3. Also, federated servers give you the option on partitioning data across servers with the help of distributed partitioned views&lt;/p&gt;&lt;p&gt;4. This gives you the option of horizontally partitioning the data across various servers which ultimately leads to greater throughput&lt;/p&gt;&lt;p&gt;5. It lets you control the traffic coming in and also helps in maintaining the load thresholds across the entire setup&lt;/p&gt;&lt;p&gt;6. Furthermore, if we have a middle tier in the entire setup, then design changes in the federated server environment will not affect the client side applications in any manner as they would be connecting to the middle tier and the middle tier will connect with the database server&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Cons&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;1. One of the major drawbacks is disaster recovery. If one of the member server fails, there needs to a failback plan in place which could cause minimum hindrance to the normal operations while implementation.&lt;/p&gt;&lt;p&gt;2. Also, if distributed partitioning is being implemented, then rules and constraints need to be strong enough to prevent any sort on inconsistencies from arising due to data modification&lt;/p&gt;&lt;p&gt;3. Also, if the performance of one of the member servers takes a hit, most of the distributed partitioned views would also take a hit in terms of operations done on them&lt;/p&gt;&lt;p&gt;4. The middle tier should be designed in such a robust manner that there is no ambiguity in resolving which server in the environment needs to targeted based on the query coming into the server&lt;/p&gt;&lt;p&gt;5. The backup/restore scenarios need to be designed and planned in such a way that all the member servers are all synchronized at all times&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Useful Articles&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The following whitepaper and TechNet articles should help a great deal here:&lt;/p&gt;&lt;p&gt;Planning, Implementing, and Administering Scaleout Solutions with SQL Server 2005Solution&lt;/p&gt;&lt;p&gt;&lt;a href="http://download.microsoft.com/download/4/7/a/47a548b9-249e-484c-abd7-29f31282b04d/ImplementingScaleOut.doc"&gt;http://download.microsoft.com/download/4/7/a/47a548b9-249e-484c-abd7-29f31282b04d/ImplementingScaleOut.doc&lt;/a&gt;  &lt;/p&gt;&lt;p&gt;Scaling Out SQL Server with Data Dependent Routing&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/scddrtng.mspx"&gt;http://www.microsoft.com/technet/prodtechnol/sql/2005/scddrtng.mspx&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Designing Data Tier Components and Passing Data Through Tiers &lt;a href="http://msdn2.microsoft.com/en-us/library/ms978496.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms978496.aspx&lt;/a&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-4250216534622567431?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/4250216534622567431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=4250216534622567431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/4250216534622567431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/4250216534622567431'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/10/federated-servers.html' title='Federated Servers'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-2150148338713283809</id><published>2007-10-12T07:18:00.000-07:00</published><updated>2007-10-12T07:51:08.827-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Best Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='Upgrade'/><title type='text'>SQL Server 2005 Upgrade</title><content type='html'>Upgrading from SQL Server 2000 to SQL Server 2005 is always a daunting task if you have had a chance to contemplate as to what needs to be done before and after the upgrade process. On the other hand, if you had a chance to plan out everything before hand, then it is very unlikely that you would land yourself in a soup unless and until the Gods choose to be very unkind towards you on that fateful day. :)&lt;br /&gt;&lt;br /&gt;So, first let us understand what are the two procedures of upgrading from SQL Server 2000 to SQL Server 2005.&lt;br /&gt;&lt;br /&gt;1. &lt;strong&gt;IN PLACE UPGRADE&lt;/strong&gt;&lt;br /&gt;2. &lt;strong&gt;SIDE BY SIDE UPGRADE&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;So, before I go ahead and explain these two upgrade procedures, let us dwell on the pre-requisites for upgrading to SQL Server 2005.&lt;br /&gt;&lt;br /&gt;1. &lt;strong&gt;&lt;u&gt;Testing&lt;/u&gt;&lt;/strong&gt;: Make sure all your applications are thoroughly tested and function as expected on a SQL Server 2005 environment before deciding to take the final step&lt;br /&gt;2. &lt;strong&gt;&lt;u&gt;Fall-back plan&lt;/u&gt;&lt;/strong&gt;: This is what I call "insurance". It's a hassle but when a problem does happen, this is what takes care in helping you out of the problem. I believe it is better to be safe than sorry.&lt;br /&gt;3. &lt;strong&gt;&lt;u&gt;Backups&lt;/u&gt;&lt;/strong&gt;: This should have been included in Point 2 but this is something of utmost importance, so I thought I would re-iterate this again. We need to have backups of all the user and system (YES! we need them.) databases in case we need to use our fall-back plan.&lt;br /&gt;4. Upgrade Advisor: Run the upgrade advisor on your existing SQL Server 2000 installation and find out if there are any &lt;span style="color:#ff0000;"&gt;REDFLAGS&lt;/span&gt; in upgrading to SQL Server 2005 based on your current configuration. (Please check the following link for more details: &lt;a href="https://partner.microsoft.com/40001607"&gt;https://partner.microsoft.com/40001607&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;In-place upgrade process&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The upgrade process which refers to upgrading all the existing installed components of SQL Server 2000 to SQL Server 2005 on the same server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Side-by-side upgrade process&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The upgrade process which refers to leaving your existing SQL Server installation intact and installing a fresh SQL Server 2005 instance on the same server or a different server and then migrating over all your databases. Once, all the components (Databases, Plans, DTS Packages etc.) have been migrated the SQL 2000 installation can then be phased out.&lt;br /&gt;&lt;br /&gt;Both these upgrade processes have their PROs and CONs which are clearly documented in the TechNet Article mentioned below.&lt;br /&gt;&lt;br /&gt;Upgrade Handbook for SQL Server 2005&lt;br /&gt;&lt;a href="https://aps.mail.microsoft.com/OWA/redir.aspx?C=077ffa372d464cd3b2857a9ee5e68c41&amp;amp;URL=http%3a%2f%2fwww.microsoft.com%2ftechnet%2fprodtechnol%2fsql%2f2005%2fsqlupgrd.mspx" target="_blank"&gt;http://www.microsoft.com/technet/prodtechnol/sql/2005/sqlupgrd.mspx&lt;/a&gt;&lt;br /&gt;Upgrading to SQL Server 2005&lt;br /&gt;&lt;a href="https://aps.mail.microsoft.com/OWA/redir.aspx?C=077ffa372d464cd3b2857a9ee5e68c41&amp;amp;URL=http%3a%2f%2fwww.microsoft.com%2fsql%2fsolutions%2fupgrade%2fdefault.mspx" target="_blank"&gt;http://www.microsoft.com/sql/solutions/upgrade/default.mspx&lt;/a&gt;&lt;br /&gt;Technet Article on Upgrading SQL Server 2000 to SQL Server 2005&lt;br /&gt;&lt;a href="https://aps.mail.microsoft.com/OWA/redir.aspx?C=077ffa372d464cd3b2857a9ee5e68c41&amp;amp;URL=http%3a%2f%2fwww.microsoft.com%2fdownloads%2fdetails.aspx%3fFamilyID%3d3d5e96d9-0074-46c4-bd4f-c3eb2abf4b66%26DisplayLang%3den" target="_blank"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=3d5e96d9-0074-46c4-bd4f-c3eb2abf4b66&amp;amp;DisplayLang=en&lt;/a&gt;  &lt;br /&gt;&lt;br /&gt;So, what do we need to take care of when upgrading to SQL Server 2005 from SQL Server 2000?&lt;br /&gt;&lt;br /&gt;1. &lt;strong&gt;Replication:&lt;/strong&gt; If you do have replication configured (subscriber/publisher/distributor), you need to find out if your replication topology is compatible and will continue to function smoothly if the current server is upgraded?&lt;br /&gt;2. &lt;strong&gt;DTS Packages&lt;/strong&gt;: These need to migrated to SQL Server 2005 using the Migration Wizard. Related Article: &lt;a href="http://msdn2.microsoft.com/en-us/library/ms143501.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms143501.aspx&lt;/a&gt;&lt;br /&gt;3. &lt;strong&gt;Maintenance Plans&lt;/strong&gt;: Again they are different from their SQL Server 2000 counterparts because in SQL 2005, we use SSIS in the background.&lt;br /&gt;4. &lt;strong&gt;Logins&lt;/strong&gt;: In case of an side-by-side upgrade, then these need to be migrated too.&lt;br /&gt;&lt;br /&gt;These are a few of prime areas of concern that come to my mind. A whole bunch of other considerations are mentioned in the above mentioned Technet Whitepaper. Please do read through that if you are planning to upgrade to SQL Server 2005.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-2150148338713283809?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/2150148338713283809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=2150148338713283809' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/2150148338713283809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/2150148338713283809'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/10/sql-server-2005-upgrade.html' title='SQL Server 2005 Upgrade'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-6574961398129016681</id><published>2007-10-03T00:31:00.001-07:00</published><updated>2007-10-03T00:33:12.391-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><title type='text'>SQL Server Tools</title><content type='html'>&lt;strong&gt;The following tools could be really helpful in monitoring your SQL Server instances:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Best Practices Analyzer Tool for Microsoft SQL Server 2000 1.0 &lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?displayla%20ng=en&amp;amp;familyid=B352EB1F-D3CA-44EE-893E-9E07339C1F22&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?displayla%20ng=en&amp;amp;familyid=B352EB1F-D3CA-44EE-893E-9E07339C1F22&amp;amp;displaylang=en&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL Server 2005 Performance Dashboard Reports (Requires minimum Service Pack2 for SQL 2005)&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=1D3A4A0D-7E0C-4730-8204-E419218C1EFC&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=1D3A4A0D-7E0C-4730-8204-E419218C1EFC&amp;amp;displaylang=en&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is quite a useful resource for managing SQL Server:&lt;br /&gt;&lt;strong&gt;SQL Server 2000 Administrator's Pocket Consultant&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/sql/2000/books/adminpoc.mspx"&gt;http://www.microsoft.com/technet/prodtechnol/sql/2000/books/adminpoc.mspx&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;Microsoft SQL Server 2005 Administrator's Pocket Consultant&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/mspress/books/6794.aspx"&gt;http://www.microsoft.com/mspress/books/6794.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-6574961398129016681?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/6574961398129016681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=6574961398129016681' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/6574961398129016681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/6574961398129016681'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/10/sql-server-tools.html' title='SQL Server Tools'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-8973844139749337847</id><published>2007-10-03T00:31:00.000-07:00</published><updated>2007-10-12T08:11:13.099-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><title type='text'>SQL Server Tools</title><content type='html'>&lt;strong&gt;The following tools could be really helpful in monitoring your SQL Server instances:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Best Practices Analyzer Tool for Microsoft SQL Server 2000 1.0 &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?displayla%20ng=en&amp;amp;familyid=B352EB1F-D3CA-44EE-893E-9E07339C1F22&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?displayla%20ng=en&amp;amp;familyid=B352EB1F-D3CA-44EE-893E-9E07339C1F22&amp;amp;displaylang=en&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL Server 2005 Performance Dashboard Reports (Requires minimum Service Pack2 for SQL 2005)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=1D3A4A0D-7E0C-4730-8204-E419218C1EFC&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=1D3A4A0D-7E0C-4730-8204-E419218C1EFC&amp;amp;displaylang=en&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-8973844139749337847?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/8973844139749337847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=8973844139749337847' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/8973844139749337847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/8973844139749337847'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/10/sql-server-tools_03.html' title='SQL Server Tools'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-3877631869400691359</id><published>2007-10-03T00:27:00.000-07:00</published><updated>2007-10-03T00:30:52.325-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Best Practices'/><title type='text'>Backup Strategy</title><content type='html'>Backup strategy needs to be designed in such a manner that it causes minimum amount of downtime in case during a disaster recovery scenario if backups need to be restored. The backup strategy depends on the following:&lt;br /&gt;&lt;br /&gt;1. Size of the database – This would determine how often a FULL BACKUP can be taken&lt;br /&gt;2. Recovery Model – This would determine if transaction log/differential backups are possible&lt;br /&gt;3. The importance of the database – This would determined how often transaction log backups need to be takenIf the database is in “simple” recovery model, then the only option that we would have is to take full backups.&lt;br /&gt;&lt;br /&gt;If the database is in FULL/BULK-LOGGED recovery models, then we have the option of taking transaction log/differential backups.&lt;br /&gt;&lt;br /&gt;Now the next question is how often to take a transaction log backup. Depending of the importance of the database, transaction log backups can be taken every 10-15 minutes or even every hour. This needs to be determined at your end. Furthermore, if the transaction log backups are being taken very frequently and a full backup is taken once a week, then it is advisable to take differential backups during the middle of the week. This would ensure that the process of restore becomes less cumbersome as after the full backup, then differential backup can be applied followed by the transactional log backups.&lt;br /&gt;&lt;br /&gt;In case of full/bulk-logged recovery models, the following backup strategy would be ideal:&lt;br /&gt;&lt;p&gt;1. Full backup&lt;/p&gt;&lt;p&gt;a. Differential backup(s)&lt;/p&gt;&lt;p&gt;i. Transaction log backup(s)&lt;/p&gt;&lt;p&gt;b. Differential backup(s)&lt;/p&gt;&lt;p&gt;i. Transaction log backup(s)&lt;/p&gt;&lt;p&gt;2. Full backup (and repeat the above cycle)&lt;/p&gt;&lt;br /&gt;Furthermore, for creating sound fail-over strategies for disaster recovery scenarios, the following can be considered:&lt;br /&gt;1. Log shipping&lt;br /&gt;2. Database Mirroring (For SQL 2005 SP1 and above)&lt;br /&gt;3. Replication&lt;br /&gt;&lt;br /&gt;Also, it is considered a good practice to restore a backup on a test server and a CHECKDB run on the restored database to make sure that the backup is in good shape. This becomes of utmost importance when it is not possible to run a CHECKDB before taking a backup. In SQL Server 2005, you have the option to perform a piece meal restore which would allow you to restore up to the page level in case you have database corruption.&lt;br /&gt;&lt;br /&gt;The following articles could be helpful:&lt;br /&gt;Overview of Restore and Recovery in SQL Server&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms191253.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms191253.aspx&lt;/a&gt;&lt;br /&gt;SQL Server 2005 provides the option of performing an online restore which is available for SQL Server 2005.&lt;br /&gt;&lt;br /&gt;Please refer the following for more information:&lt;br /&gt;Performing Online Restores&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms188671.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms188671.aspx&lt;/a&gt;&lt;br /&gt;Storage Top 10 Best Practices&lt;br /&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/storage-top-10.mspx"&gt;http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/storage-top-10.mspx&lt;/a&gt;&lt;br /&gt;Using Recovery Models&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa173678(SQL.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa173678(SQL.80).aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-3877631869400691359?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/3877631869400691359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=3877631869400691359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/3877631869400691359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/3877631869400691359'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/10/backup-strategy.html' title='Backup Strategy'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-4111911770555813706</id><published>2007-10-03T00:20:00.000-07:00</published><updated>2007-10-03T00:26:51.979-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Best Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><title type='text'>Statistics Update</title><content type='html'>This is an important task in terms of database maintenance. This ensures the statistics are up-to-date which in turn would ensure that the query optimizer doesn’t land up with sub-optimal plans. The two ways to monitor for the need for an update on statistics are:&lt;br /&gt;&lt;br /&gt;1. &lt;strong&gt;STATS_DATE&lt;/strong&gt; function (&lt;a href="http://msdn2.microsoft.com/en-us/library/ms190330.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms190330.aspx&lt;/a&gt;) 2. &lt;strong&gt;rowmodctr&lt;/strong&gt; value in the sysindexes (For SQL 2000) and sys.sysindexes (For SQL 2005) output&lt;br /&gt;&lt;br /&gt;The STATS_DATE function would give you the date when the statistics were updated last. The rowmodctr value would tell you how many changes have taken place in terms of update, inserts and deletes in the data of the column the index is associated with.&lt;br /&gt;&lt;br /&gt;The frequency of statistics update depends on the following:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;1. Do BULK operations happen on the database tables in question?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;2. Is there an off-peak period where a statistics update with full scan can be done?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;3. How often is the data modified in the database tables in question?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Statistics update can be a resource intensive operation depending on the size of the table. If the data in the tables in question change very rarely, then a statistics update with a full scan can be done during a maintenance window. Statistics update is always an ONLINE operation and doesn’t cause the database to be in an OFFLINE mode.&lt;br /&gt;If there are BULK operations happening in a table, then statistics have a tendency to getting skewed after the BULK operation. The best option is do perform a statistics update on this table if this tables is to be used by an application after the bulk operation.&lt;br /&gt;If the database is updated very frequently and the database is very large in size, then it needs to be determined which tables are most frequently updated. Based on this, a statistics updated can be performed for only those tables and a statistics update can be done for the entire database with a lower sampling rate like 20-30% depending on what is suitable. This can be determined by comparing historical data and finding out what kind of sampling rate is suitable for your needs.&lt;br /&gt;Another option is to enable AUTO UPDATE STATISTICS option for the database. But it needs to be monitored whether this is a boon or a bane. AUTO UPDATE STATISTICS can be good when the statistics are relatively updated and it makes sure that the statistics don’t fall too out of place. This feature has a downside when the statistics become out-dated too frequently, then you would have AUTO UPDATE STATISTICS being fired every time and this would cause all cached plans associated with the rows whose statistics have been updated to be recompiled. This can cause a serious bottleneck if there are too many auto update statistics events fired in short time span.&lt;br /&gt;&lt;br /&gt;The following methods can be used to update the statistics:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;1. UPDATE STATISTICS WITH FULLSCAN (or a lower sampling rate) Please refer the following article for further details:&lt;/span&gt; &lt;/strong&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa260645(SQL.80).aspx"&gt;&lt;strong&gt;http://msdn2.microsoft.com/en-us/library/aa260645(SQL.80).aspx&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;2. sp_updatestats&lt;/span&gt; (&lt;/strong&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms173804.aspx"&gt;&lt;strong&gt;http://msdn2.microsoft.com/en-us/library/ms173804.aspx&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;) &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;3. A maintenance plan or SQL Agent job to update the statistics&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The following script for SQL Server 2005 would be helpful in determining how badly affected the statistics are for the index associated with it. The rowmodctr counts the total number of inserted, deleted, or updated rows since the last time statistics were updated for the table.&lt;br /&gt;&lt;br /&gt;&lt;script&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffff00;"&gt;&lt;strong&gt;select rowmodctr,name,object_name(id) as table_name&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffff00;"&gt;&lt;strong&gt;from sys.sysindexes &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffff00;"&gt;&lt;strong&gt;where rowmodctr&gt;1&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#ffff00;"&gt;&lt;strong&gt;order by rowmodctr desc&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;A DBCC DBREINDEX would update the statistics associated with those indexes. But this would not update the AUTO CREATED STATISTICS. The DBCC SHOW_STATISTICS (&lt;a href="http://msdn2.microsoft.com/en-us/library/aa258821(SQL.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa258821(SQL.80).aspx&lt;/a&gt;)  command could also help you to determine the statistics condition for the particular index. The “Row Sampled” and “Rows” if equal would indicate that the sampling is currently 100%.&lt;br /&gt;&lt;br /&gt;&lt;output&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Statistics for INDEX 'pk_customers'.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Updated              Rows                 Rows Sampled         Steps  Density                  Average key length       -------------------- -------------------- -------------------- ------ ------------------------ ------------------------ &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Jun 23 2007  5:03PM  91                   91                   91     1.0989011E-2             10.0&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/output&gt;&lt;br /&gt;&lt;br /&gt;The following articles could be helpful:&lt;br /&gt;&lt;br /&gt;UPDATE STATISTICS&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa260645(SQL.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa260645(SQL.80).aspx&lt;/a&gt;&lt;br /&gt;Statistics used by Query Optimizer in SQL Server 2005&lt;br /&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/qrystats.mspx"&gt;http://www.microsoft.com/technet/prodtechnol/sql/2005/qrystats.mspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-4111911770555813706?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/4111911770555813706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=4111911770555813706' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/4111911770555813706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/4111911770555813706'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/10/statistics-update.html' title='Statistics Update'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-4795850672740034753</id><published>2007-10-03T00:11:00.000-07:00</published><updated>2007-10-03T00:20:04.424-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Best Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><title type='text'>Re-organize data and index pages</title><content type='html'>&lt;p&gt;There are a few ways that this can be achieved:&lt;/p&gt;&lt;p&gt;1. Shrinking the database files (data file or transaction log file)&lt;/p&gt;&lt;p&gt;2. DBCC DBREINDEX (Similar to dropping and re-creating the indexes)&lt;/p&gt;&lt;p&gt;3. DBBC INDEXDEFRAG (De-fragmenting the indexed pages to remove logical scan fragmentation)&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="color:#ff0000;"&gt;Note&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;: It needs to be kept in mind that DBREINDEX is a fully-logged operation and can cause the transaction log to grow by large amounts when the database size is considerably large. So there have been situations when the transaction log has grown out of proportion and filled up the entire disk. If the T-log does grow out of proportion and you do choose to truncate/shrink the file, then please do so after verifying the points below:&lt;/p&gt;&lt;p&gt;1. Transactional replication is not configured for the database&lt;/p&gt;&lt;p&gt;2. Log shipping is not configured for the database&lt;/p&gt;&lt;p&gt;3. Database mirroring is not configured for the database (For SQL 2005 SP1 and above)&lt;/p&gt;&lt;p&gt;4. Any other operations are not being performed which need transactional log consistency in terms of LSN chains&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Online re-indexing is a feature which is available in SQL Server 2005 Enterprise Edition only. Please note that rebuilding the indexes would cause the statistics associated with those indexes to also be updated. This however would not update the AUTO CREATED statistics.&lt;/p&gt;&lt;p&gt;The following articles could be useful:&lt;/p&gt;&lt;p&gt;SET OPTION considerations when running DBCC with indexes on computed columns&lt;/p&gt;&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/301292/"&gt;http://support.microsoft.com/kb/301292/&lt;/a&gt; &lt;/p&gt;&lt;p&gt;DBCC DBREINDEX&lt;/p&gt;&lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms181671.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms181671.aspx&lt;/a&gt; &lt;/p&gt;&lt;p&gt;The DBCC SHOWCONTIG output (&lt;a href="http://msdn2.microsoft.com/en-us/library/aa258803(SQL.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa258803(SQL.80).aspx&lt;/a&gt;) for SQL Server 2000 and 2005 will help you find out the current status of fragmentation for the database. A sample output would look like this:&lt;/p&gt;&lt;p&gt;&lt;output&gt;&lt;/p&gt;&lt;p&gt;DBCC SHOWCONTIG scanning 'Customers' table...&lt;/p&gt;&lt;p&gt;Table: 'Customers' (2073058421); index ID: 1, database ID: 6&lt;/p&gt;&lt;p&gt;TABLE level scan performed.&lt;/p&gt;&lt;p&gt;- Pages Scanned................................: 3&lt;/p&gt;&lt;p&gt;- Extents Scanned..............................: 2&lt;/p&gt;&lt;p&gt;- Extent Switches..............................: 1&lt;/p&gt;&lt;p&gt;- Avg. Pages per Extent........................: 1.5&lt;/p&gt;&lt;p&gt;- Scan Density [Best Count:Actual Count].......: 50.00% [1:2]&lt;/p&gt;&lt;p&gt;- Logical Scan Fragmentation ..................: 0.00%&lt;/p&gt;&lt;p&gt;- Extent Scan Fragmentation ...................: 50.00%&lt;/p&gt;&lt;p&gt;- Avg. Bytes Free per Page.....................: 246.7&lt;/p&gt;&lt;p&gt;- Avg. Page Density (full).....................: 96.95%&lt;/p&gt;&lt;p&gt;&lt;/output&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;The logical scan fragmentation should ideally be below 20% but anything above 40% would mean an INDEXDEFRAG or DBREINDEX is required. The script which is from the same MSDN article can help you run an INDEXDEFRAG or DBREINDEX based on the logical scan fragmentation count.  &lt;/p&gt;&lt;p&gt;A sample script for the same can be found under the topic of "&lt;strong&gt;DBCC SHOWCONTIG&lt;/strong&gt;" in SQL Server Books Online (2000 and 2005)&lt;/p&gt;&lt;p&gt;In SQL Server 2005, the following features may be helpful to you while using the ALTER INDEX command:&lt;/p&gt;&lt;p&gt;&lt;snippet&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;REBUILD [ WITH (&lt;rebuild_index_option&gt; [ ,... n]) ]&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;Specifies the index will be rebuilt using the same columns, index type, uniqueness attribute, and sort order. This clause is equivalent to DBCC DBREINDEX. REBUILD enables a disabled index. Rebuilding a clustered index does not rebuild associated nonclustered indexes unless the keyword ALL is specified. If index options are not specified, the existing index option values stored in sys.indexes are applied. For any index option whose value is not stored in sys.indexes, the default indicated in the argument definition of the option applies.&lt;/p&gt;&lt;p&gt;The options ONLINE and IGNORE_DUP_KEY are not valid when you rebuild an XML index. &lt;/p&gt;&lt;p&gt;If ALL is specified and the underlying table is a heap, the rebuild operation has no affect on the table. Any nonclustered indexes associated with the table are rebuilt. &lt;/p&gt;&lt;p&gt;The rebuild operation can be minimally logged if the database recovery model is set to either bulk-logged or simple.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;WITH ( LOB_COMPACTION = { ON  OFF } )&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;Specifies that all pages that contain large object (LOB) data are compacted. The LOB data types are image, text, ntext, varchar(max), nvarchar(max), varbinary(max), and xml. Compacting this data can improve disk space use. The default is ON.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;ON&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;All pages that contain large object data are compacted.Reorganizing a specified clustered index compacts all LOB columns that are contained in the clustered index. Reorganizing a nonclustered index compacts all LOB columns that are nonkey (included) columns in the index. For more information, see Creating Indexes with Included Columns. When ALL is specified, all indexes that are associated with the specified table or view are reorganized, and all LOB columns that are associated with the clustered index, underlying table, or nonclustered index with included columns are compacted. OFF Pages that contain large object data are not compacted.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;OFF &lt;/strong&gt;&lt;/p&gt;&lt;p&gt;has no affect on a heap.The LOB_COMPACTION clause is ignored if LOB columns are not present.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;REORGANIZE&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;Specifies the index leaf level will be reorganized. This clause is equivalent to DBCC INDEXDEFRAG. ALTER INDEX REORGANIZE statement is always performed online. This means long-term blocking table locks are not held and queries or updates to the underlying table can continue during the ALTER INDEX REORGANIZE transaction. REORGANIZE cannot be specified for a disabled index or an index with ALLOW_PAGE_LOCKS set to OFF.&lt;/p&gt;&lt;p&gt;&lt;/snippet&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Furthermore, the dynamic management view &lt;strong&gt;sys.dm_db_index_physical_stats&lt;/strong&gt; (&lt;a href="http://msdn2.microsoft.com/en-us/library/ms188917.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms188917.aspx&lt;/a&gt;) would help you get statistical information pertaining to indexes on SQL Server 2005. The columns mentioned below in this DMV output could be helpful in analyzing the need for index reorganization.&lt;/p&gt;&lt;p&gt;&lt;snippet&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;avg_fragmentation_in_percent:&lt;/strong&gt; Logical fragmentation for indexes, or extent fragmentation for heaps in the IN_ROW_DATA allocation unit. The value is measured as a percentage and takes into account multiple files. For definitions of logical and extent fragmentation, see Remarks. 0 for LOB_DATA and ROW_OVERFLOW_DATA allocation units.NULL for heaps when mode = SAMPLED.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;fragment_count:&lt;/strong&gt; Number of fragments in the leaf level of an IN_ROW_DATA allocation unit. For more information about fragments, see Remarks.NULL for nonleaf levels of an index, and LOB_DATA or ROW_OVERFLOW_DATA allocation units. NULL for heaps when mode = SAMPLED.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;avg_fragment_size_in_pages:&lt;/strong&gt; Average number of pages in one fragment in the leaf level of an IN_ROW_DATA allocation unit. NULL for nonleaf levels of an index, and LOB_DATA or ROW_OVERFLOW_DATA allocation units. NULL for heaps when mode = SAMPLED.&lt;br /&gt;&lt;/snippet&gt;&lt;/p&gt;&lt;p&gt;The following article could be helpful:Microsoft SQL Server 2000 Index Defragmentation Best Practices&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/ss2kidbp.mspx"&gt;http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/ss2kidbp.mspx&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-4795850672740034753?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/4795850672740034753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=4795850672740034753' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/4795850672740034753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/4795850672740034753'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/10/re-organize-data-and-index-pages.html' title='Re-organize data and index pages'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-575537691770118070</id><published>2007-10-03T00:08:00.000-07:00</published><updated>2007-10-03T00:11:12.455-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Best Practices'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><title type='text'>Database Maintenance Plans</title><content type='html'>&lt;strong&gt;&lt;u&gt;Database Maintenance Plans for SQL Server 2000&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Database Maintenance Plans offer the following features in SQL Server 2000:&lt;br /&gt;&lt;br /&gt;1. Backing up databases&lt;br /&gt;2. Reorganization of indexes and data pages&lt;br /&gt;3. Statistics Update&lt;br /&gt;4. Shrinking the database&lt;br /&gt;5. Database integrity checks&lt;br /&gt;&lt;br /&gt;The above tasks of the maintenance plans would have associated with respective SQL Agent jobs and also these could be scheduled to suit your needs. Furthermore, these jobs could be created manually also without the help of maintenance plans.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Database Maintenance Plans for SQL Server 2005&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;In addition to the above mentioned features, SQL Server 2005 Enterprise Edition provides the option of rebuilding the indexes as an online operation. This makes it possible for the indexes to remain online while a rebuild index task is being performed on the database.&lt;br /&gt;&lt;br /&gt;&lt;snippet&gt;&lt;br /&gt;ONLINE = { ON  OFF }&lt;br /&gt;Specifies whether underlying tables and associated indexes are available for queries and data modification during the index operation. The default is OFF.&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Note&lt;/u&gt;&lt;/strong&gt;: Online index operations are available only in SQL Server 2005 Enterprise Edition.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ON &lt;/strong&gt;&lt;br /&gt;Long-term table locks are not held for the duration of the index operation. During the main phase of the index operation, only an Intent Share (IS) lock is held on the source table. This enables queries or updates to the underlying table and indexes to continue. At the start of the operation, a Shared (S) lock is held on the source object for a very short amount of time. At the end of the operation, for a short time, an S (Shared) lock is acquired on the source if a nonclustered index is being created; or an SCH-M (Schema Modification) lock is acquired when a clustered index is created or dropped online and when a clustered or nonclustered index is being rebuilt. ONLINE cannot be set to ON when an index is being created on a local temporary table.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;OFF &lt;/strong&gt;&lt;br /&gt;Table locks are applied for the duration of the index operation. An offline index operation that creates, rebuilds, or drops a clustered index, or rebuilds or drops a nonclustered index, acquires a Schema modification (Sch-M) lock on the table. This prevents all user access to the underlying table for the duration of the operation. An offline index operation that creates a nonclustered index acquires a Shared (S) lock on the table. This prevents updates to the underlying table but allows read operations, such as SELECT statements.&lt;br /&gt;&lt;/snippet&gt;&lt;br /&gt;&lt;br /&gt;The frequency of these tasks and which tasks are needed need to be performed need to be decided on the following factors:&lt;br /&gt;1. Importance of the database in question&lt;br /&gt;2. Size of the database&lt;br /&gt;3. Maintenance window frequency&lt;br /&gt;4. Load on the server&lt;br /&gt;5. Whether it is an OLTP or OLAP database or both&lt;br /&gt;6. The kind of transactions that take place on the database (Point 5 and 6 would decide how often index reorganization/index rebuild/statistics updates are required and whether a shrink database/file is required)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-575537691770118070?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/575537691770118070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=575537691770118070' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/575537691770118070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/575537691770118070'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/10/database-maintenance-plans.html' title='Database Maintenance Plans'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-4868466720420760579</id><published>2007-09-23T11:09:00.001-07:00</published><updated>2007-11-05T00:06:26.846-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><title type='text'>Stuck Stalled IO Messages</title><content type='html'>&lt;span style="color:#ffffff;"&gt;Sometimes, we see the following messages in the SQL Server 2000 (Service Pack 4 and above) and SQL Server 2005 ERRORLOGs:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="font-family:courier new;"&gt;2004-11-11 00:21:25.26 spid1 SQL Server has encountered 192 occurrence(s) of IO requests taking longer than 15 seconds to complete on file [E:\db_data2.ndf] in database [user_db] (7). The OS file handle is 0x00000000000074D4. The offset of the latest long IO is:&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;0x00000000022000".&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;A given I/O request that becomes stalled or stuck is only reported one time. If the message reports 10 I/Os as stalled, these 10 reports will not occur again. If the next message reports 15 I/Os stalled, it indicates that 15 new I/O requests have become stalled.&lt;br /&gt;&lt;br /&gt;Most of these messages if occur frequently in a SQL Server, then it could be due to one of the following:&lt;br /&gt;&lt;br /&gt;1. There is an underlying hardware issue where in your firmware and disk drivers need to be upgraded. This is mostly done by the Internal Storage Team or preferrably by the Hardware Vendor&lt;br /&gt;2. Or the disks are overwhlemed with the IO Requests being posted on the isks. In this case, you would want to go ahead and make sure that if possible some of the data files and log files would need to be moved to a different drive&lt;br /&gt;3. Or it could be due to bad plans SQL Server ends up performing extra number reads than required&lt;br /&gt;&lt;br /&gt;Also, monitoring the disks using the following counters under performance monitor under the would be helpful (under the performance objects - &lt;strong&gt;Logical Disk&lt;/strong&gt; and &lt;strong&gt;Physical Disk&lt;/strong&gt;):&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Average Disk Queue Length&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;2. Average Disk Secs\Transfer&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;3. Average Disk Secs\ Write&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;4. Average Disk Secs\ Reads&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The last three counters should never show a prolonged peak period which shows values of 30 milli-seconds and above. Please refer my blog article on how to setup a perfmon trace:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://yukonspace.blogspot.com/2007/09/setting-up-perfmon-logs.html"&gt;&lt;span style="color:#ffcc33;"&gt;http://yukonspace.blogspot.com/2007/09/setting-up-perfmon-logs.html&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#ffffff;"&gt;&lt;span style="color:#ffcc33;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Helpful Articles:&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;SQL IO Basics&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqliobasics.mspx"&gt;&lt;span style="color:#ffcc33;"&gt;http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqliobasics.mspx&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#ffffff;"&gt;&lt;span style="color:#ffcc33;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;&lt;strong&gt;SQL Stuck Stalled IO KB Article&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;a onclick="javascript:Track('ctl00_LibFrame_ctl05ctl00_LibFrame_ctl11',this);" href="http://support.microsoft.com/default.aspx?scid=kb;en-us;826433"&gt;&lt;span style="color:#ffcc33;"&gt;826433: PRB: Additional SQL Server Diagnostics Added to Detect Unreported I/O Problems&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#ffffff;"&gt;&lt;span style="color:#ffcc33;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color:#ffffff;"&gt;Stuck Stalled IO Messages:&lt;/span&gt;&lt;/strong&gt; &lt;span style="color:#ffffff;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa175396(SQL.80).aspx"&gt;&lt;span style="color:#ffcc33;"&gt;http://msdn2.microsoft.com/en-us/library/aa175396(SQL.80).aspx&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-4868466720420760579?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/4868466720420760579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=4868466720420760579' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/4868466720420760579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/4868466720420760579'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/09/stuck-stalled-io-messages.html' title='Stuck Stalled IO Messages'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-492638769447102947</id><published>2007-09-16T14:05:00.000-07:00</published><updated>2007-09-25T05:08:19.405-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Setup'/><title type='text'>Troubleshooting SQL Server Setup and Upgrade Failures</title><content type='html'>&lt;span style="color:#ffffff;"&gt;1. The Setup Logs for SQL Server 2005 are created in the following location&lt;br /&gt;&lt;strong&gt;"(system drive)&lt;system&gt;&lt;system&gt;&lt;system&gt;&lt;system&gt;:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG&lt;/strong&gt;"&lt;br /&gt;2. There are two folders underneath this location:&lt;br /&gt;a. &lt;strong&gt;Files&lt;/strong&gt;&lt;br /&gt;b. &lt;strong&gt;Hotfix&lt;/strong&gt;&lt;br /&gt;3. The files under the &lt;strong&gt;Files&lt;/strong&gt; folder are created during the RTM installation of SQL Server 2005&lt;br /&gt;4. The files under the &lt;strong&gt;Hotfix &lt;/strong&gt;folder are created during Service Pack/Hotfix installation&lt;br /&gt;5. For every failed setup of SQL Server 2005, there will be a .CAB (Cabinet file) created under the Files or Hotifx depending on what installation you are performing: RTM/Hotfix/Service Pack installation&lt;br /&gt;6. Also, the LOG folder would have a &lt;strong&gt;summary.txt &lt;/strong&gt;file which would give a brief overview of which component(s) failed to install&lt;br /&gt;7. Using the Error Number and the Component Name, find out if you come back with any helpful links from &lt;/span&gt;&lt;a href="http://support.microsoft.com/"&gt;&lt;span style="color:#ffcc33;"&gt;http://support.microsoft.com/&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#ffffff;"&gt;&lt;br /&gt;8. If you are getting nowhere, then please post a question on the MSDN/TechNet Forums or open up a support incident with Microsoft Product Support Services&lt;br /&gt;&lt;br /&gt;Please refer the following for more details:&lt;br /&gt;&lt;/span&gt;&lt;a href="http://technet.microsoft.com/en-us/library/ms143702.aspx"&gt;&lt;span style="color:#ffcc33;"&gt;http://technet.microsoft.com/en-us/library/ms143702.aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#ffcc33;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms144287.aspx"&gt;&lt;span style="color:#ffcc33;"&gt;http://msdn2.microsoft.com/en-us/library/ms144287.aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#ffffff;"&gt;&lt;span style="color:#ffcc33;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;strong&gt;&lt;u&gt;Setup Logs for SQL Server 2000&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;The setup logs for RTM installations for SQL Server 2000 are installed with the following log &lt;strong&gt;sqlstp.log&lt;/strong&gt; getting created in the %windows% folder.&lt;br /&gt;&lt;br /&gt;The Service Pack setup logs are created having the following filename &lt;strong&gt;sqlsp.log &lt;/strong&gt;under the same location specified above.&lt;br /&gt;&lt;br /&gt;However, the hotfix logs are created with the following prefix "&lt;strong&gt;KB&lt;number&gt;***.log&lt;/strong&gt;"&lt;br /&gt;&lt;br /&gt;The drawback with the SQL setup logs for SQL Server 2000 is that the setup logs get overwritten every time setup is run. But in SQL Server 2005, this is not the case. All the logs are retained in the BOOTSTRAP folder and a new set of log files are created with incremental numbers in the same location.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-492638769447102947?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/492638769447102947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=492638769447102947' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/492638769447102947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/492638769447102947'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/09/troubleshooting-sql-server-setup-and.html' title='Troubleshooting SQL Server Setup and Upgrade Failures'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-9192384799457828864</id><published>2007-09-03T11:20:00.000-07:00</published><updated>2008-05-05T05:38:09.174-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Best Practices'/><title type='text'>Database Integrity Checks</title><content type='html'>Database Integrity Checks Database integrity checks are recommended to ensure that the database consistency is intact and if there is a problem with consistency, then it is reported to the appropriate team(s) so that necessary action can be taken to rectify it. This can be done with the help of Database Maintenance Plans. In the event that a CHECKDB on a database fails, then it needs to be reported by Email(using xp_sendmail or SQL Agent Mail or Database Mail for SQL Server 2005) or events fired in the Operating System Event Logs (if these are monitored regularly) with the help of Operators which can be configured for SQL Server Agent. The xp_sendmail feature is not available for SQL 2005 64-bit versions.&lt;br /&gt;&lt;br /&gt;The frequency of these checks largely depends on the following factors:&lt;br /&gt;1. Importance of the database&lt;br /&gt;2. How often data changes in the database (If a database integrity check fails for a database where data is not modified, then it would be advisable to restore the last known good backup rather than trying to repair the consistency database)&lt;br /&gt;3. The size of the database&lt;br /&gt;4. In the event of consistency checks failing, it needs to be determined which is the most feasible option:&lt;br /&gt;a. Restore the last known good backups in accordance with the recovery model for that database to allow for a minimum amount of data loss&lt;br /&gt;b. Or try and repair the database and falling back on Option (a) only if this fails In case a repair option is suggested in the CHECKDB output, it is important to note that a REPAIR_ALLOW_DATA_LOSS be never performed on the database without understanding its full consequences and consulting Microsoft PSS. In the event, that this route needs to be taken, it is always recommended to fall back on the last known good backups if possible. The REPAIR_FAST and REPAIR_REBUILD repair options can be performed without having any data loss. Please note that these are time consuming operations and in the event of database inconsistency it is not possible for us to predict how long these tasks would run for. Also, the time taken for CHECKDB on a database cannot be predicted. An educated guess can be made to how long it would take by referring to the last durations of the CHECKDB operations on that particular database. For the above mentioned repair options, please refer the following article: &lt;a href="http://msdn2.microsoft.com/en-us/library/aa258278(SQL.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa258278(SQL.80).aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;REPAIR_ALLOW_DATA_LOSS&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;Performs all repairs done by REPAIR_REBUILD and includes allocation and deallocation of rows and pages for correcting allocation errors, structural row or page errors, and deletion of corrupted text objects. These repairs can result in some data loss. The repair may be done under a user transaction to allow the user to roll back the changes made. If repairs are rolled back, the database will still contain errors and should be restored from a backup. If a repair for an error has been skipped due to the provided repair level, any repairs that depend on the repair are also skipped. After repairs are completed, back up the database.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;REPAIR_FAST&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;Performs minor, nontime-consuming repair actions such as repairing extra keys in nonclustered indexes. These repairs can be done quickly and without risk of data loss.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;REPAIR_REBUILD &lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;Performs all repairs done by REPAIR_FAST and includes time-consuming repairs such as rebuilding indexes. These repairs can be done without risk of data loss. In case of SQL Server 2005, you have the option of checking the suspect_pages in the MSDB database to find out the affected pages.&lt;br /&gt;&lt;br /&gt;Please refer the following articles for more detailed information:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Suspect_pages table (SQL 2005) &lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms174425.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms174425.aspx&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Understanding and managing the suspect_pages table &lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms191301.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms191301.aspx&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Designing a Backup and Restore Strategy &lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_bkprst_63eh.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_bkprst_63eh.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In the event, that only a few pages have a problem, then for SQL Server 2005 a page level restore can be performed. Online page restore operation is a feature available in SQL Server 2005 Enterprise Edition but all other Editions of SQL Server 2005 support offline page level restores. The page level restores are done using the NORECOVERY option for that database. Then a backup of the current transaction log is taken and applied to the database with the RECOVERY option. This feature is applicable to databases in FULL or BULK-LOGGED recovery models.&lt;br /&gt;&lt;br /&gt;For performing page level restores, please refer the following article: &lt;a href="http://msdn2.microsoft.com/en-us/library/ms175168.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms175168.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It is highly important that a disaster recovery plan is in place to ensure the following:&lt;br /&gt;· A plan to acquire hardware in the event of hardware failure&lt;br /&gt;· A communication plan.&lt;br /&gt;· A list of people to be contacted in the event of a disaster.&lt;br /&gt;· Instructions for contacting the people involved in the response to the disaster.&lt;br /&gt;· Information on who owns the administration of the plan.&lt;br /&gt;· A checklist of required tasks for each recovery scenario. To help you review how disaster recovery progressed, initial each task as it is completed, and indicate the time of completion on the checklist.&lt;br /&gt;&lt;br /&gt;In conclusion, if the database is of a considerably large size, then an integrity check needs to be scheduled during a window when the load on the server is at a minimum. The definition of minimum here refers to a load which is lesser than the normal workload on the server. If the database sizes are quite small, then daily integrity checks on the database would be the order of the day.&lt;br /&gt;&lt;br /&gt;It is recommended that DBCC CHECKDB be run during hours when the load is light on the server. If DBCC CHECKDB is run during heavy peak usage time, expect a performance hit on the transaction throughput as well as DBCC CHECKDB completion time.&lt;br /&gt;&lt;br /&gt;Recommendations for Good DBCC Performance&lt;br /&gt;· Run CHECKDB when the system usage is low.&lt;br /&gt;· Be sure that you are not performing other disk I/O operations, such as disk backups.&lt;br /&gt;· Place tempdb on a separate disk system or a fast disk subsystem.&lt;br /&gt;· Allow enough room for tempdb to expand on the drive. Use DBCC with ESTIMATE ONLY to estimate how much space will be needed for tempdb.&lt;br /&gt;· Avoid running CPU-intensive queries or batch jobs.&lt;br /&gt;· Reduce active transactions while a DBCC command is running.&lt;br /&gt;· Use the NO_INFOMSGS option to reduce processing and tempdb usage significantly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-9192384799457828864?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/9192384799457828864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=9192384799457828864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/9192384799457828864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/9192384799457828864'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/09/database-integrity-checks.html' title='Database Integrity Checks'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-1349009549418391467</id><published>2007-09-03T00:30:00.000-07:00</published><updated>2008-05-11T08:02:44.357-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><title type='text'>Server Side Profiler Traces</title><content type='html'>&lt;p&gt;When we want to monitor the kind of queries that hit across your SQL Server, most of us set up a Profiler Trace. But what most of us are not aware of is that there are two ways to setup a Profiler trace: &lt;/p&gt;&lt;p&gt;1. A GUI based Profiler trace &lt;/p&gt;&lt;p&gt;2. A Server side Profiler trace &lt;/p&gt;&lt;p&gt;A GUI based profiler trace causes a performance impact on the server as high as 25% depending on the events being captured. So if you are monitoring SQL Server with the help of profiler traces on a long term basis then it would always be advisable to setup a server side profiler trace. &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;em&gt;Steps to setup a Server side Profiler Trace&lt;br /&gt;&lt;/em&gt;&lt;/u&gt;&lt;/strong&gt;1. Create a Profiler Trace using the GUI and then script out the trace to a file called say sql_trace.sql. Open the SQL_TRACE.SQL file in query analyzer/management studio query window and make the following changes &lt;/p&gt;&lt;p&gt;2. In the line “&lt;strong&gt;&lt;em&gt;exec @rc = sp_trace_create @TraceID output, 2, N'', @maxfilesize, NULL&lt;/em&gt;&lt;/strong&gt;”, change the location where you want to store the trace file. &lt;/p&gt;&lt;p&gt;3. Make sure &lt;strong&gt;&lt;em&gt;@maxfilesize&lt;/em&gt;&lt;/strong&gt; parameter is set to 350 or a desirable size. (This makes sure that you roll over to the next trace file once the current size hits 350 MB)&lt;/p&gt;&lt;p&gt;4. Execute the script to create the trace. This will generate a Trace ID. The trace information can be obtained from &lt;a href="http://msdn2.microsoft.com/en-US/library/ms173875.aspx"&gt;&lt;strong&gt;&lt;em&gt;fn_trace_getinfo&lt;/em&gt;&lt;/strong&gt; &lt;/a&gt;function &lt;/p&gt;&lt;p&gt;5. To stop the trace, use &lt;strong&gt;&lt;em&gt;sp_trace_setstatus &lt;trace&gt;,0&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;6. To close the specified trace and delete its definition from the server us &lt;strong&gt;&lt;em&gt;sp_trace_setstatus &lt;trace&gt;,2 &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Useful Articles&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/283790/"&gt;283790&lt;/a&gt; INF: How to Create a SQL Server 2000 Trace&lt;/p&gt;&lt;p&gt;&lt;a class="KBlink" href="http://support.microsoft.com/kb/283786/"&gt;283786&lt;/a&gt; How to monitor SQL Server 2000 traces &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-1349009549418391467?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/1349009549418391467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=1349009549418391467' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/1349009549418391467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/1349009549418391467'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/09/server-side-profiler-traces.html' title='Server Side Profiler Traces'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-6332604762720592262</id><published>2007-09-03T00:22:00.000-07:00</published><updated>2008-05-05T05:47:25.230-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Monitoring'/><title type='text'>Setting Up PerfMon Logs</title><content type='html'>&lt;span style="font-family:arial;"&gt;One of best ways to monitor your system performance is to use Windows Performance Monitor Logs and Alerts. These logs can be used to capture historical information about different performance objects and would help us understand what was happening on the system at that point of time. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="font-family:arial;"&gt;Steps to setup a Perfmon Log&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family:arial;color:#ffffff;"&gt;This can be done by opening up Perfmon:&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;color:#ffffff;"&gt;Click on “Performance Logs and Alerts” &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;color:#ffffff;"&gt;Click on “Counter Logs” &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;color:#ffffff;"&gt;Right click on the same and click on “New Log Settings” &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;color:#ffffff;"&gt;Give the log a name &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;color:#ffffff;"&gt;Click on “Add Objects” and add all the objects &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;color:#ffffff;"&gt;Click on the “Log Files” tab &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;color:#ffffff;"&gt;You can change the log file location by clicking on the “Configure” button &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;color:#ffffff;"&gt;Click on the “Schedule” tab and then for “Start Log” and “Stop Log”, select the “Manually (Using the Shortcut menu)” option &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;color:#ffffff;"&gt;Click on the “OK” button to create the log &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;color:#ffffff;"&gt;Then right-click on the Log and click on “Start” to begin the logging &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="color:#ffffff;"&gt;Right-click on the log file and click on “Stop” to end the logging&lt;br /&gt;&lt;/span&gt;There is hardly any performance impact in collecting perfmon logs on any server &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-6332604762720592262?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/6332604762720592262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/6332604762720592262'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/09/setting-up-perfmon-logs.html' title='Setting Up PerfMon Logs'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8312343003944292169.post-7425129732983688849</id><published>2007-08-05T01:18:00.000-07:00</published><updated>2007-10-12T08:03:15.320-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Troubleshooting'/><title type='text'>Blog Introduction</title><content type='html'>Hello Everyone,&lt;br /&gt;&lt;br /&gt;It's been a while that I have been working with SQL Server. One of biggest challenge that I have seen people face is with troubleshooting is that people are at a loss to where to look and what to collect.&lt;br /&gt;&lt;br /&gt;If you know what data to collect and how to collect, that's half your solution. Two reasons for this:&lt;br /&gt;&lt;br /&gt;1. Too much unnecessary information can divert you in the wrong direction&lt;br /&gt;2. Troubleshooting becomes much simpler with relevant data collection&lt;br /&gt;&lt;br /&gt;So, in this blog we are going to cover two aspects of maintaining SQL Serves:&lt;br /&gt;&lt;br /&gt;1. Pro-active work which will help us minimize points of failure and narrow down to the root if a problem does occur&lt;br /&gt;2. Re-active work which involves having the right approach and action plan ready in case a problem does appear&lt;br /&gt;&lt;br /&gt;All comments are most welcome.&lt;br /&gt;&lt;br /&gt;Two of the best resources for Troubleshooting SQL Server Issues is:&lt;br /&gt;&lt;br /&gt;1. Technet Forums&lt;br /&gt;2. SQL 2005 Practical Troubleshooting: The Database Engine by Ken Henderson (This is a must read. This is same author for Guru's Guide to SQL Server. This book has inputs from the DEV team for SQL Server)&lt;br /&gt;&lt;a href="http://www.khen.com/2007/06/sql-server-2005-practical.html"&gt;http://www.khen.com/2007/06/sql-server-2005-practical.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/SQL-Server-2005-Practical-Troubleshooting/dp/0321447743"&gt;http://www.amazon.com/SQL-Server-2005-Practical-Troubleshooting/dp/0321447743&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8312343003944292169-7425129732983688849?l=yukonspace.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yukonspace.blogspot.com/feeds/7425129732983688849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8312343003944292169&amp;postID=7425129732983688849' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/7425129732983688849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8312343003944292169/posts/default/7425129732983688849'/><link rel='alternate' type='text/html' href='http://yukonspace.blogspot.com/2007/08/blog-introduction.html' title='Blog Introduction'/><author><name>Amit Banerjee</name><uri>http://www.blogger.com/profile/10519712088557980605</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
