Minion.DBMaintRegexLookup


Allows you to exclude databases from index maintenance (or all maintenance), based off of regular expressions. 

Name

Type

Description

Action

varchar

Action to perform with this regular expression.

Valid inputs: 


EXCLUDE

MaintType

varchar

Maintenance type to which this applies.

Valid inputs: 

ALL


REINDEX

Regex

nvarchar

Regular expression to match a database name, or set of database names.

Discussion

This table is meant to be inclusive for all maintenance operations. (Minion will, in future, be more than just an excellent reindex solution.)  Therefore, the MaintType column is important.  By specifying ‘All’ you ensure that all databases that satisfy the regex expression are excluded from all maintenance operations (Reindex, Backup, CheckDB, Update Statistics, etc.).  This is an excellent way to shotgun groups of databases and exclude them from all maintenance.  However, if you want to only exclude the databases from reindexing, set MaintType to ‘Reindex’.


Example 1

To exclude any database named "Minion" followed by one or more characters, from ALL database maintenance routines, insert the following row: 

INSERT  INTO Minion.DBMaintRegexLookup
    ( [Action], MaintType, RegEx )
VALUES  ( 'Exclude', 'All', 'Minion\w+' );


Example 2

To exclude any database named "ADB" followed by one or more decimal digits, from index maintenance, insert the following row: 

INSERT  INTO Minion.DBMaintRegexLookup
    ( [Action], MaintType, RegEx )
VALUES  ( 'Exclude', 'Reindex', 'ADB\d+' );


These databases will still be processed in the backups, CheckDB, and other maintenance operations, if those Minion modules are running on your instance.