Chapter 3. Exchange database administration

Databases are containers for information. Microsoft Exchange Server 2013 uses mailbox databases to maintain user data. The information in a particular database isn’t exclusive to mailboxes and their associated user data—Exchange Server maintains related information within databases as well. Within mailbox databases, you’ll find information about Exchange logons and mailbox usage. Exchange also maintains information about full-text indexing, although the actual content indexes are stored in separate files. In this chapter, you’ll learn how to manage databases and the information they contain.

Working with active mailbox databases

Each Mailbox server installed in the organization has an information store. The information store operates as a service and manages the server’s databases. Each mailbox database has a database file associated with it. This file is stored in a location that you specify when you create or modify the mailbox database.

Mailbox databases can be either active databases or passive copies of databases. Users access active databases to get their mailbox data. Passive copies of databases are not actively being used and are the subject of the section, Working with mailbox database copies later in this chapter. You create passive copies of databases as part of a high-availability configuration as discussed in Chapter 2.

Understanding mailbox databases

Mailboxes are the normal delivery location for messages delivered within an organization. They contain messages, attachments, and other types of information that the user might have placed in the mailbox. Mailboxes, in turn, are stored in mailbox databases.

When you install a Mailbox server, Setup creates a default mailbox database. The default mailbox database is meant to be a starting point, and most Exchange organizations can benefit from having additional mailbox databases, especially as the number of users in the organization grows. Additional mailbox databases are created for many reasons, but the following reasons are the most common:

  • To provide a smaller unit of management. Exchange has a practical limit of 2 terabytes (TB) on the size of databases, though you may find it easier to work with databases between 1 TB and 1.5 TB. Large databases require more time to move, restore, and recover compared to smaller databases. Additionally, when you establish database availability groups and create copies of a database, the entire database must be replicated from the source database to the database copies. During recovery, you can restore individual databases without affecting the performance or uptime of other databases on the system.

  • To impose a different set of mailbox rules on different sets of users. Each additional mailbox database can have its own property settings for maintenance, storage limits, deleted item retention, indexing, security, and policies. By placing a user’s mailbox in one mailbox database instead of another, you can apply a different set of rules.

  • To optimize Exchange performance. Each mailbox database can have its own storage location. By placing the mailbox databases on different physical drives, you can improve the performance of Exchange Server 2013.

  • To create separate mailbox databases for different purposes. For example, you might want to create a mailbox database called General In-Out to handle all general-purpose mailboxes being used throughout the organization. These general-purpose mailboxes could be set up as shared mailboxes for Postmaster, Webmaster, Technical Support, Customer Support, and other key functions.

When you create a mailbox database, you can specify the following information:

  • What the name of the database should be

  • Where the database file is to be located

  • When maintenance on the database should occur

  • Any limitations on mailbox size

  • Whether deleted items and mailboxes should be retained

Each mailbox database has a default offline address book (OAB). Microsoft Outlook 2007 and later clients access the default OAB and default public folder hierarchy on your organization’s Client Access servers. Exchange 2013 uses the mailbox provisioning load balancer to automatically select a database to use when you create or move a mailbox and do not explicitly specify the mailbox database to use. As the name implies, the purpose of the load balancer is to try to balance the workload across mailbox databases in the organization.

Although the load balancer uses multiple criteria to try to determine where a mailbox should be created or moved, the selection criteria does not take into account the proximity of the Mailbox server on which a database is stored to the computer or computers used by the user. Instead, the load balancer uses the Active Directory site where the mailbox task is being performed to determine which mailbox databases should be selected and only includes databases that are in the local site.

You can control the way automatic distribution works in several ways. You can temporarily or permanently exclude databases from the distribution process by using the -IsSuspendedFromProvisioning and -IsExcludedFromProvisioning parameters of the Set-MailboxDatabase cmdlet respectively. When either of these parameters is set to $True, Exchange excludes the related database from the automatic distribution process.

When selecting a database to use, the mailbox provisioning load balancer also checks the database management scopes of the administrator creating a mailbox. Database management scopes are part of the role-based access control (RBAC) permissions model and are a way to limit the databases administrators can view and manage.

Note

By default, all administrators in an Exchange organization can see all the mailbox databases in the organization. When you create database management scopes in the organization, administrators will only be able to see databases included in a scope applied to them.

If you create custom scopes, Exchange uses these scopes to select databases. Specifically, the load balancer only selects mailbox databases included in a scope applied to the administrator creating a mailbox. Therefore, if a database isn’t included in a scope applied to an administrator, the database won’t be selected for automatic distribution.

Preparing for automatic reseed

Automatic reseed, new for Exchange 2013, allows you to quickly restore database redundancy after a disk failure, database corruption event, or other event that requires a reseed of a database to recover operations. For automatic reseed to work, however, you must pre-provision one or more spare disks. These spare disks are then used during the automatic reseed to recover the database copy. Here’s how automatic reseed works:

  1. The Microsoft Exchange Replication service scans the Information Store periodically for database copies that have a status of FailedAndSuspended.

  2. If the replication service finds a database copy with the FailedAndSuspended status, it performs prerequisite checks to evaluate the situation, which includes determining whether spares are available, whether anything could prevent the system from performing an automatic reseed, whether only a single copy of the database is available, and more.

  3. If the prerequisite checks pass successfully, the Microsoft Exchange Replication service allocates and remaps an available spare before starting the seed operation.

  4. After the seed has been completed, the Microsoft Exchange Replication service verifies that the new copy has a Healthy status.

To prepare spare volumes on a server, you must complete the following steps:

  1. Mount the volumes that will contain databases under a single mount point, such as C:PrimaryVols.

  2. Mount the volumes to mount points under this volume. For example, you could mount the first volume as C:PrimaryVolsVolume1, the second volume as C:PrimaryVolsVolume2, and so on.

  3. Create databases on the server in locations within the specified volumes, ensuring that there are fewer databases than mounted volumes.

Consider the following scenario to see how this would work in practice:

You have five volumes mounted under C:PrimaryVols as C:PrimaryVolsVolume1, C:PrimaryVolsVolume2, C:PrimaryVolsVolume3, C:PrimaryVolsVolume4, and C:PrimaryVolsVolume5.

You create three databases, locating the first database under C:PrimaryVolsVolume1, the second under C:PrimaryVolsVolume2, and the third under C:PrimaryVolsVolume3.

You then have two spare volumes, mounted as C:PrimaryVolsVolume4 and C:PrimaryVolsVolume5.

If a disk fails, a database copy becomes corrupted, or another event requiring reseed occurs, the failed database is automatically reseeded to one of the spare volumes.

You can identify the failure and automatic reseed tasks by reviewing the event logs. Related events are logged in the event logs under Applications and Services Logs > Microsoft > Exchange > High Availability and under Applications and Services Logs > Microsoft > Exchange >MailboxDatabaseFailureItems.

Creating mailbox databases

You can create mailbox databases by using the New Mailbox Database Wizard. The default database file path and default log folder path are set automatically to be the same as those used for other Exchange data.

Any new mailbox databases you create using the Exchange Admin Center are configured to use the mailbox provisioning load balancer by default. When you create mailbox databases using the Exchange Management Shell, you can set the –IsExcludedFromProvisioning parameter to $True to specify that the database should not be considered by the mailbox provisioning load balancer. Excluding a database from provisioning means new mailboxes are not automatically added to this database. Rather than excluding a database from provisioning, you can set the –IsSuspendedFromProvisioning parameter to $True to specify that a database temporarily not be considered by the mailbox provisioning load balancer. Keep in mind that whether you exclude or suspend a database from provisioning is semantics as in either case the database won’t be used for provisioning.

To create a mailbox database, complete the following steps:

  1. In the Exchange Admin Center, select Servers in the feature pane, and then select Databases. In the main pane, you should see a list of active databases that are available in the Exchange organization.

  2. Tap or click the New button to open the New Database dialog box, shown in Figure 3-1.

    A screen shot of the New Database dialog box, showing the settings for a new mailbox database.
    Figure 3-1. Configure the new mailbox database.
  3. In the Mailbox Database text box, type a name for the mailbox database. The database name must be unique within the Exchange organization. Although the database name can contain spaces and special characters, it’ll be easier to work with the database if the name uses standard characters.

  4. Tap or click Browse to the right of the Server text box to open the Select Server dialog box. Figure 3-2 shows Mailbox servers listed by name, version, and exact build as well as associated database availability group, if applicable.

    A screen shot of the Select Mailbox Server dialog box, showing available mailbox servers.
    Figure 3-2. Select a Mailbox server.
  5. Select the Mailbox server that will host the mailbox database, and then tap or click OK. Only Mailbox servers in the Active Directory forest to which you are connected are available.

  6. The database file path and log folder path are set to the default location for Exchange data on the selected server. A subfolder with the mailbox database name will be created under the default database file path and the name of the .edb file for the database will be set the same as the database name. Similarly, a subfolder with the same name as the database name is created under the default log folder path. If you don’t want to use the default locations, enter the paths you want to use for the database file and the related logs in the text boxes provided.

    Real World

    Exchange creates folders if they do not exist, which is a good thing except when you mistype the intended path. Rather than type in a long file path, you might want to use copy and paste. In File Explorer, navigate to the exact folder path you want to use. Click in the folder path on the Address bar to display and automatically select the folder path. Press Ctrl+C to copy the path. In the New Database dialog box, click in the path text box, press Ctrl+A, and then press the Delete key. Finally, press Ctrl+V to paste in the path you copied previously.

  7. Select the Mount This Database check box if you want to mount this database. Mounting a database puts it online, making it available for use.

  8. Tap or click Save to create the mailbox database, and then tap or click OK. If an error occurred, you need to take the appropriate corrective action. Otherwise, you can now modify the properties of the mailbox database as necessary. To make the new database accessible to mailbox users, you must restart the Microsoft Exchange Information Store service.

Exchange Server 2013 Standard edition supports up to five databases. Exchange Server 2013 Enterprise edition supports up to 100 databases. However, if you install Exchange Server 2013 Enterprise edition but forget to enter the product key, the server runs in Trial mode and only supports up to five databases as well.

If you try to create more databases than are supported by your edition of Exchange, you’ll see an error stating that Exchange couldn’t mount the database. In the error details, you’ll also see a message stating MapiExceptionTooManyMountedDatabases: Unable To Mount Database (see Figure 3-3). You can resolve this problem on a server running Enterprise edition by reducing the number of databases on the server or simply creating the database on a different server. To resolve this problem on a server running a standard or trial edition of Exchange Server 2013, you can upgrade the server to Enterprise edition by completing these steps:

A screen shot of an Error dialog box, showing that Exchange Admin Center was unable to mount the new database.
Figure 3-3. An error showing that Exchange Admin Center was unable to mount the new database.
  1. In Exchange Admin Center, select Servers on the feature pane, and then select Servers.

  2. Double-tap or double-click the server you want to upgrade. In the Properties dialog box, on the General page, the current edition should be listed as Trial Edition or Standard Edition.

  3. If the server is running Trial Edition, upgrade by entering a valid Enterprise product key in the text boxes provided, and then selecting Save. If the server is running Standard Edition, upgrade by selecting Change Product Key, entering a valid Enterprise product key in the text boxes provided, and then selecting Save.

  4. Tap or click OK. For the change to take effect, you must restart the Microsoft Exchange Information Store service.

In the Exchange Management Shell, you can create mailbox databases by using the New-MailboxDatabase cmdlet. New-MailboxDatabase cmdlet syntax and usage provides the syntax and usage.

Note

You use a separate cmdlet to mount the database. See the section Mounting and dismounting databases later in this chapter for details.

Setting the default offline address book

Mailbox databases can have different types of information associated with them, including a default OAB. You set related options for mailbox databases by using the Client Settings page of the related Properties dialog box. To view this dialog box and update the messaging options, follow these steps:

  1. In the Exchange Admin Center, select the Servers feature, and then select Databases. Next, double-tap or double-click the database you want to configure.

  2. In the Properties dialog box, tap or click the Client Settings page.

    Note

    If you can’t update the text boxes on the Client Settings page, it means that a policy has been applied to the mailbox database. You must directly edit or remove the policy and then make the necessary changes.

  3. The Offline Address Book text box shows the OAB for the mailbox database. OABs contain information regarding mail-enabled users, contacts, and groups in the organization, and they are used when users aren’t connected to the network. If the text box is empty, the global default is used. If you’ve created additional OABs beyond the global default, you can specify one of these additional OABs as the default for the mailbox database. Tap or click Browse, select the OAB you want to use, and then tap or click OK. Tap or click Save to apply the changes.

In the Exchange Management Shell, you can set the default OAB for mailbox databases by using the Set-MailboxDatabase cmdlet. Using the Set-MailboxDatabase cmdlet to set the default OAB provides the syntax and usage.

Setting mailbox database limits and deletion retention

Mailbox database limits are designed to control the amount of information that users can store in their mailboxes. Users who exceed the designated limits might receive warning messages and might be subject to certain restrictions, such as the inability to send messages. Deleted item retention is designed to ensure that messages and mailboxes that might be needed in the future aren’t deleted inadvertently. If retention is turned on, you can retain deleted messages and mailboxes for a specified period before they are permanently deleted and are nonrecoverable.

An average retention period for messages is about 14 days. The minimum retention period for mailboxes should be about 7 days. In most cases, you’ll want deleted messages to be maintained for a minimum of 5 to 7 days and deleted mailboxes to be maintained for a minimum of three to four weeks. An interval of 5 to 7 days is used for messages because users usually realize within a few days that they shouldn’t have deleted a message. A three-week to four-week interval is used for mailboxes because several weeks can (and often do) pass before users realize that they need a deleted mailbox or messages within a deleted mailbox. To understand why, consider the following scenario.

Sally leaves the company. A coworker is given permission to delete Sally’s user account and mailbox. Three weeks later, Sally’s boss realizes that she was the only person who received and archived the monthly reports sent through email from corporate headquarters. The only way to get reports for previous years is to recover Sally’s mailbox, and you can do this if you’ve set a sufficiently long retention period.

Note

Exchange has several features to ensure that mailbox items are retained according to policies set forth by an organization for legal reasons, including automatic archiving of old messages and retention policies. Deletion settings on the Limits page control the minimum length of time deleted items are retained if no retention tags specifically apply to deleted items.

To view or set limits and deletion retention for a mailbox database, follow these steps:

  1. In the Exchange Admin Center, select the Servers feature, and then select Databases. Next, double-tap or double-click the database you want to configure.

  2. In the Properties dialog box, on the Limits page (shown in Figure 3-4), use the following options to set storage limits and deleted item retention:

    A screen shot of the Properties dialog box for the Customer Support Team database, showing options to set storage limits and deleted item retention on the Limits page.
    Figure 3-4. Use the Limits page to set storage limits and deleted item retention for individual mailboxes and entire mailbox databases.
    • Issue a warning at (GB). Sets the size limit, in gigabytes, that a mailbox can reach before Exchange Server issues a warning to the user. The warning tells the user to clear out the mailbox. If you don’t want Exchange to issue warnings, set the value to 0 or Unlimited.

    • Prohibit send at (GB). Sets the size limit, in gigabytes, that a mailbox can reach before the user is prohibited from sending any new mail. The restriction ends when the user clears out the mailbox and the total mailbox size is under the limit. If you don’t want Exchange to prohibit sending mail, set the value to 0 or Unlimited.

    • Prohibit send and receive at (GB). Sets the size limit, in gigabytes, that a mailbox can reach before the user is prohibited from sending and receiving mail. The restriction ends when the user clears out the mailbox and the total mailbox size is under the limit. If you don’t want Exchange to prohibit sending and receiving mail, set the value to 0 or Unlimited.

      Caution

      Prohibiting send and receive might cause users to lose email. When a user sends a message to a user who is prohibited from receiving messages, a nondelivery report (NDR) is generated and delivered to the sender. The recipient never sees the email. Because of this, you should prohibit send and receive only in very rare circumstances. Your organizational policy will likely spell out those circumstances. To remove this restriction, set Prohibit Send And Receive to Unlimited or enter a value of 0.

    • Keep deleted items for (days)Sets the number of days to retain deleted items. An average retention period is 14 days. If you set the retention period to 0, deleted messages aren’t retained, and you can’t recover them in the same way you could if retention was enabled.

    • Keep deleted mailboxes for (days). Sets the number of days to retain deleted mailboxes. The default setting is 30 days. You’ll want to keep most deleted mailboxes for at least 7 days to allow the administrators to extract any data that might be needed. If you set the retention period to 0, deleted mailboxes are retained only if you select the next option, and then only until the database has been backed up. If a mailbox is backed up, you can recover it only by restoring it from backups.

    • Don’t permanently delete items until the database is backed up. Ensures that deleted mailboxes and items are archived into at least one backup set before they are removed.

  3. The Warning Message Interval sets the interval for sending warning messages to users whose mailboxes exceed the designated limits. To change this setting, select Customize. You can now set the warning interval using the Customize Quota Notification Schedule dialog box, shown in Figure 3-5.

    A screen shot of the Customize Quota Notification Schedule dialog box, showing options to set the warning message interval.
    Figure 3-5. Customize quota notification for mailboxes stored in the database.
    • Times that are used for quota notification are filled in with a dark bar.

    • Times that aren’t used for quota notification are blank.

    Important

    The default interval for sending warning messages is daily between 1 A.M. and 1:15 A.M, which is an acceptable initial interval for small deployments. As your organization grows, however, you’ll want to optimize this interval to ensure that servers aren’t overburdened and that servers have enough time to process all the mailboxes.

  4. Show the time in hours or in 15-minute intervals by using the options provided. Click or tap the time interval to change the setting.

    • Hourly or 15-minute interval buttons are used to select or clear a particular interval for all the days of a week.

    • Days of the week buttons allow you to clear or select all the hours in a particular day.

    • The All button allows you to clear or select all the time periods.

  5. If you customized the notification schedule, tap or click OK to close the Customize Quota Notification Schedule dialog box.

  6. Tap or click Save to apply your settings.

