Sun Java System Messaging Server 6 2005Q4 Administration Reference

reconstruct

The reconstruct utility rebuilds one or more mailboxes, or the master mailbox file (the mailboxes database), and repairs any inconsistencies. You can use this utility to recover from almost any form of data corruption in the message store.

A mailbox consists of files under the user partition directory. The mailboxes database is the mboxlist database.

Requirements: Must be run locally on the messaging server; the stored utility must also be running.

Location: msg_svr_base/sbin/

Syntax


reconstruct [-n | -f] [-i] [-e] [-p partition] 
{-r [ mailbox...] | mailbox...}

reconstruct [-p partition [ -u user ] ] -m

reconstruct -l
reconstruct -q

Options

The options for this command are:

Option  

Description  

-f

Forces reconstruct to perform a fix on the mailbox or mailboxes.

-l

Reconstruct lright.db.

-e

Removes the store.exp file before reconstructing. This eliminates any internal store record of removed messages which have not been cleaned out by the store process.

Running a reconstruct -e will not recover removed messages if reconstruct does not detect damage. A -f will force the reconstruct and -e to take effect, removing the store.exp file.

-i

Sets the store.idx file length to zero before reconstructing. 

Running a reconstruct -e will not recover removed messages if reconstruct does not detect damage. A -f will force the reconstruct and -e to take effect, removing the store.exp file.

-m

Performs a consistency check and, if needed, repairs the mailboxes database. This option examines every mailbox it finds in the spool area, adding or removing entries from the mailboxes database as appropriate. The utility prints a message to the standard output file whenever it adds or removes an entry from the database. 

-n

Checks the message store only, without performing a fix on the mailbox or mailboxes. The -n option cannot be used by itself, unless a mailbox name is provided. When a mailbox name is not provided, the -n option must be used with the -r option; the -r option may be combined with the -p option. For example, any of the following commands are valid:


reconstruct -n user/dulcinea/INBOX
reconstruct -n -r
reconstruct -n -r -p primary
reconstruct -n -r user/dulcinea/

-p partition

The -p option is used with the -m option and limits the scope of the reconstruction to the specified partition. If the -p option is not specified, reconstruct defaults to all partitions. Specifically it fixes folder.db and quota.db, but not lright.db. This is because fixing the lright.db requires scanning the acls for every user in the message store. Performing this for every partition is not very efficient. To fix lright.db run reconstruct -l.

Specify a partition name; do not use a full path name. 

-q

Fixes any inconsistencies in the quota subsystem, such as mailboxes with the wrong quota root or quota roots with the wrong quota usage reported. The -q option can be run while other server processes are running.

-r [mailbox]

Repairs and performs a consistency check of the partition area of the specified mailbox or mailboxes. The -r option also repairs all sub-mailboxes within the specified mailbox. If you specify -r with no mailbox argument, the utility repairs the spool areas of all mailboxes within the user partition directory.

-u user

The -u option is used with the -m option and limits the scope of the reconstruction to the specified user. The -u option must be used with the -p option. If the -u option is not specified, reconstruct defaults to all partitions or to the partition specified with the -p option.

Specify a user name; do not use a full path name. 

The mailbox argument indicates the mailbox to be repaired. You can specify one or more mailboxes. Mailboxes are specified with names in the format user/userid/sub-mailbox, where userid is the user that owns the mailbox. For example, the inbox of the user dulcinea is entered as: user/dulcinea/INBOX.

Examples

The following command performs a reconstruct on a specific mailbox:


reconstruct user/dulcinea/INBOX

The following checks the specified mailbox, without performing a reconstruct:


reconstruct -n user/dulcinea/INBOX

The following command checks all mailboxes in the message store:


reconstruct -n -r