36
Exchange Server Mailbox Database Sašo Erdeljanov s.p. [email protected] MVP Exchange Server E-mail: [email protected]

Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. [email protected] MVP – Exchange Server E-mail: [email protected]

  • Upload
    vodiep

  • View
    226

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Exchange Server Mailbox Database

Sašo Erdeljanov s.p. [email protected] MVP – Exchange Server E-mail: [email protected]

Page 2: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Mailbox Database

File Type Purpose

<Log Prefix>.chk Checkpoint file

<Log Prefix>.log Current transaction log file

<Log Prefix>xxxxxxxx.log Transaction log file that was already renamed and filed

<Log Prefix>res00001.jrs Reserved transaction logs

<Log Prefix>res00002.jrs Reserved transaction logs

Tmp.edb Temporary workspace for processing transactions

<Log Prefix>tmp.log

Transaction log file for the temporary workspace

<File Name>.edb Rich text database files that stores content for mailbox and public folder databases

Page 3: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Backup

• VSS Exchange aware

− Windows Backup, Microsoft DPM, 3rd party

• Active Directory

− DC systemstate

Page 4: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Restore

• Database

• Single Mailbox

• Dial Tone recovery & database swap

Page 5: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info
Page 6: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Before Exchange Server 2010

• Online Maintenance

Page 7: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Maintenance Tasks

• Purge mailbox database and public folder database indexes

− Remove Expired Indexes (40 days)

• Maintain tombstones

• Clean up the deleted items dumpster

• Remove public folders that have exceeded the expiry time

• Remove deleted public folders that have exceeded the tombstone lifetime

• Clean up conflicting public folder messages (180 days)

• Update server versions

• Clean up deleted mailboxes

• Check message table for orphaned messages

• Clean up reliable event tables

Page 8: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Event IDs

• 700 Starting

• 701 Completed

• 702 Resuming

• 703 Completed Resumed Pass

• 704 Interrupted and Terminated

• 1221 Whitespace Amount

Page 9: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Event IDs

Page 10: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Exchange 2010

• New ESE Functionality

− Larger I/O and sequential I/O to reduce IOPS

− Optimization for commodity storage

− Database management reduction

− Online defragmentation

− Online database scanning

Page 11: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Database Maintenance

• Database maintenance is divided into the following: − Store mailbox maintenance

− ESE database maintenance

• Exchange 2007 vs Exchange 2010 − ESE database maintenance was disk-intensive in E12

− In Exchange 2010, on large or very heavy profile servers, the store mailbox maintenance task only lasts approximately 45 minutes, while ESE database maintenance usually took from six to eight hours per night to complete on large Exchange 2007 databases.

Page 12: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Database Maintenance

• Exchange Store-focused online database maintenance functions (recovery item cleanup) are same in Exchange 2010 and Exchange 2007.

• Only ESE functions, online defragmentation, and database checksumming have changed.

Page 13: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Online Defragmentation

• Online defragmentation now runs in the background 24×7

− Throttled

• Whitespace?

• Get-MailboxDatabase BAZA -Status

| FL AvailableNewMailboxSpace

Page 14: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Online Database Scanning

• = Database checksumming

• I/O is 100 percent sequential

• Exchange 2010 is designed with the expectation that every database is fully scanned once every three days (warning!)

• Two modes: − Run as the last task in the scheduled Mailbox Database

Maintenance process (OK for small DB)

− Run in the background 24×7 (default) − No more than once per day

− Fire a warning event if it can't finish scanning in a seven day period

Page 15: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Mailbox Database

File Type Purpose

<Log Prefix>.chk Checkpoint file

<Log Prefix>.log Current transaction log file

<Log Prefix>xxxxxxxx.log Transaction log file that was already renamed and filed

<Log Prefix>res00001.jrs Reserved transaction logs

<Log Prefix>res00002.jrs Reserved transaction logs

Tmp.edb Temporary workspace for processing transactions

<Log Prefix>tmp.log

Transaction log file for the temporary workspace

<File Name>.edb Rich text database files that stores content for mailbox and public folder databases

Page 16: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Mailbox Database

Page 17: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Recover Database

• Restore database from backup (+tlogs)

• Worst-case scenario: − Repair database

− Data Loss

Page 18: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Problems and Tools

• Problems: − Dirty Shutdown

− Required Logs not Available

− Page Errors

• Tools: − ESEUtil

− Isinteg, New-MailboxRepairRequest

Page 19: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

ESEUtil Modes

• Repair

• Defragmentation

• File Dump

• Recovery

• Integrity

• Restore

• Checksum

• Copy File

Page 20: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Repair (eseutil /p)

• Discards bad pages

• Reconstructs tables from remaining data

• Repairs system tables

• Makes an inconsistent database consistent − This will always cause some data loss

• If leaving a database in production after repair, you MUST: − Run offline defragmentation to rebuild space trees and

indexes

− Run ISINTEG, New-MailboxRepairRequest

Page 21: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Defragmentation (eseutil /d)

• Database files are copied to a temporary database

• At end of process, temporary file is copied over the original file

• All indexes and space trees are discarded

• Pages are renumbered and page links updated

