Beruflich Dokumente
Kultur Dokumente
March 2009
Introduction ......................................................................................... 1
Oracle Recovery Manager – introduction........................................ 2
Oracle Recovery Manager – overview ............................................ 3
RMAN channels...................................................................................... 3
BCTF management......................................................................... 7
Reduction in the backup size ................................................................. 8
Preparation ........................................................................................... 10
Introduction
The purpose of this white paper is to explain the functionality provided by the Oracle
Recovery Manager (RMAN) and how it is integrated in the SAP database management
tools supplied, such as BR*Tools, brbackup, brarchive, and brrestore.
The aim of this paper is to convey the advantages that Oracle offers through the RMAN
and how easily the RMAN can be implemented in conjunction with the SAP BR*Tools.
For the details of commands and options for SAP’s BR*Tools, please refer to the official
SAP documentation.
1
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
A complete high availability and disaster recovery strategy requires working and tested
data backup, restoration, and recovery procedures. Without such procedures, a system
will run with potentially excessive downtimes and a high risk of data being lost.
Recovery Manager (RMAN) is an Oracle Database client, which performs backup and
recovery tasks and automates administration of backup strategies. It greatly simplifies the
backing up, restoration, and recovery of database files. RMAN handles all underlying
database procedures before and after backup or restoration in order to reduce the
possible risk of data being lost. It provides a common interface for backup tasks across
different host operating systems and offers features not available through user-managed
methods, such as parallelization of backup/recovery data streams, a backup files
retention policy, and a detailed history of all backups.
SAP BR*Tools offer all the necessary options for easily integrating RMAN under SAP and
only require a few changes to parameters in the init<SID>.sap parameter file.
2
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
RMAN channels
A connection is established between the RMAN .exe file and a target database by starting a
new server session on the entity. These newly created sessions will communicate with RMAN
processes and perform the actual backup, restoration, and recovery operations.
Each server session used by the RMAN is known as an RMAN channel. A channel can be either
a disk channel, used for backup tasks that perform disk I/O, or an SBT channel, which is used to
interact with media managers.
When a channel is defined as a tape, the RMAN uses an API called Media Management Library
(MML) to write to the tape subsystem. The RMAN can also be used in conjunction with external
backup management software. To back up the data to tape, the Oracle SBT interface needs to be
implemented as a dynamic function library provided by the external backup tool vendor.
Reference:
SAP Note 142635 – Installation of a backup library for Oracle
Data files
Shadow process
per channel
Shadow
Shadow
Media manager MML CH2 Disk backup
CH1
RMAN
3
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
4
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
The new “rman_maxcorrupt” parameter was introduced in BR*Tools 7.00. By setting this
parameter to the init<DBSID>.sap parameter file, the RMAN will be executed using the
“SET MAXCORRUPT” command. This parameter allows the RMAN to define the maximum
number of corrupt database blocks for each data file that should be accepted during the backup.
This is useful when no objects are created on the corrupted blocks. Corrupted unused blocks will
be formatted when the block is used. In this case, the corrupted block can be skipped using the
“SET MAXCORRUPT” parameter and the backup still can be undertaken by the RMAN.
Reference:
SAP Note 968507 – Considerable enhancements to backups using BR*Tools 7.00
Incremental backups
The RMAN backups of data files can be either full backups or incremental backups.
A full backup is a backup that includes every used block in the file. If a full data file backup is
created as an image copy, the entire file contents are reproduced exactly. An incremental backup
of a data file captures images of blocks that have been changed since a specific point in time,
usually when a previous full backup or incremental backup was undertaken.
The starting point for an incremental backup strategy is called a level 0 incremental backup,
which is identical to a full backup. After the level 0 backup is undertaken, incremental backups
can be carried out at regular intervals and these are called level 1 incremental backups.
These can be cumulative (including all blocks that have been changed since the most recent level
0 backup) or differential (including only blocks that have been changed since the most recent
incremental backup, whether it is level 0 or level 1). Oracle will allow different levels of
incremental backups to run, however SAP only supports “level 1” incremental backups (all
blocks that have been changed since the last full backup)
Incremental backups are always stored as backup sets. Since only the changes are backed up, the
resulting backup sets are generally smaller than full data file backups, unless every block in the
data file is changed. This will greatly help to reduce the size of incremental backups (especially
when the database is very large).
5
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
With Oracle 10g, block change tracking is now available. The RMAN's block change tracking
feature for incremental backups uses the recorded changed blocks in the Block Change Tracking
File (BCTF). This file is very small (only a bitmap representation of block addresses) and its size
is proportional to the size of the database and the number of enabled redo threads.
Usually a 1TB database will create BCTFs, each 30MB in size.
If change tracking is enabled, the RMAN uses the BCTF to identify changed blocks for an
incremental backup, thus avoiding the need to scan every block in the data file for changes.
During media recovery, the RMAN uses the block images from incremental backups and then
updates the contents of changed blocks at the SCN where the block was created in a single step.
Without incremental backups, all changes must be applied from the archived redo logs.
The BTCF will be created at the OS level to write the log changes for the changed blocks.
6
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
The BTCF needs to be created with the specific name and directory of the SAP environment.
SAP naming conventions:
For Unix systems:
$ORACLE_HOME/dbs/ bctf<DB_NAME>.ora
where <DB_NAME> = the name of the database (value of the parameter 'db_name')
This command will deactivate block change tracking and deletes the BCTF from the file system.
BCTF management
The RMAN or SAP’s BR*Tools do not save, create, or manage the BCTF. The BCTF is a binary
file created at the OS level. If the BCTF is missing, even though block change tracking is
activated, the system automatically creates the BCTF again the next time the entity is restarted.
But it will be created at a default location.
If the database is re-established by restoration and recovery, the BCTF will need to be re-created.
Reference:
SAP Note 964619 – Oracle Database 10g: Block change tracking
Oracle Metalink Note 306112.1 – RMAN 10g : How To Size the Block Change Tracking File
7
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
8
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
In order to check for archive consistency, the following flag should be set for the brarchive
command.
brarchive –w verify_use_rmv|first_rmv|only_rmv
Reference:
SAP Note 1016173 – Verifying database and archive log files using RMAN
The value “YES” activates the binary compression of backup sets in the RMAN.
If a backup is to be saved to disk and not tape, the “backup_dev_type = disk” parameter needs
to be set. Otherwise the RMAN will be executed by using the “BACKUP AS COPY” command
and this will result in one-to-one copies of the database files being created but not compressed.
In order to enable RMAN disk backup compression, the following combination is needed.
backup_dev_type = disk
disk_copy_command = rman_set
Reference:
SAP Note968507 – Considerable enhancements to backups using BR*Tools 7.00
SAP Note1101530 – Support for RMAN save sets for backups on hard disk
9
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
This section demonstrates how to use the RMAN in conjunction with the BR*Tools.
For details of the BR*Tools options and setup, please refer to the BR*Tools documentation
provided by SAP.
Preparation
Execute the steps below for the preparation. The RMAN will start the preparation run to
determine the optimum distribution of files across the save sets.
The default number of save sets is 1, but this can be changed by the following entry in the
init<SID>.sap file:
saveset_members = 1|2|3|4|tsp|all
10
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
Full backup
For brbackup to use the RMAN, the following parameter needs to be set in the
init<DBSID>.dba file:
backup_dev_type = rman_disk| rman_stage| rman_util
rman_disk:
Backs up with an external backup library and the RMAN, but without an external backup tool.
Copies profiles and log files to local disk.
rman_stage:
Backs up with an external backup library and the RMAN, but without an external backup tool.
Copies profiles and log files to remote disk.
rman_util:
Performs an RMAN backup in combination with a backup library and the backup tool of
another manufacturer. An external backup tool is also used to back up profiles, log files, and the
control file.
Full backup means making backups of all database files. This backup contains all database files as
well as the online/offline redo log files, but this backup cannot serve as the basis for the
incremental backups.
In order to undertake a full backup (all) with the RMAN, the following parameter needs to be set
in the init<SID>.sap file.
backup_mode = all
or
specify the following flag for the brbackup command line:
brbackup -m all
• Start BR*Tools.
• Choose “4 – Backup and database copy.”
• Choose “1 – Database backup” and set option no. 9 to “all.”
Brbackup main options for backup and database copy
9 ~ Files for backup (mode) .......... [all]
11
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
Incremental backup
As stated earlier, brbackup supports incremental backup with the RMAN. This means that
changes made to the database can now be backed up separately. This will significantly reduce the
time taken for the backup and the file size.
In order to make incremental backups, a full database backup is needed as the starting point.
This is also called a level 0 backup. With the level 0 backup present, incremental backups can be
undertaken.
A level = 0 backup is different to the normal full backup (backup_mode = all) mentioned earlier,
it needs to be backed up with the (backup_mode = full) option where the level = 0 flag is set.
or
specify the following flag for the brbackup command line.
brbackup -m full
• Start BR*Tools.
• Choose “4 – Backup and database copy”.
• Choose “1 – Database backup” and set option no. 9 to “full”.
Brbackup main options for backup and database copy
9 ~ Files for backup (mode) .......... [full]
The backup strategies and schedule can be adjusted to the system cycle. For example, a level 0
backup will perform a full backup of the database. This means that it will be more likely to take
longer for the backup to be completed. This action may therefore be scheduled at a time when
the system is not so busy.
With the level = 0 backup present, incremental backups can be taken. This is also called the level
= 1 backup.
12
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
or
specify the following flag for the brbackup command line.
brbackup -m incr
• Start BR*Tools.
• Choose “4 – Backup and database copy”.
• Choose “1 – Database backup” and set option no. 9 to “incr”.
• Brbackup main options for backup and database copy
• 9 ~ Files for backup (mode) .......... [incr]
Reference:
SAP Note 170013 – Differences between brbackup with "ALL" and "FULL"
13
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
-ss|-double_save:
Archives the offline redo logs to two backup devices (tape devices) in parallel.
-ssd|-double_save_delete:
Archives the offline redo logs to two backup devices (tape devices) in parallel and then deletes
the files.
Using the following command also creates a second copy in a serial manner (either by restarting
brarchive with brarchive -sc or brarchive -scd.)
-sc|-second_copy:
Creates a second copy of the offline redo log files that have already been archived.
-scd|-second_copy_delete:
Creates a second copy of the offline redo log files that have already been archived and then
deletes these files.
This option will only run a database verification with the RMAN and will not run any backup.
brrestore -w use_rmv
This option will run a temporary restoration to check the validity of files which have already been
backed up.
14
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
Running verification from brarchive to verify the validity of offline redo logs from the RMAN.
brarchive -w
use_rmv
Restores and then verifies the successfully backed-up files using the RMAN.
first_rmv
Verifies the original offline redo log files using the RMAN before the backup starts.
only_rmv
Verifies the original offline redo log files using the RMAN without starting a backup.
• Start BR*Tools.
• Choose “4 – Backup an database copy”.
• Choose “6 – Verification of database backup” or “7 – Verification of archive logs backup”.
When verification takes place, it will take approximately twice the time needed for the backup.
But for security reasons, we recommend scheduling the verification once in a cycle or once a
week.
15
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
Brrestore will restore the files produced by brbackup and brarchive. This is done through the use
of logs created by brbackup and the summary log of brarchive during a backup. Options are
available allowing you to choose either an entire database backup or parts such as just the data
files. Any non-database files such as parameter configuration files and directories that have been
saved can also be restored at the same time.
Brrestore only restores the files to the directory and will not perform database recovery so you
will need to combine it with either brrecover or manual recovery from SQL*Plus.
Restoration of the files can vary depending on the options specified for the command, -m option
for brrestore specifies the method to be used and is important.
A few examples
To restore a complete backup, use the -m full option. When the “-m full” option is specified, all
data files including the control files and online redo log files will be restored.
brrestore -b bdzuurde.aft -m full
In the above case, all files including control files and online redo log files from the
"bdzuurde.aft" backup will be restored.
When specifying the “-m all” option, only the data files will be restored.
For example, the following command will restore all data files but not control files and online
redo log files from the last backup.
brrestore -b last -m all
For example:
brrestore -b last -m 1-10
The above command will restore the data files from file_id=1 to file_id=10.
16
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
For example:
brrestore -a 10-100
The above command will restore the offline redo log files with sequence numbers 10 to 100 to
the archiving directory.
For example:
Running complete database recovery from the "bdzuurde.aft" backup
brrecover -b bdzuurde.aft -t complete
17
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
Appendix A
Sample setups of the init<SID>.sap file from a customer:
Example 1:
backup_type = online
backup_dev_type = rman_util
backup_root_dir = /oracle/BMD/sapbackup
rman_parms
="SBT_LIBRARY=/oracle/BMD/920_64/lib/libobk.sl,ENV=(XINT_PROFILE=/oracle/
BMD/920_64/dbs/initBMD.utl,PROLE_PORT=57323)"
The above example shows that the backup is undertaken by the RMAN with the Tivoli storage
manager media management tool. The external media management library and its profile file are
specified.
Example 2:
backup_mode = full
backup_type = online_cons
backup_dev_type = rman_util
compress = no
util_par_file = /oracle/WA3/102_64/dbs/initWA3.utl
rman_channels = 4
rman_filesperset = 4
rman_parms
archive_function=save_delete
Above is an example of init<SID>.sap setup for full online backup taken by using NetWorker
server located in a different host. By setting backup_type as online_cons, this means that the
online backup is taken in consistent mode. Consistent mode is an alternative to offline backup,
where the offline redo files created during the backup are also undertaken at the same time on
the same volume.
18
Oracle White Paper—Oracle Recovery Manager (RMAN) for SAP (Oracle Database EE 10g Release 2)
Appendix B
http://help.sap.com/saphelp_nw70/helpdata/EN/0e/f10a7443d711d29fef0000e8a5ae06/content.htm
=================================
http://help.sap.com/saphelp_nw70/helpdata/EN/3f/9d800e1aec11d2b42c00609419997a/content.htm
=========================================
http://help.sap.com/saphelp_nw70/helpdata/EN/3f/9d80081aec11d2b42c00609419997a/content.htm
=================================================
http://help.sap.com/saphelp_nw70/helpdata/EN/1a/fcecc21bc511d2b42c00609419997a/content.htm
19
Oracle Recovery Manager (RMAN) for SAP
(Oracle Database EE 10g Release 2)
March 2009
Author: Eisuke Sekiguchi
Copyright © 2009, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only and
the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other
Oracle Corporation
warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or
World Headquarters
fitness for a particular purpose. We specifically disclaim any liability with respect to this document and no contractual obligations are
500 Oracle Parkway
formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any
Redwood Shores, CA 94065
means, electronic or mechanical, for any purpose, without our prior written permission.
U.S.A.
Worldwide Inquiries: Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective
Phone: +1.650.506.7000 owners.
Fax: +1.650.506.7200
oracle.com 0309