Minion Reindex 1.2:
Quick Start


Minion Reindex by MidnightDBA is a stand-alone index maintenance solution that can be deployed on any number of servers, for free. Minion Reindex is comprised of SQL Server tables, stored procedures, and SQL Agent jobs. For links to downloads, tutorials and articles, see www.MinionWare.net.


This document explains Minion Reindex by MidnightDBA ("Minion Reindex"), its uses, features, moving parts, and examples.

For video tutorials on Minion Reindex, see the Minion Backup playlist on our YouTube channel: https://www.youtube.com/user/MidnightDBA 


Minion Reindex is one module of 
the Minion suite of products.


 

Quick Start

To install, download Minion Reindex from www.MinionWare.net/Reindex and run it on your target server. For simplicity, this Quick Start guide assumes that you have installed Minion Reindex on one server, named "YourServer".


Note: You can also use the PowerShell script provided with the download to install Minion Reindex on dozens or hundreds of servers at once, just as easily as you would install it on a single instance.

System requirements: 


  • SQL Server 2005 or above.
  • The sp_configure setting xp_cmdshell must be enabled*.
  • PowerShell 2.0 or above; execution policy set to RemoteSigned.


Once MinionReindexing.sql has been run, nothing else is required. From here on, Minion Reindex will run nightly to defragment all non-TempDB databases. The reindexing routine automatically handles databases as they are created, dropped, or renamed. 


* xp_cmdshell can be turned on and off with the database
PreCode / PostCode options, to help comply with security policies.

For more information on xp_cmdshell, see "Security Theater"
on 
www.MidnightDBA.com/DBARant.


Change Schedules


Optionally, you can change the reindexing schedules:


  1. View jobs: Connect to "YourServer" and expand the SQL Agent node. You’ll see two new jobs: 
  • MinionReindexDBs-All-All – Runs once weekly – Fridays at 3:00 AM - to thoroughly defragment indexes (rebuild).
  • MinionReindexDBs-All-REORG – Runs Daily – 3:00 AM except for Friday – to complete lightweight defragmenting (reorganize).
    1. Alter schedules: Edit the two job schedules to fit your company’s needs. 


Change Default Settings


Minion Reindex stores default settings for the entire instance in a single row (where DBName=’MinionDefault’) in the Minion.IndexSettingsDB table.

Warning: Do not delete the MinionDefault row from Minion.IndexSettingsDB!

To change the default settings, run an update statement on the MinionDefault row in Minion.IndexSettingsDB. For example:


UPDATE [Minion].[IndexSettingsDB]
   SET [Exclude] = 0
      ,[ReindexGroupOrder] = 0
      ,[ReindexOrder] = 0
      ,[ReorgThreshold] = 10
      ,[RebuildThreshold] = 20
      ,[FILLFACTORopt] = 85
      ,[PadIndex] = 'ON'
      ,[SortInTempDB] = 'OFF'
      ,[DataCompression] = NULL
      ,[GetRowCT] = 1
      ,[GetPostFragLevel] = 1
      ,[UpdateStatsOnDefrag] = 1
      ,[LogIndexPhysicalStats] = 0
      ,[IndexScanMode] = 'Limited'
      ,[LogProgress] = 1
      ,[LogRetDays] = 60
      ,[LogLoc] = 'Local'
      ,[MinionTriggerPath] = '\\minioncon\c$'
      ,[IncludeUsageDetails] = 1
 WHERE [DBName] = 'MinionDefault';



Warning: 

Choose your settings wisely; these settings can have a massive impact on your system. For example, if you have a 500 GB database with fill factor set to 100, changing fill factor to 85 could increase the size of your database massively on the next reindex.

For more information on these settings, see the "Minion.IndexSettingsDB" section.

For instructions on setting database-level or table-level settings, see the section titled "How To: Configure settings for a single database".