Oracle® Email Administrator's Guide Release 2 (9.0.4.1) Part Number B10720-02 |
|
|
View PDF |
This chapter describes how to back up and recover Oracle Email.
This chapter contains the following topics:
Disaster planning is a critically important aspect of administering an e-mail system. System files and the mail store 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:
oesbkp
utility backs up and recovers folders, messages, address book entries, and server side rules for individual usersOracle Email uses the Oracle database as its mail store, 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 Email 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 database backup methods include:
Note: Individual user accounts cannot be restored from database backups. To back up and restore individual user accounts, use the |
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.
oesbkp
backs up the following user data into flat files:
When restoring user accounts:
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]
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:
oesbkp
command-line. Parameters can appear in any order.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:
user
_rules.xml
contains the specified user's server side rulesuser
_addrbook.ldif
contains the specified user's address book entriesuser
_foldermap
file contains mapping between the specified user's files and folders, which enables the backup of folders that have names containing characters that are not supported by the operating system.user_n
(user
_1
, user
_2
, and so forth) represents each of the user's foldersFolders are restored in subfolders in the following user account folder:
restore_dd-Mon-yyyy hh24:mi/subfoldername
where subfoldername
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
.
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 Oracle9i Database LogMiner feature. With LogMiner, you can use SQL to read, analyze, and interpret log files.
Whenever an Oracle Email message is deleted, the change in data is recorded in a database redo log. LogMiner lets you to 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 Email messages.
This section contains the following topics:
In order to set up mail recovery, you must enable supplemental logging for the mail store database and configure the housekeeping server to record the messages being deleted into the redo logs.
Setting up LogMiner involves the following tasks:
To enable supplemental logging for the mail store database:
sys
as follows:
$ sqlplus sys/sys_password
SQL > alter database add supplemental log data (primary key,unique index) columns;
Perform the following steps to configure the housekeeping server to record the messages being deleted into the redo logs.
collection
parameter is configured.Record
Messages
Being
Deleted
Into
Redo
Logs
parameter .To create the LogMiner data dictionary file:
sys
as follows:
$ sqlplus sys/sys_password
dbms_logmnr_d.build
procedure with the dictionary filename and location, as in the following example:
SQL > execute dbms_logmnr_d.build('dictionary.ora', '/oracle/database/');
UTL_FILE_DIR
has access to the dictionary file.
The lmmr_setup
package uses the redo list file to obtain the list of redo logs provided by an administrator. The redo list file contains redo log file names with their full path and must be listed in separate lines.
Redo logs can be stored online, archived, or both.
To create a redo list file:
UTL_FILE_DIR
can access the redo list file.The following is an example of a redo list file:
/oracle/database/redo01.log /oracle/database/redo02.log /oracle/database/redo03.log
Perform the following steps to use LogMiner to recover messages:
es_mail
.lmmr_setup.setup_logmnr
, specifying the dictionary file name, redo list file location, and redo list file name.mail_recovery.recover_messages
with the user name and folder name in which the recovered messages are placed.mail_recovery.cleanup
after recovering the messages to drop the LogMiner shadow table, es_lmmr_tbl
, and its indexes.
The following example demonstrates how to execute mail recovery.
es_mail
user.SQL> set serveroutput on; SQL > declare fname VARCHAR2(300); begin lmmr_setup.setup_logmnr(data_dictionary_file_with_full_path, path_name_for_file_containing_redo_list, filename_for_file_containing_redo_ list); mail_recovery.recover_messages(email_domain_of_user,emailid_of_user_without_ domain, fname); mail_recovery.cleanup; dbms_output.put_line(messages_recovered_into_folder||fname); end; /
The lmmr_setup
package consists of the setup_logmnr
procedure. This procedure initializes the LogMiner for mining redo logs for the specified duration. It also builds the LogMiner shadow table, es_lmmr_tbl
, that is subsequently used for recovering messages.
The syntax is as follows:
PROCEDURE setup_logmnr( p_dictionary_filename IN VARCHAR2, p_redolist_location IN VARCHAR2, p_redolist_filename IN VARCHAR2 p_starttime IN DATE DEFAULT '01-jan-1988', p_endtime IN DATE DEFAULT '01-jan-2099');
The mail_recovery
package consists of the recover_messages
and cleanup
procedures.
The recover_messages
procedure recovers messages and restores them in a specified folder.
The syntax is as follows:
PROCEDURE recover_messages( p_domainname IN VARCHAR2, p_username IN VARCHAR2, p_foldername IN OUT VARCHAR2, p_autocommit IN BOOLEAN DEFAULT TRUE);
The cleanup
procedure drops the es_lmmr_tbl
shadow table and its indexes. This procedure does not have any parameters.
cleanup
should be called after a successful call to the recover_messages
procedure.
The syntax is as follows:
PROCEDURE cleanup;
This section contains the following topics:
Oracle Email end users and administrators can recover messages deleted as of a certain time using the database flashback query feature. The flashback query based e-mail recovery applies to e-mail messages transferred to another folder. Flashback query creates a snapshot of the database at a certain point in time, from which an Oracle Email user can recover all messages that are in a particular folder at a specific point in time.
Flashback query uses the retention control functionality provided by the Automatic Undo Management feature of the Oracle 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 allows 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 Email message is deleted, a record is created in the database undo logs. When 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 Email users can retrieve using 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 Email 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 Email system that receives a large number of messages per day requires more disk space to retain undo information than a system that receives just a few messages per day.
Deleted messages can be retrieved with flashback query using the Microsoft Outlook client connecting to Oracle Email through the Outlook Connector. Recovered messages are recovered to the folder of the user's choice.
See Also:
Oracle Connector for Outlook Online Help for more information on recovering messages using Microsoft Outlook through the Outlook Connector |
Flashback recovery by Oracle Email through the Outlook Connector can be enabled or disabled using the Oracle Webmail client administration pages.
To recover messages for a user using flashback query, administrators can also use the PL/SQL package MAIL_RECOVERY_FQ
.
To use flashback query, you must first create an undo tablespace. This can be done when the database containing the mail store is first created or you can add an undo tablespace to an existing database. After creating the tablespace, set the database parameter UNDO_RETENTION
to the amount of time in seconds for which the undo information is to be retained.
To set the retention time, enter the following:
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 = 1800
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 be performed.
Flashback recovery using the PL/SQL package mail_recovery_fq
is not affected by the administrator's policy and is always available.
The undo_retention
parameter can be set in the initialization parameter file.
The following example demonstrates how to execute flashback recovery:
es_mai
l user.SQL> set serveroutput on; SQL > declare fname VARCHAR2(300); begin mail_recovery_fq.get_recover_messages('emailid_of_user_without_domain', 'email_domain_of_user', 30, 0, NULL, 0, fname); dbms_output.put_line('Messages recovered into folder'||fname); end; /
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 follow:
mail_recovery_fq.get_recover_messages( p_username VARCHAR2, p_domainname VARCHAR2, p_int_in_mins NUMBER, p_quota NUMBER, p_fromfolder VARCHAR2, p_checksubfldrs NUMBER, p_tofolder VARCHAR2)
To use the mail_recovery_fq
package to recover messages: