Exchange 2010 SP1: Database Integrity checking


Since the earliest versions of Exchange Server, the Information Store Integrity Checker (ISInteg) has offered Exchange administrators a way to check mailbox and public folder database integrity. ISInteg checks and fixes Exchange database errors that may prevent the database from mounting, prevent the user from logging on or from receiving, opening or deleting email. Curious to know what changes are coming to ISInteg in Exchange 2010 SP1? Let’s take a look.

In Exchange 2010 SP1, ISInteg is no longer a standalone program.

The functionality provided by the ISInteg tool has been rolled into two new Exchange Management Shell cmdlets:

  • New-MailboxRepairRequest
  • New-PublicFolderDatabaseRepairRequest

Note: Like other Shell cmdlets, these are subject to Role-Based Access Control (RBAC) scoping restrictions. For details, see Understanding Management Role Scopes.

Cool Features

These new ISInteg cmdlets come with some cool new functionality!

  • The cmdlets work with the database mounted. It’s no longer required to unmount the database to perform an integrity check or fix database errors.
  • You can repair logical corruption at the mailbox level.
  • You can fix corrupt search folders.
  • You can fix the Provisional Fid.
  • You can fix Aggregate Counts.

ISInteg can now work at the database or mailbox level

How does it do that? Well, the new schema in Exchange 2010 effectively partitions the database by mailbox. So the top problems fixed by ISInteg are now mostly limited to the affected mailboxes only. Previous versions of ISInteg required the database to be offline while validation and fixing are in progress. In Exchange 2010 SP1, the ability to do these checks at the mailbox level removes the need to dismount the database. It is actually required to have ISInteg operate against an online database!

New-MailboxRepairRequest

The New-MailboxRepairRequest cmdlet detects and fixes the following types of mailbox corruptions:

  • Search folder corruptions (SearchFolder): Repair tasks now look for all folders named in ptagSearchBacklinks, ptagSearchFIDs, and ptagRecursiveSearchFIDs and verifies that each folder exists. If the folder no longer exists, then it will remove that folder from the list.
  • Aggregate counts on folders that aren’t reflecting correct values (AggregateCounts): Repair tasks tally all messages in a folder and keep a running total of various counts and sizes. Once the iteration is complete, it will verify the computed counts against the persisted counts on the Folders table record for the folder. If there is a discrepancy, it will update the persisted counts to reflect the computed counts.
  • Views on folders that aren’t returning correct contents (FolderView): Repair tasks will iterate over all views for a folder and for each one, bring the view fully up to date and then reconstruct a temp copy. If there is a discrepancy between the existing view and the contents of the temp table, it will delete the view so it can be rebuilt from scratch the next time it is requested.
  • Provisioned folders that are incorrectly pointing into unprovisioned parent folders (ProvisionedFolder): Repair tasks can fix Provisioned folders incorrectly pointing into unprovisioned parents or vice versa.

Syntax

New-MailboxRepairRequest -Mailbox <MailboxIdParameter> -CorruptionType <MailboxStoreCorruptionType[]> [-Archive <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-DetectOnly <SwitchParameter>] [-DomainController <Fqdn>] [-WhatIf [<SwitchParameter>]]

New-MailboxRepairRequest -Database <DatabaseIdParameter> -CorruptionType <MailboxStoreCorruptionType[]> [-Confirm [<SwitchParameter>]] [-DetectOnly <SwitchParameter>] [-DomainController <Fqdn>] [-WhatIf [<SwitchParameter>]]

