Search
Enterprise

Microsoft Exchange Server 2010 : Managing Mailbox and public Folder Databases (part 2) - Moving Databases

Published 4 min readBy Programming4us Editorial Team

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 activities on the Exchange server, you can change the maintenance settings by following these steps:

  1. In the Exchange Management Console, right-click the database you want to work with, and then select Properties.

  2. On the Maintenance tab in the Properties dialog box, use the Maintenance Schedule list to set a new maintenance time. Select a time (such as Run Daily From 11:00 P.M. To 3:00 A.M.).

    If you want to set a custom schedule, select Use Custom Schedule, and then click Customize. You can now set the times when maintenance should occur.

  3. By default, Exchange performs background maintenance tasks by scanning the ESE 24 hours a day, 7 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. Click OK.

Tip

If you want to set a custom schedule, select Use Custom Schedule, and then click Customize. You can now set the times when maintenance should occur.

In the Exchange Management Shell, you can configure the maintenance schedule for a database by using the Set-MailboxDatabase and Set-PublicFolderDatabase cmdlets. Example 4 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.

Example 4. Setting the maintenance schedule

Syntax

Set-MailboxDatabase -Identity DatabaseIdentity
[-MaintenanceSchedule Schedule]
[-BackgroundDatabaseMaintenance <$true | $false>]

Set-PublicFolderDatabase -Identity DatabaseIdentity
-MaintenanceSchedule Schedule

Usage

Set-MailboxDatabase -Identity "Eng DB"
-MaintenanceSchedule "Fri.9:00 PM-Mon.1:00 AM"

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 change the database file and log locations by completing the following steps:

  1. In the Exchange Management Console, expand the Organization Configuration node, and then select the related Mailbox node.

  2. On the Database Management tab, right-click the database you want to move, and then select Move Database Path from the shortcut menu. You should now see the Move Database Path Wizard, as shown in Figure 1.

  3. On the Move Database Path page, the current database file path and log folder path are shown. Enter the desired paths for the database file and the related logs using the text boxes provided.

    Note

    The wizard creates any required folders on the server if they do not exist.

  4. Click Move. Exchange validates the paths you've provided and then moves the files. Click Finish when this process completes.

Move the database and its backup to new locations.

Figure 1. Move the database and its backup to new locations.

Note

You cannot move a database that is being backed up or a replicated mailbox database. To move a replicated mailbox database, you must first remove all replicated copies and then perform the move operation. After the move is complete, you can add copies of the mailbox database.

If the specified database is mounted, the database is automatically dismounted and then remounted, and it is unavailable to users while it's dismounted. Whether you are using the exchange Management Console or the exchange Management Shell, 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.

In the Exchange Management Shell, you can move databases using the Move-DatabasePath cmdlet. Example 5 provides the syntax and usage.

Example 5. Move-DatabasePath cmdlet syntax and usage

Syntax

Move-DatabasePath -Identity DatabaseIdentity
[-ConfigurationOnly <$true | $false>] [-EdbFilePath EdbFilePath]
[-DomainController DCName] [-Force <$true | $false>]
[-LogFolderPath FolderPath]

Usage

Move-DatabasePath -Identity "Sales Projects"
-EdbFilePath "K:\Databases\SalesProjects.edb"

Renaming Databases

To rename a database, follow these steps:

  1. In the Exchange Management Console, right-click the database, and then select Properties.

  2. In the Properties dialog box, type the new name for the database. Click OK.

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 using the –Name parameter of the Set-MailboxDatabase and Set-PublicFolderDatabase cmdlets. Example 6 provides the syntax and usage.

Example 6. Renaming a database

Syntax

Set-MailboxDatabase -Identity DatabaseIdentity
-Name NewName

Set-PublicFolderDatabase -Identity DatabaseIdentity
-Name NewName

Usage

Set-MailboxDatabase -Identity "Eng DB"
-Name "Engineering Mail Database"

Deleting Databases

Before deleting a mailbox database, you must delete or move the mailboxes it contains. After you do this, you can delete the database. With public folders, public folder data is replicated between or among the public folder databases automatically once you set up replicas. As long as all data has been replicated and you've verified this, you can remove a public folder database from a Mailbox server without losing data. However, because each Mailbox server can have only one public folder database, you need to create a new public folder database if you want to ensure that users with mailboxes on the server can access the local public folder replica.

After you've moved items that you might need, you can delete the database by completing the following steps:

  1. In the Exchange Management Console, right-click the database you want to delete, and then select Remove from the shortcut menu.

  2. When prompted, confirm the action by 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 and Remove-PublicFolderDatabase cmdlets. Example 7 provides the syntax and usage.

Example 7. Removing databases

Syntax

Remove-MailboxDatabase -Identity DatabaseIdentity
[-DomainController FullyQualifiedName]

Remove-PublicFolderDatabase -Identity DatabaseIdentity
[-DomainController FullyQualifiedName]
[-RemoveLastAllowed <$true | $false>]

Usage

Remove-MailboxDatabase -Identity "Eng DB"