Skip Headers
Oracle® Mail Administrator's Guide
10g Release 1 (10.1.1)

Part Number B14491-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

10 Backing Up and Recovering Oracle Mail

This chapter describes how to back up and recover Oracle Mail.

This chapter includes the following topics:

Overview of Oracle Mail Backup and Recovery

Disaster planning is a critically important aspect of administering an e-mail system. System files and the Oracle Collaboration Suite Database itself must be backed up regularly using the standard Oracle database tools in order to be able to recover all or part of the e-mail system and data if a disaster occurs.

In addition to the standard database backup and recovery tools, the following processes and tools allow you to backup and recover data on a more granular level:

Backing Up and Recovering the Oracle Collaboration Suite Database

Oracle Mail uses an Oracle database as its information storage database, so standard database backup and recovery methods can be used to maintain copies of the most current contents of the e-mail system. It is important to perform a full system backup at regularly scheduled times so that the entire Oracle Mail system can be restored to that snapshot if needed. Partial backups of the system can be performed between full backups so that the system can be recovered to a more recent point in time.

Oracle Collaboration Suite Database backup methods include:

Backing Up and Restoring User Data with oesbkp

Individual e-mail users are categorized into two states:

Individual e-mail user accounts can be backed up and restored using the oesbkp command-line utility. oesbkp restores backed-up items at different levels of granularity. For example, you can restore either an entire user account or a single folder, which is particularly useful for backing up and restoring critical information.

Note:

The backup and restore functionality cannot be applied to inactive users.

To back up inactive users, make them temporarily active, perform the back up, and return the users to their inactive status.

oesbkp backs up the following user data into flat files:

When restoring user accounts:

Using oesbkp

The oesbkp syntax is as follows:

oesbkp task={backup | restore} user=userid@domain password=admin_password 
[type={all | mail | rules | addrbook}] [admindn=database_account_with_admin_
privileges] [ldaphost=host_name] [ldapport=port_number] [backupdir=directory]
[folder=folder_name]

Table 10-1 lists oesbkp parameters and definitions.

Table 10-1 oesbkp Parameters

Parameter Name Valid Values Default Value Description
task

{backup | restore}

None

Indicates whether this is a backup or restore request

user

Fully-qualified username

None

Fully-qualified name, including the domain, of the user being backed up or restored. For example a valid value is user@domain.com, whereas user@domain and user are not valid values.

password

Any string

None

Password for the distinguished name (DN)

type

{all | mail | rules | addrbook}

all

Indicates the objects to be backed up or restored: all (folders, messages, server-side rules, and address book entries); messages only; server-side rules only; or address book entries only.

admindn

Any valid DN for the LDAP server

cn=orcladmin

DN that the tool uses to bind to the LDAP server. The DN should have admin privileges, such as orcladmin and umadmin.

ldaphost

Any host name

localhost

Name of the host where Oracle Internet Directory is installed

ldapport

Any integer

389

Port on which Oracle Internet Directory is listening

backupdir

Any valid directory

user.dir

Location where the backup is being created or restored from

folder

Any folder name

None

Name of the folder to be backed up or restored. If no value is specified, then all available folders are backed up or restored.


Note:

When maintaining multiple backups for a particular user, ensure that each backup is named uniquely to avoid overwriting files.

Note the following information regarding oesbkp parameters:

Logging information for oesbkp is stored in:

$ORACLE_HOME/oes/log/um_system/backup/number/text.log

where number is generated by the system and does not represent a process ID or other such number.

oesbkp creates the following backup files:

where:

Folders are restored in subfolders in the following user account folder:

restore_dd-Mon-yyyy hh24:mi/subfolder_name

where subfolder_name is the same name as the original folder being restored, and dd-Mon-yyyy hh24:mi shows when the restore occurred (not when the backup occurred).

If a user is over quota when the backup is performed, the over-quota messages are also backed up. If a user's folder is being restored and the messages in the folder cause it to go over quota, the restore does not occur. Check the oesbkp log files to view the user's current quota and usage, and if necessary, increase the user's quota before restoring messages.

The following example shows how to create a full backup of all folders, messages, and private address book entries for john@acme.com in the /bkp/allbkps directory:

oesbkp task=backup type = all user=john@acme.com admindn=cn=orcladmin 
password=abcd ldaphost=ldap.acme.com ldapport=4032 backupdir=/bkp/allbkps

The folders created in the /bkp/allbkps directory are:

john@acme.com_rules.xml john@acme.com_addrbook.ldif john@acme.com_foldermap 
john@acme.com_1 john@acme.com_2

The following example shows how to restore the messages to the inbox of john@acme.com from the backup stored in the /bkp/allbkps directory:

oesbkp task=restore type=mail user=john@acme.com password=abcd 
backupdir=/bkp/allbkps folder=inbox

In this example, if the restore is performed at 2:00 AM on March 17, 2003, the messages are restored in a new folder in John's account named inbox, which is a subfolder of restore_17-Mar-2003 02:00.

Recovering Messages with LogMiner

Database redo logs record all changes made to data. If a failure prevents modified data from being permanently written to the data files, the changes can be obtained from the redo logs using the Oracle Database 10g LogMiner feature. With LogMiner, you can use SQL to read, analyze, and interpret log files.

Whenever an Oracle Mail message is deleted, the change in data is recorded in a database redo log. With LogMiner, you can retrieve deleted messages from the redo logs.

To fully translate the contents of redo logs, LogMiner requires access to a database dictionary. Without the database dictionary, LogMiner returns internal object identifiers and presents data in hexadecimal. A LogMiner dictionary file contains information that identifies the database from which it was created and the time it was created. The data dictionary must be extracted prior to using LogMiner to recover Oracle Mail messages.

If you want to use LogMiner recovery, any and every Housekeeper process instance must have the Support Log Miner Recovery parameter enabled.

See Also:

"Process Control Message Cleanup" for information about setting up LogMiner to recover messages

See Also:

The following documents for information about LogMiner:
  • Oracle Database Concepts

  • Oracle Database Administrator's Guide

Recovering Messages with Oracle Flashback Query

This section contains the following topics:

Using Oracle Flashback Query to Recover Messages

Oracle Mail users and administrators can recover messages deleted as of a certain time using the Oracle Flashback Query feature. The flashback query-based e-mail recovery applies to e-mail messages transferred to another folder. Oracle Flashback Query creates a snapshot of the database at a certain point in time, from which an Oracle Mail user can recover all messages that are in a particular folder at a specific point in time.

Oracle Flashback Query uses the retention control functionality provided by the Automatic Undo Management feature of the Oracle Collaboration Suite Database. The database maintains information that is used to roll back, or undo, changes to the database. Undo information consists of records of the actions of transactions, primarily before they are committed. Retention control enables you to specify the minimum period of time for which database undo information is saved before the space is overwritten by newer transactions.

When an Oracle Mail message is deleted, a record is created in the database undo logs. When Oracle Flashback Query retrieves the deleted message, the message is restored from the undo logs. The longer the undo information is retained, the older the deleted messages Oracle Mail users can retrieve using Oracle Flashback Query. A message can be recovered only if retention control is enabled and the message was deleted within the specified retention period.

The length of time for which database undo information is retained depends upon the amount of available disk space, the amount of e-mail traffic going through the Oracle Mail system, and the user activity on the system. The longer the undo information is retained or the heavier the activity on the e-mail system, the more disk space is required. An Oracle Mail system that receives a large number of messages each day requires more disk space to retain undo information than a system that receives just a few messages each day.

See Also:

Oracle Database Administrator's Guide for information about managing undo spaces, choosing the retention period for flashback queries, and calculating undo retention space requirements

Deleted messages can be retrieved with Oracle Flashback Query using the Microsoft Outlook client connecting to Oracle Mail through Oracle Connector for Outlook. Recovered messages are recovered to the folder of the user's choice. Flashback recovery by Oracle Mail through the Oracle Connector for Outlook can be enabled or disabled using the Oracle WebMail client administration pages.

See Also:

Oracle Connector for Outlook Online Help for more information on recovering messages using Microsoft Outlook through the Outlook Connector

Administrators can also use the PL/SQL package MAIL_RECOVERY_FQ to recover messages for a user using Oracle Flashback Query.

Recovered messages are included in quota calculations. If a user's quota is exceeded during flashback recovery, no additional messages are recovered.