In the Exchange Management Shell, you can set limits for mailbox databases by using the Set-MailboxDatabase cmdlet. Using the Set-MailboxDatabase cmdlet to set limits provides the syntax and usage. When you set a limit, you can specify the value with KB (for kilobytes), MB (for megabytes), or GB (for gigabytes). The default value type is bytes. Additionally, it’s important to point out that the -MaintenanceSchedule and -QuotaNotificationSchedule parameters are not used with Exchange 2013.

Recovering deleted mailboxes

When you delete a mailbox from a user account, the mailbox is retained as a disconnected mailbox according to the mailbox retention setting. You can reconnect the mailbox to the original user account or another user account if necessary. Similarly, when you delete a user account and the related mailbox, the mailbox is retained as a disconnected mailbox according to the mailbox retention setting. You can connect the mailbox to an existing user account if necessary.

When you move mailboxes between databases, mailboxes in the original (source) database are soft deleted. This means they are disconnected, marked as soft deleted, but retained in the original database until the deleted mailbox retention period expires. In Exchange Management Shell, you can use a DisconnectReason of “SoftDeleted” to find soft-deleted mailboxes.

To recover a deleted mailbox, complete the following steps:

  1. In the Exchange Admin Center, select Recipients in the feature pane, and then select Mailboxes.

  2. Tap or click the More button (this button shows three dots), and then select Connect A Mailbox. The Connect A Mailbox dialog box shows all mailboxes marked for deletion but currently retained regardless of whether those mailboxes were disabled, deleted, or soft deleted.

  3. In the Connect A Mailbox dialog box, shown in Figure 3-6, use the selection list provided to select the server in which you want to look for disconnected mailboxes.

    A screen shot of the Connect A Mailbox dialog box, showing disconnected mailboxes.
    Figure 3-6. Viewing disconnected mailboxes.
  4. Tap or click the mailbox to restore it, and then tap or click Connect. Connect the mailbox to the user account to which it was connected previously or to a different user account. If the original user account is available, select the Yes option to reconnect the mailbox to the original user account. If the original user isn’t available or you want to associate the mailbox with a different user, select the No option and follow the prompts.

    Note

    Deleted mailboxes aren’t necessarily marked as such immediately. It can take 15 minutes to an hour before the mailbox is marked as deleted and listed accordingly.

    Important

    If you previously removed the mailbox rather than disabling it, the user account associated with the mailbox was deleted as well. Because each user account has a unique security identifier associated with it, you can’t simply re-create the user account to get back the same set of permissions and privileges. That said, if you want to connect the mailbox to a user account with the same name, you can do this by recovering the deleted account from Active Directory before garbage collection has occurred or by recreating the account in Active Directory Users And Computers. The account will then be available for selection but when you’re connecting the mailbox to an account, you’ll need to choose the No option because Exchange and Active Directory see this as a different account.

You can use the Connect-Mailbox cmdlet to perform the same task following the syntax shown in Connect-Mailbox cmdlet syntax and usage.

Recovering deleted items from mailbox databases

You can recover deleted items from mailbox databases as long as you’ve either set a deleted item retention period for the database from which the items were deleted and the retention period hasn’t expired, or you have specified that Exchange should not permanently delete items from mailboxes until the database has been backed up and Exchange hasn’t been backed up yet. If either of these conditions are met, you can recover deleted items from mailbox databases.

To use Outlook 2010 or Outlook 2013 for recovery, complete the following steps:

  1. Log on as the user who deleted the message, and then start Outlook.

  2. Tap or click the Folders pane, and then select Recover Deleted Items.

  3. The Recover Deleted Items From dialog box appears. Select the items you want to recover, and then tap or click the Recover Selected Items button.

  4. Items you’ve recovered are copied to the Deleted Items folder. In the left pane, tap or click Deleted Items.

  5. In the Deleted Items folder, press and hold or right-click items you want to keep, select Move, and then tap or click Other Folder.

  6. In the Move Items dialog box, select the folder to which the item should be moved, and then tap or click OK.

Note

The steps are similar for Outlook 2007, except you start by tapping or clicking Recover Deleted Items on the Tools menu.

To use Outlook Web App (OWA) for recovery, complete these steps:

  1. In a web browser, type https://servername.yourdomain.com/owa, where servername is a placeholder for the HTTP virtual server hosted by Exchange Server 2013 and yourdomain.com is a placeholder for your external domain name, such as https://mail.cpandl.com/owa.

  2. Next, log on as the user (or have the user log on). Type the user name in domainusername format, such as pocket-consultaertk, or user@domain format, such as . Type the password, and then tap or click Sign In.

  3. In the left pane, press and hold or right-click Deleted Items, and then select Recover Deleted Items.

  4. In the Recover Deleted Items dialog box, you’ll see a list of recoverable items. Each listed item will have a selection check box. Select this check box for items you want to recover.

  5. Tap or click the Recover button, and then tap or click OK. Items you select will be restored to their default folders.

Working with mailbox database copies

When your Exchange organization uses database availability groups, Exchange replicates transaction logs from an active mailbox database on a source Mailbox server to other Mailbox servers in the database availability group that have passive copies of the database. On these servers, Exchange replays the transaction logs into the passive copy of the mailbox database by using either file mode or block mode replication. You can monitor the health and status of replication and database copies by using the Exchange Management tools.

The Mailbox server that hosts the active copy of a database is referred to as the mailbox database primary for that database. A Mailbox server that hosts a passive copy of a database is referred to as a mailbox database secondary for that database. You can move the active database to another Mailbox server in the database availability group by using the switchover process discussed in “Switching over servers and databases” in Chapter 2. In a switchover, the active copy of a database is dismounted on the current Mailbox server and a passive copy of the database is activated and mounted on another Mailbox server in the database availability group.

Tip

You can quickly distinguish between an active mailbox database and a passive copy of a database by reviewing the Copy Status column under the Database Copies page in the Exchange Admin Center. Only the active database will have a status of Mounted or Dismounted. For passive database copies, you’ll see the current status of replication for the database copy.

Creating mailbox database copies

After you create a database availability group and add Mailbox servers to the group, you can create copies of mailbox databases to initiate replication. Within the group, replication occurs between the active mailbox database on a source Mailbox server and other Mailbox servers that host copies of the database. You cannot replicate a database outside of a database availability group, nor can you replicate an Exchange 2013 mailbox database to a server running an earlier version of Exchange.

Each database availability group can have up to 16 member servers, and you can create up to 16 instances of a database, including one active instance and 15 passive instances. You can create mailbox database copies only on Mailbox servers that do not host the active copy of a mailbox database, and you cannot create two copies of the same database on the same server.

Because all copies of a database use the same path on each server containing a copy, the database and log file paths for a database copy on each Mailbox server must not conflict with any other database paths. You need to ensure the database and log file paths for the database copy can be created in the same location as all other copies and that the paths do not conflict with any other database paths on the target server.

With respect to Active Directory, the member servers in an availability group must all be in the same Active Directory domain. You can create database copies on Mailbox servers in the same or different Active Directory Sites, and on the same or different network subnets. However, database copies are not supported between Mailbox servers with roundtrip network latency greater than 250 milliseconds (by default). Database copies are automatically assigned an identity in the format DatabaseNameHostMailboxServerName, such as Engineering Primary DatabaseMailServer36.