• Checksums are updated for moved pages

Page 22: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Isinteg, New-MailboxRepairRequest

• Isinteg: − Exchange Server 2003

− Exchange Server 2007

− Exchange Server 2010 RTM

• New-MailboxRepairRequest − Exchange Server 2010 SP1

Page 23: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

New-MailboxRepairRequest

• Detect and fix mailbox corruptions

• Run against a specific mailbox or database

• Mailbox access is disrupted only for the mailbox being repaired

New-MailboxRepairRequest -Mailbox saso -CorruptionType

ProvisionedFolder,SearchFolder,AggregateCounts,Foldervi

ew –Archive

New-MailboxRepairRequest -Database MBX-DB01 -

CorruptionType AggregateCounts

Page 24: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info
Page 25: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

RBAC & Permissions

• No one is granted by default

• Mailbox Import Export management role

• New-ManagementRoleAssignment -

Name "Import Export Mailbox

Admins" -SecurityGroup "IE

Skupina" -Role "Mailbox Import

Export„

• EMS or ECP...

Page 26: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Cmdlets (1)

• New-MailboxImportRequest & New-MailboxExportRequest − import/export all/some data from a mailbox/online

archive mailbox to PST

− Limit 10 requests per mailbox (<alias>\MailboxExportX (where X = 0–9) − Remove old requests

− Unique name for new requests

− No duplicates

Page 27: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

New-MailboxImportRequest Samples

• Import Inbox to target folder: New-MailboxImportRequest -Mailbox sasoe -

FilePath \\streznik\mapa\sasoe_inbox.pst -

TargetRootFolder "ImportInbox" -

IncludeFolders "#Inbox#"

• Import to Online Archive: New-MailboxImportRequest -Mailbox sasoe -

IsArchive -FilePath

\\streznik\mapa\sasoe_stare_zadeve.pst

Page 28: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

New-MailboxExportRequest Samples

• Export Mailbox: New-MailboxExportRequest -Mailbox sasoe -FilePath

"\\streznik\mapa\saso.pst"

• Export Online Archive: New-MailboxExportRequest -Mailbox sasoe -FilePath

"\\streznik\mapa\saso_arhiv.pst" -IsArchive

• Export Mailbox + Filter: New-MailboxExportRequest -Mailbox sasoe -ContentFilter

{(body -like "*slowug*") -and (body -like

"*prezentacije*") -and (Received -lt "01/01/2010")} -

FilePath "\\streznik\mapa\sasoe_tmp.pst"

• Export Inbox: New-MailboxExportRequest -Mailbox sasoe -IncludeFolders

"#Inbox#" -FilePath "\\streznik\mapa\sasoe_inbox.pst"

Page 29: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Cmdlets (2)

• Import − Get-MailboxImportRequest

− Get-MailboxImportRequestStatistics

− Remove-MailboxImportRequest

− Set-MailboxImportRequest

− Suspend-MailboxImportRequest

− Resume-MailboxImportRequest

• Export − Get-MailboxExportRequest

− Get-MailboxExportRequestStatistics

− Set-MailboxExportRequest

− Remove-MailboxExportRequest

− Suspend-MailboxExportRequest

− Resume-MailboxExportRequest

Page 30: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info
Page 31: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Calendar Repair Assistant (1)

• Why? Users! Apps!

• Configurable mailbox assistant − Microsoft Exchange Mailbox Assistants service

(Mailbox Server)

• Automatically detects and corrects inconsistencies with single and recurring meeting items

• By Default off

Page 32: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Calendar Repair Assistant Tasks

• Detects inconsistencies − Uses the organizer's copy of the calendar item as a

master copy for all meeting items

• Determines if inconsistencies were intentional − An attendee can introduce an inconsistency by deleting

the meeting request and not notifying the organizer

• Corrects inconsistencies − Calendar Repair Assistant corrects inconsistencies on

the Mailbox server on which it runs

− merges the information so data isn't lost

Page 33: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Calendar Repair Assistant Tasks

• Sends a calendar repair update message if a correction was made − Sent to users whose calendar items were updated

− Message to the user's Deleted Items folder − Troubleshooting purposes

− Only sends repair update messages if the issue is fixed − Logs

Page 34: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Calendar Repair Log

• Writes the change to a calendar repair log file

• Output log file doesn't reveal personal data

• Path: <Exchange Installation Path>\v14\Logging\Calendar Repair Assistant

• Log Structure & Naming Convention:

CRAYYYYMMDDHH-X.Alias.log CRA = Calendar Repair Assistant prefix YYYY = year MM = month DD = day HH = hour X = instance Alias = mailbox alias

Page 35: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

cmdlets

• Get-MailboxServer SERVER | fl

*calendar*

• Set-MailboxServer

• Set-MailboxServer -Identity

Exchange -CalendarRepairSchedule

"Thursday.7:00 PM-Thursday.07:50

PM"

Page 36: Exchange Server 2007 - sbsc.si€¦ · Exchange Server Mailbox Database Sašo Erdeljanov s.p. saso@mreza.info MVP – Exchange Server E-mail: saso@mreza.info

Q&A