We have all been there. We create our brand new Exchange system, size the server correctly using the Mailbox Calculator, and create our Disks based on the estimated maximum sizes. We give the database to our users, and without adequate monitoring, it grows and grows and grows. Despite what we all think, not every company has SCOM 2012 with all the monitoring goodness that provides (other monitoring solutions are available)
This is a quick and simple way to prevent running out of disk space on a database drive, which can cause large amounts of downtime. Lets take a recent customer as an example
They have a 200GB lun configured to host a database (DB1) and the associated log files. After running through the mailbox storage calculator, and ensuring that they have enough space for the content index,Logs and contingency, they settled on a max database size of 110 GB.
First thing to do, is find the Mailbox Guid associated with our database. We can do this with the command Get-MailboxDatabase | FL Name,Guid
Record the relevant GUID somewhere safe.
Open up Regedit, and Browse to HKLM\System\CurrentControlSet\Services\MsExchangeIS\*ServerName*\Private-*Guid*
Add a New DWORD Value called “Database Size Limit in GB” (it is case sensitive) and add the size limit in decimal. From the screenshot above, we have set a 110GB limit. Now Restart the Information store.
Within a DAG, the Guid will be the same for each database, but you must set this on each member of the DAG.
This will ensure that when the database reaches a certain size, it will be dismounted. Note this is not an immediate dismount, but it will occur at around 8am in the morning (By default) . Therefore, this wont protect you in the event of a sudden spike in database size.
Now, just having your database dismount isn't the best way to alert you of an issue. Therefore, when the database hits 90% of the configured size (appox 99GB in this case) then an event will be logged in the Application Log. Specifically, MSExchangeIS EventID 9688. With the wonders of Server 2008 Task Scheduler, you can configure an email alert when an event is logged.
Open Task scheduler, and Create a new Basic Task.
Configure the task to begin on an event, and configure the trigger as shown below:
Then, under the actions, configure the action of “Send an Email”, and under SMTP server, configure the address of a hub transport server. If the hub role is installed on the local server, you can use 127.0.0.1
Configure your alerts with the correct message text, and create the task. Finally, go into the security options, and set it to run whether a user is logged in or not. Also it would be prudent to create a service account to run this task as, or run it as local system.
This should prevent the awkward situation of a database completely filling the disk, and having to quickly find more storage. By alerting you, and setting the size limit low enough, even if you need to provision new disk, you should be notified early enough to take corrective action! When the alert comes, if you have the space available, you can change the registry key to increase the size, and ensure that your users can keep working whilst you source some new storage.