Search results matching tags 'Indexes' and 'productivity'http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&tag=Indexes,productivity&orTags=0Search results matching tags 'Indexes' and 'productivity'en-USCommunityServer 2.1 SP2 (Build: 61129.1)March Update to Rules-Driven Maintenancehttp://sqlblog.com/blogs/merrill_aldrich/archive/2013/03/11/march-update-to-rules-driven-maintenance.aspxTue, 12 Mar 2013 02:56:00 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:48191merrillaldrich<p>This month I have a minor update to the Rules-Driven Maintenance code I originally <a href="http://sqlblog.com/blogs/merrill_aldrich/archive/2012/08/01/rules-driven-maintenance.aspx" mce_href="http://sqlblog.com/blogs/merrill_aldrich/archive/2012/08/01/rules-driven-maintenance.aspx">posted</a> back in August 2012. This update has just two enhancements, but they are nice ones, I think:</p> <ol> <li>Much improved handling for instances that use database snapshots.</li> <li>Ability to do intra-day differential backups purely by setting maintenance times and limits in the policy table.</li> </ol> <p>The code posted here is cumulative, and replaces entirely the original code, but please refer back to <a href="http://sqlblog.com/blogs/merrill_aldrich/archive/2012/08/01/rules-driven-maintenance.aspx" mce_href="http://sqlblog.com/blogs/merrill_aldrich/archive/2012/08/01/rules-driven-maintenance.aspx">that original blog post</a> for description, instructions and details. This update can be installed right over an existing deployment, or be installed all by itself as a complete solution but – as always – please test and be cautious.</p> <p>Enjoy!</p><p><strong>Note:</strong> I've posted <strong>updates</strong> to this solution. Please get the <a href="http://sqlblog.com/blogs/merrill_aldrich/archive/2013/10/09/october-update-to-rules-driven-maintenance.aspx" mce_href="http://sqlblog.com/blogs/merrill_aldrich/archive/2013/10/09/october-update-to-rules-driven-maintenance.aspx">latest version here</a>.</p>Update to Rules-Driven Maintenancehttp://sqlblog.com/blogs/merrill_aldrich/archive/2013/01/16/update-to-rules-driven-maintenance.aspxWed, 16 Jan 2013 18:34:00 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:47183merrillaldrich<p>Back in August I <a href="http://sqlblog.com/blogs/merrill_aldrich/archive/2012/08/01/rules-driven-maintenance.aspx" mce_href="http://sqlblog.com/blogs/merrill_aldrich/archive/2012/08/01/rules-driven-maintenance.aspx">posted</a> a first version of a rules-driven solution for backups, index and statistics maintenance and integrity checks. The system in general has been working well, and has saved my team a huge amount of time and effort. We are coming to the anniversary of its use in production soon.</p> <p>Today I offer an update that contains a few enhancements, performance improvements and a bug fix.</p> <p>To recap, this is a system or framework to manage many small databases across many instances on many servers in a policy-based/automated way. The details about how to deploy and how to use the system are in the <a href="http://sqlblog.com/blogs/merrill_aldrich/archive/2012/08/01/rules-driven-maintenance.aspx" mce_href="http://sqlblog.com/blogs/merrill_aldrich/archive/2012/08/01/rules-driven-maintenance.aspx">original post</a>, but at a high level:</p> <ol> <li>First deploy the code across a collection of servers using the included PowerShell script <b>DeployMaintenance.ps1</b>. That will create an administrative database on every instance (or use one that you provide) and populate it with the required tables, procedures, etc. The deployment script will also make a handful of SQL Agent jobs that handle all the maintenance on all the databases.</li> <li>Visit the instances. If there is maintenance already in place, disable or remove it so as not to perform this work twice. If necessary, change or override the default preferences for this solution in the admin database for each type of maintenance. This includes the time of maintenance windows, whether to use features like differential backups or Litespeed, whether there are databases that should be treated as exceptions, with different settings, etc.</li> <li>Enable the new policy jobs in SQL Agent. </li> <li>Monitor to make sure things are running smoothly.</li> </ol> <p>The theory behind this project is to save work configuring servers (efficiency), to ensure that the maintenance is in fact deployed and working for ALL databases in the environment (quality), to ensure that it works in a truly consistent way everywhere (consistency), and to make it so that the servers don’t have to be touched by a DBA when changes happen, such as adding or dropping databases (resiliency).</p> <h4>Changes</h4> <p>The updates in this 1.1 version include</p> <ul> <li>Better reporting of errors. The jobs now write log files to the default error log location for SQL Server.</li> <li>Better recovery from errors. The jobs in some cases continue on error – for example, one failed backup will not stop the backup job and leave other databases without backups.</li> <li>Performance enhancements for examining backup history and system counters (mainly % log used).</li> <li>One bug fix for the log backup logic on a server that uses both log shipping and Litespeed.</li> </ul> <h4>Disclaimers</h4> <p>The code for the system is posted here, and you are welcome to download it and try it out. Please note that this is not a commercial solution, and that while you may test or deploy this, you do so at your sole risk. Edits to the code almost certainly will be required for your environment. Please read, understand and test the code thoroughly before you even <i>imagine</i> using this in production. I do not want to cause you or your employer any pain. License for using this solution is GPL 3.0: <a href="http://opensource.org/licenses/GPL-3.0" mce_href="http://opensource.org/licenses/GPL-3.0">http://opensource.org/licenses/GPL-3.0</a>. You may use and modify this code, but not sell it.</p> <p>This has been run on SQL Server versions from 2005 to 2008 R2. It probably works on 2012, but I have not tested it thoroughly.</p> <p>I run only case-insensitive collation; if you are on a case-sensitive system, then you have my sympathy, and you might have to edit a few things to make this work.</p> <p>There is coverage for Quest Litespeed backups in the solution; other third-party backup products could be incorporated easily, but have not been. It should be possible to follow the pattern used to handle Litespeed and extend it to any other third-party stored procedures.</p> <p>If you haven’t done index maintenance for a while, and you flip this solution on <b>you might blow up your transaction log</b>. Be sure that you have plenty of log space and plenty of log backup space, and watch the process the first few runs. This is especially true if the combination of <b>Standard Edition of SQL Server</b> and the preference for <b>Online</b> index maintenance applies in your environment, because the maintenance process will perform index maintenance using reorganize (defrag), which produces a lot of log.</p> <p>Lastly, this is <b>a solution for the type of environment that has many small databases</b>, not the type with a few big, performance intensive databases. Databases that are large and require detailed attention may not be suitable for a one-size-fits-all solution like this.</p><p>I've posted <strong>updates</strong> to this solution. Please get the <a href="http://sqlblog.com/blogs/merrill_aldrich/archive/2013/10/09/october-update-to-rules-driven-maintenance.aspx" mce_href="http://sqlblog.com/blogs/merrill_aldrich/archive/2013/10/09/october-update-to-rules-driven-maintenance.aspx">latest version here</a>.</p>