To create a copy of a mailbox database, complete the following steps:

  1. In the Exchange Admin Center, select Servers in the feature pane, and then select Databases. In the main pane, you should see a list of active databases that are available in the Exchange organization.

  2. Select the mailbox database that you want to copy to see a list of all copies of that database in the details pane. Whereas the active copy of a database normally is listed with a status of Active Mounted or Active Dismounted, passive copies are normally listed with a status of Passive Healthy.

  3. Tap or click the More button (this button shows three dots), and then select Add A Database Copy. This opens the Add Mailbox Database Copy dialog box.

    As shown in Figure 3-7, the dialog box shows you which servers already have a copy of the database and sets the activation preference number to the next value for the next database instance. You can set a lower preference value if desired.

    A screen shot of the Add Mailbox Database Copy page, which you use to add a mailbox database copy.
    Figure 3-7. Add a mailbox database copy.
  4. Tap or click Browse. Select the Mailbox server that will host the mailbox database copy, and then tap or click OK. Although servers outside the database availability group and servers running earlier versions of Exchange may be listed in the Select Server dialog box, you’ll only want to select an Exchange 2013 Mailbox server in the same database availability group that doesn’t have a copy of the database already. Each Mailbox server in a database availability group can host only one copy of a database.

  5. Optionally, in the Activation Preference Number text box, specify the preference value for the database copy. The activation preference number represents the order of activation preference for a database copy after a failure or outage of the active copy. The preference value is a number equal to or greater than 1, where 1 has the highest preference. The preference value cannot be larger than the total number of database copies.

    Note

    Active Manager uses the preference value only to break ties in the best-copy selection process. If two or more database copies are seen as the best choice for activation, the database copy with the highest preference is selected. Following this, when there is a tie, a database copy with a preference value of 3 would be selected before a database copy with a preference value of 4. For more information on Active Manager, see “Working with active manager” in Chapter 2.

  6. If you want to configure replay lag time or postpone seeding, select More Options. You’ll then be able to specify a replay lag time in days and postpone seeding. If you postpone seeding of the database, you’ll need to manually seed the database later.

  7. Tap or click Save to create the mailbox database copy, and then click Close when the process completes. If an error occurred, you need to take the appropriate corrective action. Otherwise, you can now work with the database copy.

In the Exchange Management Shell, you can create mailbox database copies by using the Add-MailboxDatabaseCopy cmdlet. Add-MailboxDatabaseCopy cmdlet syntax and usage provides the syntax and usage. Use the –ReplayLagTime parameter to specify how long the Exchange Replication Service should wait before replaying log files. Use the –TruncationLagTime parameter to specify how long the Exchange Replication Service should wait before truncating logs that have been replayed.

Tip

Different database copies can have different lag times. If you want logs to be replayed immediately, set a relatively short replay lag time or none at all. If you want a cushion for protection against inadvertent changes, set a longer replay lag time. As an example, if you have three database copies, you might want two copies to have short replay lag times and one copy to have a long replay lag time.

Note

The new database copy will remain in a Suspended state if you use the –SeedingPostponed parameter. When the database copy status is set to Suspended, the SuspendMessage is set to “Replication is suspended for database copy ‘<Name>’ because database needs to be seeded.” You can seed the database as discussed in the Updating mailbox database copies section.

Setting replay, truncation, and preference values for database copies

Replay and truncation values are designed to let you fine-tune the way replication works for each database copy. Replay lag time is the amount of time to delay log replay. Truncation lag time is the amount of time that you want to delay log truncation after a log has been successfully replayed. You can also set a relative preference value for database copies. The preference value sets the order of activation preference after a failure or outage affecting the active database, with a value of 1 indicating the highest preference, a value of 2 the next highest preference, and so on. You cannot set a database copy to a value higher than the number of database copies. Active Manager uses the preference value in the case of a tie during the best-copy selection process.

To set preference values for a database copy, complete the following steps:

  1. In the Exchange Admin Center, select Servers in the feature pane, and then select Databases. In the main pane, you should see a list of active databases that are available in the Exchange organization.

  2. Select the mailbox database with the copy that you want to manage. In the details pane, you’ll see a list of active and passive copies of the database, along with separate management options for each. Tap or click the View Details option for the database copy you want to modify.

  3. The current activation preference number and replay lag time are listed. Change the values as necessary, and then tap or click Save.

In the Exchange Management Shell, you can set replay, truncation, and preference values for mailbox database copies by using the Set-MailboxDatabaseCopy cmdlet. Set-MailboxDatabaseCopy cmdlet syntax and usage provides the syntax and usage.

In Exchange 2013, lagged copies automatically play down log files as necessary to accommodate adverse conditions, such as the following:

  • If Exchange 2013 detects that page patching is required for a lagged copy, the logs will be automatically replayed into the lagged copy to perform page patching.

  • If Exchange 2013 detects that a low disk space threshold has been reached or that no other log copies are available, the logs will be automatically replayed into the lagged copy.

  • If Exchange 2013 detects that there are too few available healthy copies (active and passive) of a database for more than 24 hours, the logs will be automatically replayed into the lagged copy.

However, you must enable these options specifically. You enable lagged copy replay for all lagged copies in a particular database availability group by using the following command:

Set-DatabaseAvailabilityGroup DAGName -ReplayLagManagerEnabled $true

DAGName is the name of the database availability group to configure.

You specify the low diskspace threshold as a percentage of free disk space before log replay occurs by using the registry value:

HKLMSoftwareMicrosoftExchangeServerv15ReplayParametersReplayLagPlayDownPercentDiskFreeSpace

For example, if you want Exchange to automatically play down lagged copies when the free disk space on the volume used by the active database reaches 10 percent, you’d edit the ReplayLagPlayDownPercentDiskFreeSpace value in the registry and set it to 10.

You specify the number of available healthy copies that triggers replay by using the following registry value:

HKLMSoftwareMicrosoftExchangeServerv15ReplayParametersReplayLagManagerNumAvailableCopies

By default, this value is set to 3, meaning replay is triggered whenever there are fewer than 3 copies of a database available for a 24-hour period. Although this value may work well in large deployments of Exchange, this value is not ideal for small deployments. Specifically, in deployments in which you have three or fewer Mailbox servers in a DAG, setting this value to 3 will cause lagged logs to play down every 24 hours whether you want them to or not.

Note

As lagged copies can use SafetyNet, recovery or activation of lagged copies is much easier than in Exchange 2010. Exchange 2013 also issues single copy alerts as part of the managed availability architecture. Previously, single copy alert was implemented as a script that ran periodically as a scheduled task.

Suspending and resuming replication

As part of planned maintenance or for other reasons, it might be necessary to temporarily suspend replication activity for a database copy. In addition, prior to performing some administrative tasks, you need to suspend replication activity before you can complete the task—for example, before performing seeding. You can suspend and resume database copy activity by completing the following steps:

  1. In the Exchange Admin Center, select Servers in the feature pane, and then select Databases. In the main pane, you should see a list of active databases that are available in the Exchange organization.

  2. Select the mailbox database with the copy that you want to manage. In the details pane, you’ll see a list of active and passive copies of the database. Whereas the active copy of a database is normally listed with a status of Active Mounted or Active Dismounted, passive copies are normally listed with a status of Passive Healthy.

  3. Select the Suspend option for the passive database copy (not an active database) for which you want to suspend replication.

  4. In the Suspend Database Copy dialog box, enter a comment as to why you are suspending replication. If you want to ensure replication can only be activated by you or another administrator, select This Copy Can Be Activated Only By Manual Intervention.

  5. Tap or click Save to suspend continuous replication.

To resume replication later, tap or click Resume. If a suspend comment was provided, you can read the comment. Then tap or click Yes to resume continuous replication.

In the Exchange Management Shell, you can suspend and resume replication by using Suspend-MailboxDatabaseCopy and Resume-MailboxDatabaseCopy, respectively. Suspend-MailboxDatabaseCopy cmdlet syntax and usage and Resume-MailboxDatabaseCopy cmdlet syntax and usage provide the syntax and usage. If you only suspend activation by using the –ActivationOnly parameter, the database cannot be activated until you resume replication without specifying the –ReplicationOnly parameter. The –ReplicationOnly parameter resumes replication without affecting the activation setting. For example, if the –ActivationSuspended parameter was set to $True, the parameter remains set to $True.

Activating lagged database copies

Lagged database copies have a replay lag time great than 0. You can activate a lagged copy by recovering the database copy from SafetyNet, by replaying all uncommitted log files, or by performing a point in time activation.

