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
: paris
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
cmdfile=backup_offline_paris log=backup_offline_paris.log
82 Backing Up Oracle using Tivoli Storage Management
Figure 17. Whole consistent backup, commandfile backup_offline_paris
To guarantee that a databases 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:
shutdown immediate;
startup force dba;
shutdown immediate;
startup mount;
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
backup client.
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 nodes
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.
With the
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
successful backup:
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
Because the
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
specify the
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.
Chapter 6. Oracle backup considerations on UNIX 85
Refer to Figure 18 for a diagram of this complex situation.
Figure 18. Multiple log groups, archive log destinations, different tape drives in TSM

Get Backing Up Oracle Using Tivoli Storage Management now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.