Starting from Exchange 2010 SP1 a scheduled task called Database One Copy Alert will be configured automatically on each mailbox server. This script will be executed every hour and will check if multiple copies are available inside the DAG. Besides this the status of the copy will be checked. This because a copy which is not healthy may lead to data lost during a failover.
The scheduled task will execute theCheckDatabaseRedundancy.ps1 script which can be found in the scripts directory of your Exchange installation. But what if you don’t have a DAG in you Exchange environment? In this case no alert will be send.
Besides running the script automatically it’s also possible to run it manually.
In the screenshot above you will see what the output is of a script ran on an Exchange server which is not a member of a DAG. In this case no check will be performed. As you can see it’s possible to send an alert via e-mail.
When having a DAG a lot of information will be displayed. For example are there multiple database copies but also what’s the status of the database.
An event generated by the script can have two levels:
- red, there are not enough copies available from the database, or the copy of the database does not have the status healthy. In this case an event will be logged with event ID 4113
- green, there are multiple copies of a database and the copy has the status healthy. In this case an event will be logged with event ID 4114
In the first case this requires some action. There is one remark which must be made about the red level. This level will be assigned only if the issues still exists after 20 minutes. When a problem is detected the script will perform an itteration several times. One itteration is done every minute, if after 20 minutes the level is still red an event will be written to the event log. Once this has been done an event will be written in the event log every 15 minutes till the level is green again. But before a level is changed back to green the script will wait 10 itterations (10 minutes). If you would like to receive the status per mail when the alert level has changed to red for one of the databases you will need to modify the scheduled task
By default the scheduled task will be executed using the following parameters:
-NonInteractive -WindowStyle Hidden -command “& ‘C:\Program Files\Microsoft\Exchange Server\V14\Scripts\CheckDatabaseRedundancy.ps1’ -MonitoringContext -ShowDetailedErrors -ErrorAction:Continue”
When you change this to:
-NonInteractive -WindowStyle Hidden -command “& ‘C:\Program Files\Microsoft\Exchange Server\V14\Scripts\CheckDatabaseRedundancy.ps1′ -MonitoringContext -ShowDetailedErrors -ErrorAction:Continue -SummaryMailFrom:’exchange02.corp.local’-SendSummaryMailTos:@(‘email@example.com’)”
The script will send an e-mail with detailed information once there is an issue.
In the example above you will see that there is an issue with the database in our DAG. There is only one copy of the specific database which will result in no mailbox access after the server fails.
When adding an additional database copy and rerunning the script you will see the status has changed from red to green. If the copy with the preference of 1 fails then the database with preference 2 will be actived.
The script can be executed using some parameters. In the table below an overview is displayed of these parameters and a description of them:
|-v||Verbose mode, will give you detailed logging of what happens during the execution of the script|
|-SummaryMailFrom||The sender address used for sending the summary of the log|
|-SendSummaryMailTos||The recipient address usied for receiving the summary of the log|
|-ShowDetailedErrors||Gives additional details per database copy per server|
For more information you can have a look at the page below. One remark should be made that the mentioned page describes the script which could be used in Exchange 2010 RTM. Starting from Exchange 2010 SP1 the script is installed during the Exchange installation by default:
The Exchange Team Blog: RELEASED: Exchange 2010 Database Redundancy Check Script: open