Before you activate a lagged copy, you may want to preserve the original files for the lagged copy. If so, you need to create a snapshot of the volumes containing the database copy and its log files by suspending replication of the lagged copy you want to activate, and then creating a shadow copy of these volumes as detailed in the steps that follow:

  1. Suspend replication of the lagged copy you want to activate using the following command:

    Suspend-MailboxDatabaseCopy DatabaseServer -SuspendComment "Comment"
    -Confirm $False

    Database is the name of the lagged copy, Server is the name of the server hosting the lagged copy, and Comment is a descriptive comment, such as:

    Suspend-MailboxDatabaseCopy "Engineering DBMailServer18"
    -SuspendComment "Suspending replication to take a db snapshot"
    -Confirm $False
  2. Create a snapshot of the database and log folders by using the following command:

    Vssadmin create shadow /For="c:DatabasesEngineering DB"
    Vssadmin create shadow /For="c:LogsEngineering DB"
  3. Optionally, copy the database and log files to another volume where you want to perform the recovery.

To recover a lagged copy from SafetyNet, complete the following steps:

  1. Because you don’t want the log files to replay when the database is mounted, move the log files for the database copy to an archive folder. This preserves the log files in case they are subsequently needed.

  2. To allow the database to mount without all the necessary transaction logs files, you’ll need to confirm that you accept the data loss. To do this, mount the database with the -AcceptDataLoss parameter as shown in this example:

    Mount-Database "Engineering DB" -AcceptDataLoss
  3. Exchange will mount the database and then request redelivery of missing messages from SafetyNet. You can confirm that the lagged copy was successfully activated by viewing the database properties. In Exchange Admin Center, select Servers in the feature pane, and then select Databases. Next, select the database copy you activated. In the Details pane, click View Details.

  4. After you verify that the database copy was successfully activated, you can delete the log files you moved to an archive folder, as these logs are no longer needed.

To activate a lagged copy by replaying all uncommitted log files, complete the following steps:

  1. Activate the lagged copy on a specified server by using the following command:

    Move-ActiveMailboxDatabase Database -ActivateOnServer Server
    -SkipLagChecks

    Database is the name of the lagged copy and Server is the name of the server hosting the lagged copy, such as:

    Move-ActiveMailboxDatabase "Engineering DB" -ActivateOnServer
    MailServer18 -SkipLagChecks
  2. Exchange will mount the database on the designated server and replay all the log files. The duration of the replay process depends on the amount of data to replay and the speed at which your server hardware can replay the logs.

  3. You can confirm that the lagged copy was successfully activated by viewing the database properties. In Exchange Admin Center, select Servers in the feature pane, and then select Databases. Next, select the database copy you activated. In the Details pane, click View Details.

To activate a lagged copy to a point in time, complete the following steps:

  1. Before you can activate a lagged copy to a point in time, you must first determine which log files are required to meet your recovery requirements. Use the log file date and time to identify which log files you need and which log files should be moved to an archive directory until the recovery process is successfully completed. Specifically, any log file created after your recovery time should be moved to the archive directory.

  2. Next, you need to delete the checkpoint file for the lagged copy. This file has the .chk extension.

  3. At an elevated command prompt, use Eseutil to perform the recovery operation. The basic syntax is:

    Eseutil /r ENN /a

    ENN is the log generation prefix for the database, such as E00 or E01. This prefix is used with all the database files, so it’s easily identified when you access the database folder for the lagged copy.

  4. When all the logs have been replayed, the database will be in a clean state and you can optionally copy the database and log files to another volume where you want to perform the recovery. Keep in mind that the duration of the replay process depends on the amount of data to replay and the speed at which your server hardware can replay the logs.

  5. You can confirm that the lagged copy was successfully activated by viewing the database properties. In Exchange Admin Center, select Servers in the feature pane, and then select Databases. Next, select the database copy you activated. In the Details pane, click View Details.

Updating mailbox database copies

Seeding is the process of initially replicating an active or passive database into a database copy. This creates a baseline passive copy of a database. Normally, seeding occurs automatically, and the length of time required to completely seed a database depends on the size of the source database, the available bandwidth on the network, and the level of activity on the servers involved. However, automatic seeding can fail, and in this case, you then need to manually initiate seeding.

Real World

An automatic seed produces a copy of an active or passive database on a target Mailbox server. Automatic seeding occurs only during the creation of a new database or for a database that has never been backed up.

You can identify a problem with seeding by checking the state of the database copy. When you create a database copy, the database should enter the Initializing state and then the Seeding state. When seeding is complete, the database copy should be in the Healthy state. If the database remains in a Suspended state and does not complete initialization or seeding, there is a problem. Note also that if you are seeding when creating the copy, the task will not complete successfully until the seed is completed. So, you simply watch the task progress and do not need to check copy status.

You can reseed a mailbox database copy anytime you suspect divergence has occurred. However, divergence isn’t necessarily a problem because incremental reseed (incremental resync) takes care of resolving the divergence. You would not need to do a full reseed except in circumstances in which resync isn’t possible—for example, when there is no overlap in log files between diverged copies, or when you’ve done something you shouldn’t have, like an offline defragmentation of a copy that causes uncorrectable divergence.

When you reseed a database, Exchange empties the database copy and replicates a new passive database copy. Typically, you won’t need to reseed database copies after the initial seeding has occurred; however, in some situations you might need to reseed a database copy. One state you can check for is the FailedAnd Suspended state. In this state, Exchange has detected a failure and suspended replication replay because resolution of the failure explicitly requires administrator intervention. For example, if Exchange detects an unrecoverable divergence between the active mailbox database and a database copy, Exchange marks the database copy as FailedAndSuspended. If an incremental resync doesn’t eventually resolve the problem, you need to resolve the underlying cause of the failure before the database copy can be transitioned to a healthy state, which includes reseeding the database.

Before you can seed or reseed a database, you must suspend replication. For very large databases—that is, those that are multiple terabytes (TB) in size—the preferred technique for seeding the initial passive copy of the database, if service level agreements allow or such an outage is acceptable, is to dismount the active copy of the database and copy the database file to the same location on the target Mailbox server in the same database availability group. Rather than copying the database over the network, which could take several days for a multiterabyte database, you should consider the following:

  • Copying the database to one or more disk drives, preferably hot-swappable drives that can be moved between the source and target servers

  • Copying the database to one or more logical unit numbers (LUNs) in your storage array that can be assigned to or is assigned to the target server

With this approach, the database will be unavailable until seeding is completed and you can mount the database. Alternatively, you can leave the active database online and use the Exchange Management tools to initiate the seeding process. After you’ve created at least one baseline passive copy of a database, you can seed new passive copies from the baseline passive copy at any time by using an online or offline approach.

The size of the database, the available network bandwidth, network latency, and the activity levels on the source and target servers determine how long an over-the-network transfer or update takes. After the seeding process has started, don’t close the Exchange Admin Center or Exchange Management Shell until the process has completed. If you do, the seeding operation will be terminated and will need to be restarted.

Keep the following in mind when you are considering updating database copies:

  • When you seed a database using the Exchange Admin Center, both the database copy and the content index catalog are seeded. In the Exchange Management Shell, you can specify that only the database copy should be seeded using the –DatabaseOnly parameter or that only the context index catalog should be seeded using the –CatalogOnly parameter.

  • Before you seed the database copy, you may want to manually remove existing files on the server that hosts the database copy. You can delete existing files in the Exchange Management Shell by using the –DeleteExistingFiles parameter; however, these options remove only the files Exchange checks for and might fail if other files are present.

  • When seeding is complete, Exchange automatically resumes replication. If you want to resume replication manually instead, you can use the –ManualResume parameter in the Exchange Management Shell.

  • By default, seeding data is transferred over the replication network for the database availability group, unless you are seeding to a remote site, in which case it will default to the messaging network. You can override the defaults by using the –Network parameter. The network compression and encryption settings are used and determine whether the transferred data is compressed, encrypted, or both. You specify the networks to use by name in both management tools. In the Exchange Management Shell, you can override the network compression and encryption settings by using –NetworkCompression-Override and –NetworkEncryptionOverride, respectively.

You can seed a database manually by completing the following steps:

  1. In the Exchange Admin Center, select Servers in the feature pane, and then select Databases. In the main pane, you should see a list of active databases that are available in the Exchange organization.

  2. Select the mailbox database with the copy that you want to manage. In the details pane, you’ll see a list of active and passive copies of the database.

  3. Select the Update option for the passive database copy (not an active database) that you want to update (see Figure 3-8).

    A screen shot of the Update Database Copy dialog box, showing options for selecting a source server for seeding.
    Figure 3-8. Update a database copy.

    Tip

    The Exchange Admin Center won’t let you reseed a database that’s in a healthy or other normal state. However, you can force a reseed by suspending the database, copying it, and then updating the database copy.

  4. By default, Exchange will seed the database from the active copy of the database. If you want to use a passive copy for seeding, tap or click Browse. In the Select Mailbox Server dialog box, select the source server hosting the passive copy you want to use and then tap or click OK.

  5. Tap or click Save to begin seeding. If an error occurred, you need to take the appropriate corrective action. Tap or click Close.

