Recently i was adding new Exchange 2010 SP3 servers into an existing Database Availability Group, and adding database copies on those servers, to all the existing databases.
To add the database copy i ran the cmdlet:
Add-MailboxDatabaseCopy -Identity <DatabaseName> -MailboxServer <NewDagMember> -ActivationPreference 2
The copy was added and started seeding, but when it finished, it immediately went into a failed state, as shown below:
I went to the NewDagMember and the log file directory was empty, meaning that no log was seeded during the process of adding the copy. Then i went to the event viewer of the NewDagMember and found two relevant events.
Event ID 2059 – MSExchangeRepl: The required log file <file number> for <Database\Server> is missing on the active copy. If you removed the log file, please replace it. If the log file is lost, the database copy will need to be reseeded using Update-MailboxDatabaseCopy.
Event ID 117 – ExchangeStoreDB: At <Date Time> the copy of <Database Name> on this server experienced an error that requires it to be reseeded. For more details about this failure, consult the event log on the server for other storage and ExchangeStoreDB events. The passive copy has been suspended.
So in summary event ID 117 was telling me that the local copy experienced an error and had to be reseeded and event ID 2059 was telling me the cause of that error. A log was missing on the source.
To better understand why was that log missing i went to investigate the source, and found out that:
- the database on the source never had other copies up until i added that one
- the database on the source mounted and functional with no problems being reported from the users
- the database was being backed up with full and incremental backups. The last backup on the database was an incremental one
- the database on the source had thousands of log files waiting to be truncated by the next full backup
At this point i was sure on how to resolve this: I needed to truncate all those database logs. The incremental and probably also the full backups were not truncating the logs as expected and some logs were missing, so if i was able to truncate them asap it was problem solved for me.
So how do you truncate the logs on the database? You have several options:
- A full backup (if the backup software is well configured and 100% compatible with Exchange 2010)
- Circular logging
- the eseutil tool to identify and remove unnecessary logs
Before telling you what option i made i would like to recommend that you read this fine article:
So what i did was, i got a small maintenance window and enabled circular logging on the databases. If you choose to do that be aware that: You need to dismount the database twice (hence the maintenance window), the database cannot have any copies when you enable the circular logging and you need to monitor the logs folder of that database as circular logging might take some time to truncate the logs.
To use the same procedure i did, do the following steps:
- make sure you remove the existing copy (the one that is failed and suspended) of the database, from the new DAG server
- Enable circular logging on the database
- dismount the database
- mount the database
- wait for circular logging to truncate all the logs
- Disable circular logging on the database
- dismount and mount the database for the change to apply
Please see the following for instructions on how to enable circular logging on Exchange 2010:
Once i did the procedure described above, i re-ran the Add-MailboxDatabaseCopy cmdlet and my problem was solved.
Hope that was helpful. Enjoy