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 and to
public folder databases.
Mounting and Dismounting Databases
You can access only databases that are mounted. If a database isn't
mounted, the database isn't available for use. This 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.
Note
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 2010 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 2010
will be unable to mount the database. Exchange Server 2010 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:\Exchsrvr\mdbdata\Marketing.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 2010 is unable to
find the file on the disk. When exchange Server 2010 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 2010 couldn't start the
Marketing database. If you are unable to restore the database
file, you can create a copy of all database files and store them
elsewhere and then re-create the database structures in the exchange
Management Console by mounting
the database. When you mount the database, exchange Server 2010 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 2010 displays a warning before mounting the database and
re-creating the database file. 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 and public folder databases have several associated states, including
You can determine the status of a database by following these steps:
-
In the Exchange Management Console, expand the Organization Configuration node, and then select the related Mailbox node. -
On the Database Management tab, you should see a list of available
databases. The icon to the left of the database name indicates the
mount status. If the icon shows a gray down arrow, the database isn't
mounted. If the icon shows a question mark, the database is in an
unknown state. If the database shows a mailbox or folder, the database
is mounted. -
To determine the status of the database, right-click the database,
and then select Properties. In the Properties dialog box, the status is
listed on the General tab.
In the Exchange Management Shell, you can determine the status of all databases or specific databases using the Get-MailboxDatabase and Get-PublicFolder-Database cmdlets. Example 1
provides the syntax and usage for these cmdlets. 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,
Dismounted, Backup In Progress, Online Maintenance In Progress, and
Replication In Progress status values are then listed as True or False.
Example 1. Getting database status details
Syntax
Get-MailboxDatabase [-Identity MailboxDatabase | -Server Server ] [-DomainController DCName ] [-DumpsterStatistics <$true | $false>] [-IncludePreExchange2010 <$true | $false>] [-Status <$true | $false>] | format-table Name, Mounted, BackupInProgress, OnlineMaintenanceInProgress
Get-PublicFolderDatabase [-Identity PublicFolderDatabase | -Server Server ] [-DomainController DCName ] [-IncludePreExchange2010 <$true | $false>] [-Status <$true | $false>] | format-table Name, Mounted, BackupInProgress, OnlineMaintenanceInProgress, ReplicationInProgress
Usage for specific database and server
Get-MailboxDatabase -Identity "Eng DB" -Status | format-table Name, Mounted, BackupInProgress, OnlineMaintenanceInProgress
Usage for all databases on a server
Get-MailboxDatabase -Server "CORPSVR127" -Status | format-table Name, Mounted, BackupInProgress, OnlineMaintenanceInProgress
Usage for all databases
Get-MailboxDatabase -Status | format-table Name, Mounted, BackupInProgress, OnlineMaintenanceInProgress
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 other servers in the group. You might also want to suspend
replication or block activation of passive copies on the server being
maintained. For public folder databases or 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:
-
In the Exchange Management Console, expand the Organization Configuration node, and then select the related Mailbox node. -
On the Database Management tab, you should see a list of available
databases. The icon to the left of the database name indicates the
mount status. If the icon shows a gray down arrow, the database is
already dismounted. -
Right-click the database you want to dismount, select Dismount
Database, and then confirm the action by 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 right-clicking the database in the Exchange Management
Console and then selecting Mount Database.
In the Exchange Management Shell, you can dismount and mount databases using the Dismount-Database and Mount-Database cmdlets, respectively. Example 2 provides the syntax and usage for these cmdlets.
Example 2. Dismounting and mounting databases
Syntax
Dismount-Database -Identity DatabaseIdentity [-DomainController FullyQualifiedName ]
Mount-Database -Identity DatabaseIdentity
[-AcceptDataLoss <$true | $false>] [-DomainController FullyQualifiedName ]
[-Force <$true | $false>]
Usage for dismounting a database
Dismount-Database -Identity "Eng DB"
Usage for mounting a database
Mount-Database -Identity "Eng DB"
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:
-
In the Exchange Management Console, expand the Organization Configuration node, and then select the related Mailbox node. -
On the Database Management tab, right-click the database you want to work with, and then select Properties. -
On the Maintenance tab, do one of the following and then click OK:
-
To ensure that a database isn't mounted on startup, select the Don't Mount This Database At Startup check box. -
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 using the Set-MailboxDatabase and Set-PublicFolderDatabase cmdlets. Example 3 provides the syntax and usage for controlling automatic mounting.
Example 3. Controlling automatic mounting
Syntax
Set-MailboxDatabase -Identity DatabaseIdentity -MountAtStartup <$true | $false>
Set-PublicFolderDatabase -Identity DatabaseIdentity -MountAtStartup <$true | $false>
Usage
Set-MailboxDatabase -Identity "Eng DB" -MountAtStartup $false
|