Exchange 2010 – Cannot remove ‘defunct’ database

Removing databases in Exchange Server 2010 is usually a simple process, even with DAG replication involved. However, things get a bit complicated when the database cannot be mounted on a server and Database Portability is employed. This scenario would play out in the case of a defunct DAG node that cannot be revived quickly and the second DAG copy just won’t mount.

For this scenario we have an old database that references a defunct server as well as a live server for it’s database copies. However, you are unable to remove this database.

Normally the steps to remove a defunct database are as follows:

  1. Remove DAG database copies on servers that have a ‘Healthy’ copy of the database.
  2. Move or remove any mailboxes that may be present to another database
  3. Move or remove any archive mailboxes to another database
    1. Get a list of mailboxes with archives
    2. Move them to another mailbox database (rehoming)


However this command does not work for archive mailboxes. Since we know that the old database is defunct we need to simply redirect the user attribute for the Personal Archive to the new location for the archive:

The attribute msExchArchiveDatabaseLink needs to be changed to the correct database. The short name of the old database was Database02 and the new Database02-New. You should only need to change that part of the attribute.

4) Move arbitration mailboxes to another database
5) Move any search mailboxes to another database
6) Remove the database from Exchange
7) Delete any files related to the database to free up disk space

What if, after you’ve performed Steps 1 – 5 and Step 6 fails. The error message is the same if you fail to remove the arbitration or search mailboxes. What could be causing this? Take a look at any recent Move Requests to new databases, which would happen if you’ve moved the mailboxes off to delete the mailbox database.

Key here is the TargetDatabase. If there is a move that matches the database you want to delete, you will be unable to delete the mailbox.

So the logical step would be to delete the move request. What if that failed?

If we dig into the user involved we can see the attributes that are set that show that a mailbox move request is associated with the user account:

As you can see there are several attributes that associate the old Move Request to the mailbox. The easiest way to clear the request if it fails in the Exchange Management Console is to simply set all of these values to ”

Now that we have the mailboxes, personal archives, mailbox moves, search mailboxes, arbitration mailboxes and move requests cleared from the database, the database is now removable.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s