Chapter 6. Oracle backup considerations on UNIX 81
6.4 Backup examples
This section describes some typical backup examples using RMAN, complete
with sample scripts. The examples are based on the following database
• Target database
• Recovery catalog database:
For the examples, we used RMAN command files and redirected the output to
logfiles. RMAN command files are regular text files containing commands
executed by RMAN.
The examples illustrate how to perform the following functions:
• Consistent whole database backup
• Archive redo log backup
• Incremental level 0 backup
6.4.1 Consistent whole database backup
In the following examples, we are using RMAN to shut down and restart the
database, to guarantee that all read-write datafiles and control files have
been check-pointed with respect to the same system change number (SCN).
These examples are suitable for databases operating in ARCHIVELOG and
NOARCHIVELOG mode, and in our opinion, they represent the most
common backup operation:
rman target internal/manager@PARIS rcvcat rman/rman@RIO
82 Backing Up Oracle using Tivoli Storage Management
Figure 17. Whole consistent backup, commandfile backup_offline_paris
To guarantee that a database’s datafiles are consistent, shut down the
database with the NORMAL, IMMEDIATE or TRANSACTIONAL options
before making a whole database backup. To bring up the database in the
desired state, we chose the sequence:
startup force dba;
For TDP for Oracle environment variables in the
allocate channel command:
• DSMO_NODE is set because we use a different node name to the TSM
• DSMO_AVG_SIZE is a size estimate used by the TSM server to reserve
space on TSM storage.
• DSMI_ORC_CONFIG points to our dsm.opt file.
• DSMI_LOG points to our backup log directory - the default is the
$ORACLE_HOME/dbs directory of the Oracle instance PARIS.
• The allocation of multiple channels is only possible when TSM node’s
MAXNUMMP (maximum mount points allowed) is greater than or equal to
the number of channels.
Chapter 6. Oracle backup considerations on UNIX 83
The following is an explanation of various statements in our coding example:
set maxcorrupt for datafile 1 to 0 causes Oracle to abort the backup
process if RMAN detects corrupt blocks in the SYSTEM tablespace.
In our database, we used AUTOEXTEND=ON for all datafiles. Datafile 1 is
always used for the SYSTEM tablespace.
backup full causes a whole database backup.
filesperset 3 forces RMAN to include maximal 3 files in a backup set.
A possible restore from a single datafile will be processed faster.
format ‘%d%t%s%p’ creates a TSM low level name including database
name/timestamp/backup set number/backup piece number
tag ‘paris offline 20010316.1111’ is a user defined symbolic name which
is assigned to backup sets. It makes it easier to address these backups in
RMAN restore or change commands.
alter database open finally makes the database accessible to users.
6.4.2 Archived redo log backup
The next examples show how to back up archived redo logs.
In both examples, the current log is archived before the backup archivelog is
The first example uses only one log archive destination as input for the RMAN
backup and two different channels to speed up the process.
filesperset 20 RMAN creates up to 20 backup pieces in one backup
delete input option tells RMAN to deletes the archive logs on disk after a
84 Backing Up Oracle using Tivoli Storage Management
The second archivelog backup example is more complex — but also more
safe. Assume that a very important database is configured in the following
• Oracle uses multiple log groups
• Each group contains multiple log members
• At least two log archive destinations are in use
backup archivelog all command backs up exactly one copy of
each distinct log sequence number, RMAN does not put two copies of the
same log sequence number into the same backup set. Furthermore, if you
delete input option, RMAN only deletes the specific copy of the
archived redo log that it backs up.
The easiest solution in this case is to back up both copies of each archived
redo log and then delete both copies. Use the
like pathname parameter to
indicate which destination to use. The
like parameter allows you to match
filenames in both archive destinations.