To seed a database copy in the Exchange Management Shell, you use the Update-MailboxDatabaseCopy cmdlet. Update-MailboxDatabaseCopy cmdlet syntax and usage provides the syntax and usage. Use the –Force parameter when seeding programmatically, and you will not be prompted for administrative input.

Monitoring database replication status

As an Exchange administrator, you need to monitor the health and status of database copies to ensure that they are available when needed. You can view key health and status information for a database copy by completing the following steps:

  1. In the Exchange Admin Center, select Servers in the feature pane, and then select Databases. In the main pane, you should see a list of active databases that are available in the Exchange organization.

  2. Select the mailbox database with the copy that you want to manage. In the details pane, you’ll see a list of active and passive copies of the database along with the current status of each. Table 3-1 lists the possible status values and any corrective action that might be required.

    Table 3-1. Copy status values

    COPY STATUS

    STATUS OF THE MAILBOX DATABASE COPY

    CORRECTIVE ACTION

    Activation Suspended

    Has been manually blocked from activation by an administrator.

    Allow activation, if appropriate.

    Disconnected And Healthy

    Has been disconnected, and was in the Healthy state when the loss of connection occurred.

    This state can be reported during network failures between the active copy and the database copy.

    Disconnected And Resynchronizing

    Is no longer connected to the active database copy, and was in the Resynchronizing state when the loss of connection occurred.

    This state can be reported during network failures between the active copy and the database copy.

    Dismounted

    Is offline and not accepting client connections. Applies only to the active mailbox database.

    Mount the database if maintenance is complete.

    Dismounting

    Is going offline and terminating client connections. Applies only to the active mailbox database.

    N/A

    Failed

    Is in a failed state because it is not suspended, and is not able to copy or replay log files.

    Exchange periodically checks to see whether the problem that caused the copy status to change to Failed has been resolved. If so, and barring no other issues, the copy status automatically changes to Healthy.

    Failed And Suspended

    Is in the Failed And Suspended state because a failure was detected and because resolution of the failure explicitly requires administrator intervention.

    Take corrective action as appropriate. Exchange does not periodically check to see whether the problem has been resolved and does not automatically recover.

    Healthy

    Is successfully copying and replaying log files, or has successfully copied and replayed all available log files.

    N/A

    Initializing

    Is being created, or the Microsoft Exchange Replication service is starting up or has just been started, or the Mailbox Database copy is transitioning to another state.

    While the copy is in this state, Exchange is verifying that the database and log stream are in a consistent state. It should generally not be in this state for longer than 30 seconds.

    Mounted

    Is online and accepting client connections. Applies only to active mailbox database.

    N/A

    Mounting

    Is coming online and not yet accepting client connections. Applies only to active mailbox database.

    N/A

    Resynchronizing

    Is being checked for any divergence between the active copy and this passive copy.

    The copy status remains in this state until any divergence is detected and resolved.

    Seeding

    Is being seeded, the related content index is being seeded, or both.

    Upon successful completion of seeding, the copy status should change to Initializing.

    Service Down

    Cannot connect to the replication service.

    Start or restart the Microsoft Exchange Replication service on the server that hosts the mailbox database copy.

    Single Page Restore

    Had a single page error, and this error is being corrected automatically.

    N/A

    Suspended

    Is in a suspended state as a result of an administrator manually suspending the database copy.

    Resume replication if appropriate

  3. Tap or click the View Details option for the database copy with which you want to work. This opens a properties dialog box.

  4. Use the information provided to determine the health and status of replication for the database copy. The information provided includes:

    • Database. Displays the name of the selected database

    • Mailbox Server. Displays the name of the Mailbox server that hosts the database copy

    • Content Index State. Displays the status of content indexing for the database copy

    • StatusDisplays the current health and status of replication for the database copy

    • Copy Queue Length. Shows the number of log files waiting to be copied and checked

    • Replay Queue Length. Shows the number of log files waiting to be replayed into this copy of the database

    • Error Messages. Displays any current error status or error message for the database copy

    • Latest Available Log Time. Shows the time associated with the latest available log generated by the active database copy

    • Last Inspected Log Time. Shows the modification time of the last log that was successfully validated by the Mailbox server hosting the database copy

    • Last Copied Log Time. Shows the modification time of the last log that was successfully copied

    • Last Replayed Log Time. Shows the modification time of the last log that was successfully replayed by the Mailbox server hosting the database copy

    • Activation Preference Number. Shows the activation preference value for the database copy

    • Replay Lag Time. Shows the current replay lag time in days, if any

In the Exchange Management Shell, you can check the health and status of replication by using the Get-MailboxDatabaseCopyStatus cmdlet. Get-MailboxDatabaseCopyStatus cmdlet syntax and usage provides the syntax and usage.

Removing database copies

You can remove a passive database copy at any time by using the Exchange Management tools. After removing a database copy, you need to manually delete any database and transaction log files from the server.

Note

You cannot use these procedures to remove the active copy of a mailbox database. To remove a database that is an active copy, you must first switch the database over to a new active copy. Alternatively, if you no longer want a database and its copies, you first need to remove all passive copies, and then you need to remove all mailboxes from the active database before you can delete it.

Tip

You can remove mailbox database copies only from a database availability group with a Healthy status. If the database availability group doesn’t have a Healthy status, you won’t be able to remove any mailbox database copies.

To remove a database copy, complete the following steps:

  1. In the Exchange Admin Center, select Servers in the feature pane, and then select Databases. In the main pane, you should see a list of active databases that are available in the Exchange organization.

  2. Select the mailbox database with the copy that you want to manage. In the details pane, you’ll see a list of active and passive copies of the database along with the current status of each.

  3. Tap or click the Remove option for the database copy you want to remove.

  4. When prompted to confirm, tap or click Yes. If an error occurred, you need to take the appropriate corrective action. Tap or click Close.

In the Exchange Management Shell, you can remove a database copy by using the Remove-MailboxDatabaseCopy cmdlet. Remove-MailboxDatabaseCopy cmdlet syntax and usage provides the syntax and usage.

Before you remove a database using the shell, you may need to identify available copies of the database. To do this, enter the following command:

Get-MailboxDatabase DatabaseName | fl DatabaseCopies

Where DatabaseName is the name of the database you want to work with, such as:

Get-MailboxDatabase Development | fl databasecopies

As shown in this example, the output lists where copies of the database are available:

DatabaseCopies : {DevelopmentMAILSERVER42, DevelopmentMAILSERVER21}

Managing mailbox databases

Now that you know how to create and use databases, let’s look at some general techniques you’ll use to manage databases.

Note

These techniques apply only to active mailbox databases. Passive copies of mailbox databases are managed as discussed in the Working with mailbox database copies section earlier in this chapter.

Mounting and dismounting databases

You can only access databases that are mounted. If a database isn’t mounted, the database isn’t available for use. If a database isn’t mounted it means that an administrator has probably dismounted the database or that the drive on which the database is located isn’t online. It could also mean that the Exchange Information Store service is not running or that the drive, log drive, or both are online but out of disk space.

Real World

A dismounted database can also indicate that there are problems with the database, transaction log, and system files used by the database. During startup, Exchange Server 2013 obtains a list of database files registered in Active Directory and then checks for the related files before mounting each database. If files are missing or corrupted, Exchange Server 2013 will be unable to mount the database. Exchange Server 2013 then generates an error and logs it in the application event log on the Exchange server. A common error is Event ID 9547. An example of this error follows:

The Active Directory indicates that the database file
D:ExchsrvrmdbdataMarketing.edb exists for the Microsoft Exchange
Database; however, no such files exist on the disk.

This error tells you that the Exchange database (Marketing.edb) is registered in Active Directory but Exchange Server 2013 is unable to find the file on the disk. When Exchange Server 2013 attempts to start the corrupted mailbox database, you’ll see an additional error as well. The most common error is Event ID 9519. An example of this error follows:

Error 0xfffffb4d starting database Marketing on the Microsoft
Exchange Information Store.

This error tells you that Exchange Server 2013 couldn’t start the Marketing database. You can try to restore the database to recover its data. If you are unable to restore the database file, you can create a copy of all database files and store them elsewhere and then recreate the database structures in the Exchange Admin Center by mounting the database. When you mount the database, Exchange Server 2013 creates a new database file. As a result, the data in the original database files (and not the copies) is lost and cannot be recovered. Exchange Server 2013 displays a warning before mounting the database and recreating the database file. Tap or click Yes only when you are absolutely certain that you cannot recover the database.

Be sure you don’t overwrite the database files containing the data you want to try to recover. You can still work on the database while users access the newly created empty database. This is effectively a dial-tone database that you are creating. Then, take the damaged database file elsewhere, run repair, make the database consistent, and then use it to complete the dial-tone recovery process.

If you can’t restore or repair a database and you need as much of the data as you can get back, you might have clients in cached or offline mode with viable copies of the data that can be exported and imported.

Determining the status of databases

Mailbox databases have several associated states, including the following:

  • Mounted

  • Backup In Progress

  • Background Database Maintenance

You can determine the status of a database by following these steps:

  1. In the Exchange Admin Center, select Servers in the feature pane, and then select Databases. In the main pane, you should see a list of active databases that are available in the Exchange organization.

  2. Select the mailbox database that you want to work with to see a list of all copies of that database in the details pane. The status of each database copy also is listed in the details pane.

In the Exchange Management Shell, you can determine the status of all databases or specific databases by using the Get-MailboxDatabase. Getting database status details provides the syntax and usage for this cmdlet. To see status details, you can specify the status flags associated with each state you want to see as part of the formatted output. In the example, the Mounted, Backup In Progress, and Background Database Maintenance status values are listed as True or False.

Dismounting and mounting databases

Before you perform maintenance on a Mailbox server in a database availability group, you should perform a server switchover so that the server’s active databases are transitioned and made active on one or more additional servers in the group. You might also want to suspend replication or block activation of passive copies on the server being maintained. For mailbox databases that are not part of an availability group, you should rarely dismount an active database, but if you need to do so, follow these steps:

  1. In the Exchange Admin Center, select Servers in the feature pane, and then select Databases. In the main pane, you should see a list of active databases that are available in the Exchange organization.

  2. Select the mailbox database that you want to copy to see a list of all copies of that database in the details pane. Note the status of the active database copy. If the copy is mounted, the status normally is listed as Active Mounted.

  3. Tap or click the More button (this button shows three dots), and then select Dismount. When prompted, confirm the action by tapping or clicking Yes. Exchange Server dismounts the database. Users will no longer be able to access the database and work with their server-based folders.

After you’ve dismounted a database and performed maintenance, recovery, or other procedures as necessary, you can remount the database by selecting the database, tapping or clicking the More button, and then selecting Mount. When prompted, confirm the action by tapping or clicking Yes.

In the Exchange Management Shell, you can dismount and mount databases by using the Dismount-Database and Mount-Database cmdlets, respectively. Dismounting and mounting databases provides the syntax and usage for these cmdlets.

Specifying whether a database should be automatically mounted

Normally, Exchange Server automatically mounts databases on startup. You can, however, change this behavior. For example, if you’re recovering an Exchange server from a complete failure, you might not want to mount databases until you’ve completed recovery. In this case, you can disable automatic mounting of databases.

To enable or disable automatic mounting of a database, complete the following steps:

  1. In the Exchange Admin Center, select Servers in the feature pane, and then select Databases. In the main pane, you should see a list of active databases that are available in the Exchange organization.

  2. Double-tap or double-click the database with which you want to work.

  3. On the Maintenance page, do one of the following and then tap or click Save:

    1. To ensure that a database isn’t mounted on startup, select the Don’t Mount This Database At Startup check box.

    2. To mount the database on startup, clear the Don’t Mount This Database At Startup check box.

In the Exchange Management Shell, you can enable or disable automatic mounting at startup by using the Set-MailboxDatabase. Controlling automatic mounting provides the syntax and usage for controlling automatic mounting.

Setting the maintenance interval

You should run maintenance routines against databases on a daily basis. The maintenance routines organize the databases, clear out extra space, and perform other essential housekeeping tasks. By default, the automatic background maintenance does some of this work, and Exchange Server runs extended, foreground maintenance tasks daily from 1:00 A.M. to 5:00 A.M. If this conflicts with other scheduled administrative tasks or activities on the Exchange server, you can change the maintenance settings by following these steps:

  1. In the Exchange Admin Center, select Servers in the feature pane, and then select Databases. In the main pane, you should see a list of active databases that are available in the Exchange organization.

  2. Double-tap or double-click the database with which you want to work. This opens a properties dialog box for the database.

  3. On the Maintenance page, note the current Maintenance Schedule, and then select Customize. You can now set the times when maintenance should occur by using the options in the Customize Maintenance dialog box, shown in Figure 3-9.

    A screen shot of the Customize Maintenance Schedule dialog box, showing options to set the maintenance times.
    Figure 3-9. Customize the background maintenance schedule.
    • Times that are used for maintenance are filled in with a dark bar.

    • Times that aren’t used for maintenance are blank.

    Important

    Ideally, you want to schedule background maintenance to occur during off-peak hours. As the size of databases and activity levels change, you’ll want to optimize this schedule to ensure that servers aren’t overburdened and that servers have enough time to perform necessary maintenance tasks.

  4. Show the time in hours or in 15-minute intervals using the options provided. Change the setting for a time interval by tapping or clicking it.

    • Hourly or 15-minute interval buttons are used to select or clear a particular interval for all the days of a week.

    • Days of the week buttons allow you to clear or select all the hours in a particular day.

    • The All button allows you to clear or select all the time periods.

  5. Tap or click OK to close the Customize Maintenance Schedule dialog box.

  6. By default, Exchange performs background maintenance tasks by scanning the ESE 24 hours a day, seven days a week. Select or clear the related check box as appropriate. Note that if you change this setting, you must dismount and then remount the database for the change to take effect. Tap or click OK.

In the Exchange Management Shell, you can configure the maintenance schedule for a database by using Set-MailboxDatabase. Setting the maintenance schedule provides the syntax and usage. In the example, replication is configured to occur between Friday at 9:00 P.M. and Monday at 1:00 A.M.

Moving databases

As discussed earlier, each database has a database file associated with it, and the location of this file has an important role in managing Exchange Server performance. You can view the current file and folder paths the database is using by entering:

Get-MailboxDatabase DatabaseName | fl *path

DatabaseName is the name of the database to check, such as:

Get-MailboxDatabase "Engineering" | fl *path

In the command output, the database file path is listed as EdbFilePath, the log folder path is listed as LogFolderPath and any associated temporary data folder is listed under TemporaryDataFolderPath, as shown in this example:

EdbFilePath             : G:DatabasesEngineeringEngineering.edb
LogFolderPath           : H:LogsEngineering
TemporaryDataFolderPath :

In the Exchange Management Shell, you can move databases by using the Move-DatabasePath cmdlet. Move-DatabasePath cmdlet syntax and usage provides the syntax and usage. If the specified database is mounted, the database is automatically dismounted and then remounted, and it is unavailable to users while it’s dismounted. Additionally, you can perform a database move only while logged on to the affected Mailbox server, with one exception. If you are performing a configuration-only move, you can perform the configuration-only move from your management computer.