Parameters

  • Database, Mailbox and Archive: You can repair an entire mailbox database or a specified mailbox by specifying either the Database or the Mailbox parameter. You can’t use both. To repair the archive mailbox for the specified user, use the Archive switch.
  • CorruptionType: (at least 1 required) you are already familiar with, we discussed them above:
    • SearchFolder
    • AggregateCounts
    • ProvisionedFolder
    • FolderView

    You can run a repair task with multiple parameters if you separate them with a comma (as shown in the Examples section below).

  • DetectOnly: (Optional) The DetectOnly switch secifies that you want this command to report errors, but not fix them. You don’t have to specify a value with this switch.
  • Other Optional Parameters: This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer and OutVariable. For more information, type “get-help about_commonparameters”.
  • New-PublicFolderDatabaseRepairRequest

    The New-PublicFolderDatabaseRepairRequest cmdlet detects and fixes Public Folder replication state problems.

    Syntax

    New-PublicFolderDatabaseRepairRequest -Database <DatabaseIdParameter> -CorruptionType <PublicFolderDatabaseCorruptionType[]> [-Confirm [<SwitchParameter>]] [-DetectOnly <SwitchParameter>] [-DomainController <Fqdn>] [-WhatIf [<SwitchParameter>]]

    Parameters

    • Database: (required) Specifies the Public Folder database on which you will run this command. You can use one of the following values:
      • GUID of the database
      • Database name
    • CorruptionType: (required) Pretty easy, there’s only one value.
      • ReplState
    • DetectOnly: (optional) Specifies that you want this command to report errors, but not fix them. You don’t have to specify a value with this parameter.
    • Other Optional Parameters: This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer and OutVariable. For more information, type “get-help about_commonparameters”.

    Examples

    New-MailboxRepairRequest -Mailbox administrator@contoso.com -CorruptionType SearchFolder, AggregateCounts, ProvisionedFolder, FolderView

    New-MailboxRepairRequest -Mailbox administrator -CorruptionType SearchFolder, AggregateCounts, ProvisionedFolder, FolderView -WhatIf

    New-PublicFolderDatabaseRepairRequest -Database PFD01 -CorruptionType ReplState -DetectOnly

    Some additional examples are provided in the cmdlet help. You can retrieve them using the following commands, or refer to New-MailboxRepairRequest and New-PublicFolderDatabaseRepairRequest cmdlet reference:

    Get-help New-MailboxRepairRequest -examples
    Get-help New-PublicFolderDatabaseRepairRequest -examples

    I recommend that you get to know the cmdlets by using the cmdlet reference docs, or by using the following commands to retrieve detailed help from the shell:

    Get-help New-MailboxRepairRequest -detailed (or -full)
    Get-help New-PublicFolderDatabaseRepairRequest -detailed (or -full)

    Event Reporting

    After submitting the Mailbox or Public Folder repair request, you can monitor its progress with the Event Viewer. That’s right, no more text logs to weed through. The events are logged under the MSExchangeIS Mailbox Store source.

    The following event IDs will be logged for repair requests:

    • 10047 A mailbox-level repair request started
    • 10064 A Public Folder repair request started
    • 10048 The repair request successfully completed.
    • 10050 The mailbox repair request task skipped a mailbox .
    • 10059 A database-level repair request started.
    • 10062 Corruption was detected.


    Figure 1: Mailbox or Public Folder database repair request events are logged in the Application event log

    Note: the repair events will only show up on the mailbox server where the mailbox or Public Folder is located.

    This is very important to remember. Just because you fired off a repair task on a mailbox server does not mean the events will show up on that server. The repair task will be run on the database where the mailbox itself is, and the events will be in the event log on that mailbox server and that server alone.

    Things to remember:

    • Only 1 active repair task is permitted to be running per server if the active task is a database level repair.
    • Only 100 mailbox level active repair tasks are permitted to be running at once per server.
    • There is no -Server parameter to do all databases or mailboxes on a server.
    • The repair task dies on database dismount or store stop/crash.
    • The only way to stop a repair is to stop the store or dismount the database.
    • Mailbox access will be disrupted for the mailbox that is being repaired.
    • Repair for a mailbox will skip a mailbox if it has been quarantined.
    • Repair will cause a move-mailbox operation to be delayed until the repair is completed.

    Steve Bryant

    Comments (18)
    1. mfmanning says:

      Very cool, thanks for this guys!

    2. stouttiger says:

      cool with the event ID’s especially 10062 and 10048 as this brings up possibilities for automating mailbox repairs during off hours with SCOM.  will there be option for more verbose logginng on this matter?

    3. mpbk says:

      In Ex2010 SP0, when I fire off the built-in Windows Backup, it claims to do some sort of integrity checking on the database that can take quite a bit of time.  It does this without taking the database offline.  How is this different from this built-in integrity checking of SP1?

    4. SamYeager says:

      Is there a way to use the request id displayed in event 10048 to determine what was the original repair request?

    5. Sunder says:

      Amazing improvements…Thanks Steve for this wonderful article.

    6. Dan Sheehan says:

      Wow… this is truly one of the coolest by-products of the database schema changes. Thanks for posting tid-bits like this, please keep them coming!

    7. Art Braune says:

      I keep seeing posts about Exchange 2010 SP1 – but do not see a release date? Hmmm…

    8. Martijn says:

      Very nice but:

      * how slow/fast is a mailbox repair on a 1, 5 or 10 GB mailbox?

      * ‘Mailbox access will be disrupted for the mailbox that is being repaired.’: should a user close OL client or OL client only temporary locked out?

    9. Dan says:

      as Art said I need a release data for sp1

    10. robk says:

      Very nice but…it would be really good if you could keep some consistency when it comes to naming conventions

      Why skipping database part from New-MailboxRepairRequest, but keeping it for New-PublicFolderDatabaseRepairRequest?

      this would look much more better and easier to remember

      Get-help New-MailboxDatabaseRepairRequest -examples

      Get-help New-PublicFolderDatabaseRepairRequest -examples

      just my 2 cents

    11. Frank T says:

      I’d say it’s New-MailboxRepairRequest because it can fix individual mailboxes… which as the the blog post states, should be the much more common usage than ever having to repair an entire database (who does that nowadays anyway… people with no backups?)

    12. Steve Bryant says:

      Exchange 2010 SP1 has just been released to the web.  Since it just went live you may want to give it some time if you have trouble connecting.

      http://www.microsoft.com/downloads/details.aspx?FamilyID=50b32685-4356-49cc-8b37-d9c9d4ea3f5b&displaylang=en

    13. data recovery says:

      How to fix corrupt search folders?

    14. ahQN says:

      thats very cool….

      As you mentioned its only work with 100 mailbox on one server.

      If we have more than 100 mailbox on one server?

    15. LesHill says:

      This is really cool change MS. When I think about the long nights I’ve spent witn EX2K3 repairing database issue this just warms my heart.  The very fact I can leave the other users online is brill so well done.

    16. promomfg says:

      @Steve Bryant It really got some trouble on that. Some register parameter should be changed also. But I forgot the detail.

      Let me google first…

    17. mark7568 says:

      oh i see..

    18. hawaiiisit2 says:

      ahhH! nice

    Comments are closed.