Professional Documents
Culture Documents
Tim Gorman
(tim@sagelogix.com)
Principal
SageLogix, Inc.
www.sagelogix.com
Agenda
www.sagelogix.com
Is RMAN Worth It?
RMAN has a bad rap
Initially well-deserved, but not anymore
Database recovery is too important to rely on ad-
libs during recovery situations
Just about every DBA has written backup scripts
How many have written restore and recovery scripts?
And tested all of them?
Having a query-able database of all backup, restore, and
recovery operations is invaluable for determining
recoverability
Nothing is better than actually testing a restore/recovery,
but RMAN has many almost-as-good features built in
www.sagelogix.com
Architecture Overview
Target database
The database which is being/has been backed up
The RMAN executable connects to the target database like
any other application
RMAN allocates channels which are normal Oracle server
processes to read datafiles and/or archived redo log files
and write them to backup media
Type DISK (default)
Type SBT_TAPE (requires integration with 3rd party
software)
Channels allocated for normal backup/restore/recovery
operations or for explicit catalog maintenance
purposes
Database control files contain the real recovery catalog
A database of all backup, restore, and recovery actions as
well as structural information about the target database
www.sagelogix.com
Architectural Overview
Recovery Catalog database
An optional component
Not required, merely a convenience
Contains data replicated from the real recovery catalog
database in the target databases control files
Used to consolidate RMAN recovery information and enable
certain advanced features
None of the basic backup, restore, or recovery features
require a recovery catalog database
Auxiliary database
Database being created during a DUPLICATE TARGET
DATABASE operations
Target database is the source database being copied
RMAN executable or Backup Manager in OEM
Command-line or GUI console for runnig RMAN commands
www.sagelogix.com
Architectural Overview
Backup media
control
files
online
redo
Backup Manager (OEM)
logfiles MMV
Oracle
server
MMV
Oracle
server Oracle Oracle
data
server server
files
data
RMAN files
www.sagelogix.com
RMAN in Oracle8i
Enhanced in Oracle8i
DUPLICATE TARGET DATABASE command added
Create DEV, QA/TEST, or prod scratch databases
from PROD
Cumulative incremental backups added
Reduces restore time at a cost of larger backups
than default differential incremental backups
Crosscheck RMAN catalog with MML catalog or disk
files to expire records
Keeps recovery catalog up-to-date and valid
Fewer commands requiring a separate recovery
catalog database
Complete list in Recovery Manager Users Guide,
page 3-45 in Oracle8i and page 3-13 in Oracle9i
www.sagelogix.com
RMAN in Oracle8i
www.sagelogix.com
Simple database backup
$ rman nocatalog
Recovery Manager: Release 9.2.0.1.0 Production
Copyright 1995, 2002, Oracle Corporation. All rights res
RMAN> connect target sys/manager
Connected to target database: GRDEV1 (DBID=2234098234)
Using target database controlfile instead of recovery cata
RMAN> run {
2> allocate channel t1 type SBT_TAPE;
3> allocate channel t2 type SBT_TAPE;
4> allocate channel t3 type SBT_TAPE;
5> backup incremental level=0 maxsetsize 4G database;
6> release channel t1;
7> release channel t2;
8> release channel t2;
9> }
www.sagelogix.com
Simple archivelog backup
$ rman nocatalog
Recovery Manager: Release 9.2.0.1.0 Production
Copyright 1995, 2002, Oracle Corporation. All rights re
RMAN> connect target sys/manager
Connected to target database: GRDEV1 (DBID=2234098234)
Using target database controlfile instead of recovery cat
RMAN> run {
2> sql alter system switch logfile;
3> allocate channel t1 type SBT_TAPE;
4> backup filesperset 10 archivelog delete input;
5> release channel t1;
6> }
www.sagelogix.com
RMAN everyday tasks
Persistent configuration
Configuration settings stored in control file
Allows simpler everyday command syntax
Defaults for all BACKUP, COPY, RESTORE
operations
CONFIGURE DEFAULT DEVICE TYPE xxx
Where xxx is usually either DISK or SBT (tape)
CONFIGURE DEVICE TYPE xxx [ PARALLELISM n ]
Determines how many channels to allocate by
default
www.sagelogix.com
RMAN in Oracle9i
Persistent configuration (contd)
CONFIGURE CONTROLFILE AUTOBACKUP
[ON|OFF]
Automatically backs up controlfile and SPFILE
After BACKUP, COPY, and other RMAN
commands
After structural changes to database detected
CONFIGURE RETENTION POLICY
TO REDUNDANCY nn
Where nn is the number of complete backups
TO RECOVERY WINDOW OF nn DAYS
Where backups and archived redo logs must be
retained to allow recoveries to any point-in-time
within the nn day recovery window
www.sagelogix.com
RMAN in Oracle9i
SQL> select name, value from v$rman_configuration;
NAME VALUE
----------------------------- --------------------
ARCHIVELOG BACKUP COPIES FOR SBT_TAPE TO 1
DEVICE TYPE
BACKUP OPTIMIZATION OFF
CONTROLFILE AUTOBACKUP ON
CONTROLFILE AUTOBACKUP FORMAT SBT_TAPE
FOR DEVICE TYPE
DATAFILE BACKUP COPIES FOR DE SBT_TAPE TO 1
VICE TYPE
DEFAULT DEVICE TYPE TO SBT_TAPE
DEVICE TYPE SBT_TAPE PARALLELISM 2
MAXSETSIZE TO 4G
RETENTION POLICY TO REDUNDANCY 3
www.sagelogix.com
RMAN in Oracle9i
www.sagelogix.com
RMAN in Oracle9i
www.sagelogix.com
RMAN in Oracle9i
Control files
Use CONFIGURE AUTOBACKUP to automatically
backup controlfiles
Highly recommended!
Controlfiles can be backed up explicitly using:
BACKUP CURRENT CONTROLFILE
BACKUP
DATABASE | TABLESPACE xxx | DATAFILE
xxx
INCLUDE CURRENT CONTROLFILE
If all controlfiles are lost or damaged, can be restored:
RESTORE CONTROLFILE
www.sagelogix.com
RMAN in Oracle9i
www.sagelogix.com
RMAN in Oracle9i
www.sagelogix.com
RMAN in Oracle9i
Restrictions:
Can only be performed using a FULL backup
No incremental backups permitted
www.sagelogix.com
RMAN in Oracle9i
www.sagelogix.com
RMAN in Oracle9i
www.sagelogix.com
Things RMAN doesnt do
The REPORT command leaves much to be
desired
There is a REPORT NEEDS BACKUP, REPORT OBSOLETE,
and REPORT UNRECOVERABLE
But there is no REPORT ISRECOVERABLE yet
And isnt this the most important thing to know?
Must write a custom report against repository to
accomplish this, still
Archived redo log files retention policies are not
supported
RMAN just wants to DELETE INPUT after successful backup
Maybe not a bad thing
www.sagelogix.com
Additional documentation
MetaLink
Note #131865.1 RMAN Library Index
An incredible online resource for RMAN!
Oracle Press
Oracle9i RMAN Backup and Recovery
Robert Freeman, Matthew Hart Oct 2002
Oracle Backup and Recovery 101
Stephen Haisley, Kenny Smith Mar 2002
Oracle8i Backup & Recovery
Rama Velpuri Nov 2000
OReilly and Associates
Oracle RMAN Pocket Reference
Darl Kuhn, Scott Schulze Nov 2001
www.sagelogix.com
Q&A
www.sagelogix.com