You cannot move a database that is being backed up or a replicated mailbox database. To move a replicated mailbox database, you must disable circular logging if enabled, remove all replicated copies, and then perform the move operation. After the move is complete, you can add copies of the mailbox database and re-enable circular logging. You’ll also want to rebuild the content indexes for each copy of the database. To perform these and other related tasks, complete the following steps:

  1. Identify any replay lag or truncation lag settings for all copies of the mailbox database being moved by entering the following command:

    Get-MailboxDatabase DatabaseName | fl *lag*

    DatabaseName is the name of the database that you want to move.

  2. Disable circular logging if the option is enabled by entering the following command:

    Set-MailboxDatabase DatabaseName -CircularLoggingEnabled $false
  3. Identify all copies of the database by entering the following command:

    Get-MailboxDatabase DatabaseName | fl DatabaseCopies
  4. Remove the mailbox database copies by entering the following command for each copy:

    Remove-MailboxDatabaseCopy DatabaseNameServerName

    DatabaseName is the name of the database copy to remove and ServerName is the name of the server.

  5. On each server that hosted a copy of the database, move the data files and log files for the database copy to a local archive folder, such as C:ArchivesDatabase for the database files and C:ArchivesLogs for the log files. This preserves the files on the server so that the database copies don’t need to be reseeded after they have been recreated.

  6. Use the Move-DatabasePath cmdlet to move the database path and log path to a new location. The syntax is:

    Move-DatabasePath -Identity DatabaseName
    -EdbFilePath EdbFilePath -LogFolderPath FolderPath

    During the move operation, the database will be dismounted. When Exchange finishes moving the database, Exchange will automatically mount the database.

  7. On each server that hosted a passive copy of the database, create the required folders for the database and logs. For example, if you moved the database to K:DatabasesEngineeringEngineering.edb, you must create the K:DatabasesEngineering folder on each server. If you moved the log folder to L:LogsEngineering, you must also create the L:LogsEngineering folder on each server. Because the active copy of the database was moved already, you don’t need to create folders for the active copy.

  8. On each server that hosted a passive copy of the database, move the preserved database files to the database folder and then move the preserved log files to the log folder. As the active copy of the database was moved already, you don’t need to move the preserved files for the active database.

  9. Use the Add-MailboxDatabaseCopy cmdlet to add a passive copy of the database to each server that previously hosted a passive copy of the database. The basic syntax is:

    Add-MailboxDatabaseCopy -Identity SourceDatabase
    -MailboxServer TargetServer

    Don’t set any replay lag or truncation lag times yet because you want to ensure the databases are recovered using the local files (and without reseeding).

  10. Recreate the context indexes on each server that hosts an active or passive copy of the database. To do this, use the following commands to stop and then start the Microsoft Exchange Search service:

    Stop-Service MSExchangeSearch
    Start-Service MSExchangeSearch
  11. If you want to enable circular logging of the active copy of the database, enter the following command:

    Set-MailboxDatabase DatabaseName -CircularLoggingEnabled $true
  12. Use the Set-MailboxDatabseCopy cmdlet to reconfigure replay lag and truncation lag times, as appropriate. The basic syntax is:

    Set-MailboxDatabaseCopy -Identity DatabaseServer
    [-ReplayLagTime Days.Hours:Minutes:Seconds]
    [-TruncationLagTime Days.Hours:Minutes:Seconds]

After you’ve completed all these tasks, you should confirm that replication is working as expected by using the Get-MailboxDatabaseCopyStatus cmdlet. You also should use the Test-ReplicationHealth cmdlet to verify the health and status of the database availability group.

Renaming databases

To rename a database, follow these steps:

  1. In the Exchange Admin Center, double-tap or double-click the database with which you want to work. This opens a properties dialog box for the database.

  2. In the Name text box, type the new name for the database. Tap or click Save.

Note

All objects in Active Directory are located by a unique identifier. This identifier uses the directory namespace and works through each element in the directory hierarchy to a particular object. When you change the name of a database, you change the namespace for all the objects in the database.

In the Exchange Management Shell, you can rename databases by using the –Name parameter of the Set-MailboxDatabase. Renaming a database provides the syntax and usage.

Deleting databases

Before deleting a mailbox database, you must delete or move the mailboxes it contains. After you’ve moved items that you might need and deleted items you don’t need, you can delete the database by completing the following steps:

  1. In the Exchange Admin Center, select the database you want to delete, and then select the Delete button.

  2. When prompted, confirm the action by tapping or clicking Yes.

  3. After removing the database, you need to delete any database and transaction log files from the server.

In the Exchange Management Shell, you can delete databases by using the Remove-MailboxDatabase. Removing databases provides the syntax and usage.

Content indexing

Content indexing is a built-in Exchange feature. Every Exchange server in your organization supports and uses some type of indexing. To manage indexing more effectively, use the techniques discussed in this section.

Understanding indexing

Content indexing enables fast searches and lookups through server-stored mailboxes. Exchange Server 2013 uses the content indexing engine from the Microsoft Search Foundation. The Exchange Server storage engine automatically implements and manages Exchange Search. Exchange Search is used with searches for common key fields, such as message subjects. Users take advantage of Exchange Search every time they use the Find feature in Microsoft Office Outlook. With server-based mail folders, Exchange Search is used to quickly search To, From, Cc, and Subject fields. With public folders, Exchange Search is used to quickly search From and Subject fields.

As you probably know, users can perform advanced searches in Office Outlook as well. For example, in Outlook 2010, all users need to do is tap or click in the Search box or press Ctrl+E to access the Search tools, tap or click Search Options, and then tap or click Advanced Find. In the Advanced Find dialog box, users can enter their search parameters and then tap or click Find Now.

When Exchange Server receives an advanced query for personal folders, it searches through every message in every folder. This means that as Exchange mailboxes grow, so does the time it takes to complete an advanced search. With standard searching, Exchange Server is unable to search through message attachments.

With server-based folders, Exchange Server builds an index of all searchable text in a particular mailbox database before users try to search. The index can then be updated or rebuilt at a predefined interval. Then, when users perform advanced searches, they can quickly find any text within a document or attachment.

A drawback of content indexing is that it can be resource-intensive. As with any database, creating and maintaining indexes requires CPU time and system memory, which can affect Exchange performance. Full-text indexes also use disk space. A newly created index uses approximately 10 to 20 percent of the total size of the Exchange database (and is directly related to what’s in the database’s mailboxes). This means that a 1-TB database would have an index of about 100 to 200 GB.

Each time you update an index, the file space that the index uses increases. Don’t worry—only changes in the database are stored in the index updates. This means that the additional disk space usage is incremental. For example, if the original 1-TB database grew by 1 GB, the index could use up to 201 GB of disk space (up to 200 GB for the original index and 1 GB for the update).

Exchange Server 2013 doesn’t allow administrators to configure how indexing works. Full-text indexes are stored as part of the Exchange data files. Because of this, whatever folder location you use for Exchange data files will have an indexing subfolder, which contains all the Exchange Search data for the related database and all its related databases. By default, you’ll find full-text index files for a database in the %SystemDrive%Program FilesMicrosoftExchange ServerV15MailboxDatabaseNameGUID folder where GUID is the database’s globally unique identifier.

Note

Exchange maintains full-text indexes as part of the database maintenance schedule. See the Setting the maintenance interval section earlier in this chapter for more information.

Each database has an index. If you make a database copy, you are also making an index copy. There’s often no need to rebuild an index. That said, as part of the recovery process for a mailbox database, you might want to rebuild the related full-text index catalog to ensure it’s current. You might also want to rebuild the full-text index after you’ve made substantial changes to a database or if you suspect the full-text index is corrupted.

You can rebuild an index manually at any time. Exchange Server rebuilds an index by recreating it. This means that Exchange Server takes a new snapshot of the database and uses this snapshot to build the index from scratch. To manually rebuild an index, enter the following commands to stop and then start the Exchange Search service:

Stop-Service MSExchangeFastSearch
Start-Service MSExchangeFastSearch

Exchange Discovery relies on Exchange Search for databases and mailboxes within databases. You can enable or disable indexing for individual databases by setting the -IndexEnabled parameter of the Set-MailboxDatabase cmdlet to $true or $false, respectively. The following example disables indexing of the Engineering database:

Set-MailboxDatabase "Engineering Database" -IndexEnabled $false

When you disable indexing of a database, you also prevent the Exchange 2013 Discovery feature from returning messages from the database or server.

You can disable indexing for all databases on a server by stopping and disabling the Microsoft Exchange Search service. Here’s an example using the Exchange Management Shell in which you stop and disable the Exchange Search service on a remote server named Server18:

Stop-Service MSExchangeFastSearch -ComputerName Server22
Set-Service MSExchangeFastSearch -StartupType Disabled -ComputerName Server22

You can enable indexing for all databases on a server by enabling the Microsoft Exchange Search service for automatic startup and starting the service. An example using the Exchange Management Shell follows:

Set-Service MSExchangeFastSearch -StartupType Automatic -ComputerName Server18
Start-Service MSExchangeFastSearch -ComputerName MailServer11

When you disable indexing on a server, you also prevent Exchange Discovery for all databases on the server.

Troubleshooting indexing

You can quickly determine which databases have indexing enabled by using the following command:

Get-MailboxDatabase | ft Name,IndexEnabled

You can determine whether content indexing has a healthy status by using the following command:

Get-MailboxDatabaseCopyStatus | ft Identity, ActiveDatabaseCopy,
ContentIndexState -Auto

If you find that the context index for a passive database copy is outdated, you can rebuild or reseed the index. To reseed the index, enter the following command:

Update-MailboxDatabaseCopy -Identity DatabaseServer -CatalogOnly

Database is the name of the database and Server is the name of the server hosting the database, such as:

Update-MailboxDatabaseCopy -Identity EngineeringMailServer12 -CatalogOnly

If you need to troubleshoot Exchange Search issues, you can use Test-Exchange Search. When you use the -Server parameter to specify the name of a server to check, the cmdlet tests all mailbox databases on the server simultaneously. If the server is a member of a DAG and has a passive copy of a database, the test is automatically performed against the server that has the active database copy.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset