Instructor's Notes
(If applicable)
- Lesson 1 - Introduction to Oracle Recovery Manager (RMAN)
- Author: Dave Anderson, SkillBuilders
- www.skillbuilders.com
- Last Update: October 17, 2007
- This lesson will cover the administration following topics:
- What is Oracle Recovery Manager / RMAN?
- Basic RMAN Feature Summary
- Focus on the RMAN Repository
- Oracle9i New Features
- Oracle 10g New Features
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- This lesson will provides an introduction to Oracle Recovery Manager. Intended audience is Oracle DBA’s.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- Recovery Manager (usually called “RMAN”) is a utility for the backup and recovery of Oracle 8.0 and later databases.
- RMAN can be used in place of OS backup techniques (note that Oracle documentation now refers to OS copy backup techniques as “user-managed”).
- RMAN will automate many tasks. For example, RMAN Full Backups will always backup all datafiles – without script modification – because RMAN has access to the controlfile and knows the current structure of your database. Also, RMAN eliminates the need to locate the files needed to recover - RMAN keeps track of this automatically. RMAN also allows administrators to create and save scripts that perform repeated tasks.
- RMAN is shipped with all versions of Oracle. A separate purchase and install is NOT necessary.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- It is not compatible with Oracle 7 databases. It replaces the version 7 Enterprise Backup utility, which is now obsolete.
- Since RMAN is shipped with all editions of Oracle, there is no extra cost. This changes – perhaps drastically – if you require direct backup to tape. Except for a very rudimentary plus-in supplied by Oracle Secure Backup Express (one tape drive limit), RMAN does not ship with the capability to write to tape – you must purchase software such as Oracle Secure Backup, Legato Networker or Veritas Netbackup. We’ll discuss this in further detail later in this course.
- Oracle Secure Backup (OSB) provides RMAN tape backup capability for Oracle database files and file systems . This works in networked UNIX, Linux, Windows and Network Attached Storage (NAS) environments. Oracle Secure Backup supports Secure Socket Layer (SSL) and encryption. OSB is integrated with Oracle Enterprise Manager (EM).
- RMAN commands can be executed via a command line utility (much like Server Manager) or through the graphical user interface in Oracle Enterprise Manager.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- Short list of RMAN features:
- Full and incremental backups – FULL backups backup all blocks. With incremental backups, RMAN backs up only blocks that have changed since last backup.
- RMAN eliminates the need to put the database in “hot backup” mode. This is because RMAN starts one or more sessions on the server (you can see them by querying V$SESSION) and these sessions are responsible for reading blocks. Thus, the server session can detect a block being written by DBWR and can automatically re-read the block if it detects any inconsistencies.
- Recording of backup history - RMAN knows what backups have been taken, where the backup “sets” are located, what still needs to be backed up and what backups are redundant and candidates for deletion. Perhaps most importantly, RMAN knows what files are required for restore and recovery, helping to promote trouble-free recovery operations.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- Short list of RMAN features (continued):
- Multiple server sessions can be created on the target database; these are used to perform backup and recovery operations in parallel
- Backup to tape (using tape vendor software – more on this later) or disk
- “Compress” backups by skipping unused blocks. RMAN does not backup blocks in datafiles that have never been used.
- Extensive reporting on backups taken, what has not been backed up, what backups are redundant and more. This includes the ability to create readable and printable logs of all operations.
- RMAN can store often-repeated tasks as scripts in a recovery catalog - a central repository.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- Short list of RMAN features (continued):
- RMAN will detect and report on corrupt blocks during the backup operation, eliminating the creation of unusable backup sets.
- Via a simple command, RMAN will backup archive logs and optionally delete the logs after successful backup.
- Test if backups can be restored. See the RMAN RESTORE DATABASE VALIDATE command.
- Create a duplicate database for testing or standby database use. See the DUPLICATE command.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- RMAN creates and maintains a repository of metadata about the target databases. (“Target” in RMAN parlance simply means the database that your backup up.) This is not an optional feature.
- The repository provides the intelligence in RMAN. For example, this allows RMAN to keep track of backups. RMAN knows what has been backed up, what has not and where the backup sets (one or more OS files) are located, plus much more.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- The repository contains redo log information including the history of log switches and archived logs, the history of backups taken and the structure of the target database.
- RMAN always maintains a copy of the repository in the target database’s control file – this is not optional.
- Additionally, RMAN can keep a copy of the repository in a separate recovery catalog. The recovery catalog should be stored in a separate database – optimally on a separate machine.
- We will study more about the control file, repository and recovery catalog in the RMAN Architecture lesson.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- Oracle9i RMAN added many new features:
- The new CONFIGURE command provides the ability to configure the RMAN environment. The settings affected by CONFIGURE remain in effect until explicitly reset. Some of the things that can be configured include channels, retention policies, control file autobackup and more.
- Channels are connections to server sessions performing the work of backup and recovery. Automatic channel allocation eliminates the sometimes tedious task of repeatedly reallocating channels and simplifies command syntax.
- Via the CONFIGURE CONTROLFILE AUTOBACKUP ON; command, we tell RMAN to backup the control file anytime a BACKUP or COPY command is executed. This provides additional protection even if we lose the control file and the recovery catalog. See examples later in this document.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- RMAN now supports restartable operations. The unit of restart is a backupset (complete set of backed up datafiles or archived logs). Multiple backupsets can be created in a single backup – the advantage of this is that if the backup fails, any complete backupsets do not need to be redone. See the NOT BACKED UP SINCE clause and “Restartable Backups” section of the Recovery Manager Users Guide for more information.
- The command syntax has been simplified. No longer is it necessary to code the backup, restore an recover commands in a RUN block.
- Block Media Recovery (BMR), is the ability to restore and recover corrupt blocks, rather than an entire datafile or tablespace. See the BLOCKRECOVER command.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- Restore optimization: RMAN will not restore a file is it has not changed. Can be overridden with the FORCE option.Backup optimization: Use the CONFIGURE BACKUP OPTIMIZATION command to tell RMAN not to backup a file if it has not changed (checks SCN and timestamp). This will decrease backup elapsed time.
- 9i can easily backup online and archive logs with the BACKUP DATABASE PLUS ARCHIVELOG command. This insures that you create a consistent backup set for backups done while the database is open.
- Create user-defined retention policies. For example, we can configure RMAN so that backups are retained for 30 days:RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS;The REPORT OBSOLETE and DELETE OBSOLETE commands will now only report and delete, respectively, backup sets that are older than 30 days. Alternatively, you can configure RMAN to retain multiple copies of a backup:RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 3;Redundancy is mutually exclusive from RECOVERY Window. Recovery Window is usually a better method but redundancy “1” is the default to maintain compatibility with the 8i REPORT OBSOLETE command.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- Release 2 of Oracle9i (9.2.x) provides several new features:
- RMAN now recognizes the server parameter file. Use the BACKUP SPFILE command.
- If CONFIGURE CONTROLFILE AUTOBACKUP is set to ON, RMAN will automatically backup the control file and server parameter file (if used) whenever a structural change is made to the database. This includes CREATE/DROP TABLESPACE, online-ing or offline-ing a tablespace, adding a new online redo log, renaming a file and more. A message is written to the database alert log that includes the location of the backup set.
- Release 2 has better support for archive logs:
- You may want to take a second backup of your archive logs prior to deleting them from disk. Consider using the BACKUP ARCHIVELOG . . . NOT BACKED UP 2 TIMES followed by DELETE ARCHIVELOG ALL BACKED UP 2 TIMES.
- A restore operation may require a tremendous amount of disk space. Space used by the restore of archive logs can be controlled by the used of the DELETE ARCHIVELOG parameter of the RECOVER DATABASE command. This parameter will cause RMAN to delete an archive log after it has been applied.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- New Features continued from the previous page:
- A recovery catalog will not accept duplicate DBID’s. If you have used OS commands to create copies of your database, and now would like to register that database in the same recovery catalog, use the DBNEWID to change the DBID (and database name, if desired). Using the RMAN DUPLICATE command, you will avoid the problem of duplicate DBID’s.
- New views are available:
- V$DATABASE_BLOCK_CORRUPTION lists the logically or physically (media) corrupt blocks found in the recent BACKUP, BACKUP VALIDATE or COPY operation. This can be used as input to a block recover operation. See the BLOCKRECOVER command. The RC_DATABASE_BLOCK_CORRUPTION is the equivalent view in the recovery catalog.
- V$DATABASE_INCARNATION lists the incarnations of the database created with an OPEN RESETLOGS operation.
- Tags are a name for a given backup that can be used to help identify the backup and can be used in the RESTORE command. (e.g. WEEKLY_BACKUP) R2 creates tags automatically if one is not specified on the BACKUP command, in the format TAGYYYYMMDDTHHMMSS.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- Oracle 10g provides many enhancements and new features for RMAN; even one or two new features for user-managed backups.
- Flash Recovery Area
- Flashback Database
- Restore Points
- Simplified Recovery through RESETLOGS
- Compressed Backups
- Change Tracking
- Incrementally Updated Image Copies
- SWITCH DATABASE Command
- New V$ Views
- Encrypted Backups
- CATALOG Command
- DROP DATABASE Command
- Miscellaneous New Features
- Refer to Lesson 13 for description of these 10g features.
Other Text:
(Examples or comments displayed on slide, if any).
Instructor's Notes
(If applicable)
- In this lesson we learned:
- What Recovery Manager (RMAN) is
- Some basic functionality
- Some features introduced with Oracle9i and Oracle 10g
- The next lesson teaches RMAN architecture.
Other Text:
(Examples or comments displayed on slide, if any).