A message can be recovered even if it exists in a different folder. For example, if a message was moved from a user's Inbox to FolderA and the user decided to recover the moved message into RecoverInbox, a pointer to the message would be created in RecoverInbox.

If a user tries to recover a message that already exists in the destination folder, the message retrieval fails. For example, if the message already exists in RecoverInbox and the user tries to recover that message into RecoverInbox, the recovery is not performed.

To set up Oracle Flashback Query:

  1. Ensure that the Oracle Collaboration Suite Database is using an undo tablespace. By default, an undo tablespace is created during the installation of Oracle Collaboration Suite 10g.

  2. Set the retention time:

    ALTER SYSTEM SET UNDO_RETENTION=time_in_seconds
    
    

    For example, to retain undo information for at least 3 hours, set the UNDO_RETENTION parameter as follows:

    ALTER SYSTEM SET UNDO_RETENTION=10800
    

    Note:

    The UNDO_RETENTION parameter can be set in the initialization parameter file.
  3. Optional: To enable e-mail users to use the Oracle Flashback Query feature to recover deleted messages through the Microsoft Outlook client (this requires e-mail users to use Oracle Connector for Outlook):

    1. Open the Oracle WebMail client.

      See Also:

      "The Oracle Collaboration Suite 10g WebMail Client" for information about how to access the Oracle WebMail client
    2. Click the Administration tab. The Domain subtab displays by default.

    3. Click Domain Settings.

    4. Select an installation from the Installation drop-down list.

    5. Select a domain from the Domain drop-down list.

    6. Click Submit.

    7. Select enable from the Flashback Mail Recovery drop-down list.

    8. Click Submit to apply the changes.

    9. Open the Application Server Control Console for Collaboration Suite.

      See Also:

      "Oracle Enterprise Manager 10g Application Server Control Console for Collaboration Suite" for information about accessing the Application Server Control Console for Collaboration Suite
    10. Click the application server instance where Oracle Mail is installed.

    11. Click Mail Application in the System Components section to display the Mail Application page.

    12. Select the IMAP Server process and click Restart.

To recover messages:

  1. Run SQL*Plus.

  2. Log on as es_mail user.

  3. Execute the mail_recovery_fq.get_recover_messages procedure.

    For example, run the following to recover all deleted messages in the last 30 minutes for a specified user into a newly created folder, named recovbox, without performing any quota check.

    mail_recovery_fq.get_recover_messages('emailid_of_user_without_domain', 'email_domain_of_user', 30, 0, NULL, 0, recovbox);
    

MAIL_RECOVERY_FQ Package

The MAIL_RECOVERY_FQ package retrieves deleted messages from one or all of a user's folders as of a specified point in time. The syntax is as follows:

mail_recovery_fq.get_recover_messages(
p_usernameVARCHAR2,
p_domainnameVARCHAR2,
p_int_in_minsNUMBER,
p_quotaNUMBER,
p_fromfolderVARCHAR2,
p_checksubfldrsNUMBER,
p_tofolderVARCHAR2)

Table 10-2 lists parameters and descriptions for the get_recover_messages procedure.

Table 10-2 get_recover_messages Parameters

Parameter Description
p_username

User ID of the account from which to recover e-mail

p_domainname

Domain name of the user

p_int_in_min

Time, in minutes, to go back in the past to search for deleted e-mail

p_quota

If the value is 0, no quota check is performed

If the value is 1, a quota check is performed

p_fromfolder

If a value is specified, then only p_fromfolder is checked for deleted e-mail messages

If the value is null, then all of the user's folders are checked for deleted e-mail messages

p_checksubfldrs

If the value is 0, only p_fromfolder is checked for deleted e-mail messages

If the value is 1, all subfolders for p_fromfolder are checked for deleted e-mail messages

p_tofolder

Destination of the retrieved messages. If the specified folder does not exist, the folder is created by the specified name for the deleted e-mail messages. If a folder is not specified, the system creates a folder named RECMSG_dd-Mon-yyyy hh24:mi in which to store the deleted e-mail messages. The time stamp shows when the recovery occurred, not when the deletion occurred.


To use the mail_recovery_fq package to recover messages:

  1. Connect to the database as es_mail.

  2. Execute the mail_recovery_fq.get_recover_messages procedure.