Oracle Database Backup And Recovery User’s Guide RMAN 01 PDF 112 Users E10642 08
User Manual:
Open the PDF directly: View PDF .
Page Count: 604 [warning: Documents this large are best viewed by clicking the View PDF Link!]
- Contents
- Preface
- What's New in Backup and Recovery?
- Part I Overview of Backup and Recovery
- 1 Introduction to Backup and Recovery
- 2 Getting Started with RMAN
- Overview of the RMAN Environment
- Starting RMAN and Connecting to a Database
- Showing the Default RMAN Configuration
- Backing Up a Database
- Reporting on RMAN Operations
- Maintaining RMAN Backups
- Diagnosing and Repairing Failures with Data Recovery Advisor
- Rewinding a Database with Flashback Database
- Restoring and Recovering Database Files
- Part II Starting and Configuring RMAN and Flashback Database
- 3 Recovery Manager Architecture
- 4 Starting and Interacting with the RMAN Client
- Starting and Exiting RMAN
- Specifying the Location of RMAN Output
- Setting Globalization Support Environment Variables for RMAN
- Entering RMAN Commands
- Making Database Connections with RMAN
- Using the RMAN Pipe Interface
- 5 Configuring the RMAN Environment
- Configuring the Environment for RMAN Backups
- Configuring RMAN to Make Backups to a Media Manager
- Configuring the Fast Recovery Area
- Configuring the Backup Retention Policy
- Backup Optimization and the CONFIGURE command
- Configuring an Archived Redo Log Deletion Policy
- Configuring RMAN in a Data Guard Environment
- 6 Configuring the RMAN Environment: Advanced Topics
- Configuring Advanced Channel Options
- Configuring Advanced Backup Options
- Configuring Auxiliary Instance Data File Names
- Configuring the Snapshot Control File Location
- Configuring RMAN for Use with a Shared Server
- Enabling Lost Write Detection
- 7 Using Flashback Database and Restore Points
- Part III Backing Up and Archiving Data
- 8 RMAN Backup Concepts
- Consistent and Inconsistent RMAN Backups
- Online Backups and Backup Mode
- Backup Sets
- Image Copies
- Multiple Copies of RMAN Backups
- Control File and Server Parameter File Autobackups
- Incremental Backups
- Backup Retention Policies
- 9 Backing Up the Database
- Overview of RMAN Backups
- Specifying Backup Output Options
- Backing Up Database Files with RMAN
- Backing Up Archived Redo Logs with RMAN
- Making and Updating Incremental Backups
- Purpose of Incremental Backups
- Planning an Incremental Backup Strategy
- Making Incremental Backups
- Incrementally Updating Backups
- Using Block Change Tracking to Improve Incremental Backup Performance
- Making Database Backups for Long-Term Storage
- Backing Up RMAN Backups
- 10 Backing Up the Database: Advanced Topics
- Part IV Managing RMAN Backups
- 11 Reporting on RMAN Operations
- Overview of RMAN Reporting
- Listing Backups and Recovery-Related Objects
- Reporting on Backups and Database Schema
- Using V$ Views to Query Backup Metadata
- Querying Recovery Catalog Views
- 12 Maintaining RMAN Backups and Repository Records
- Overview of RMAN Backup and Repository Maintenance
- Maintaining the Control File Repository
- Maintaining the Fast Recovery Area
- Deletion Rules for the Fast Recovery Area
- Monitoring Fast Recovery Area Space Usage
- Managing Space for Flashback Logs in the Fast Recovery Area
- Responding to a Full Fast Recovery Area
- Changing the Fast Recovery Area to a New Location
- Disabling the Fast Recovery Area
- Responding to an Instance Crash During File Creation
- Updating the RMAN Repository
- Deleting RMAN Backups and Archived Redo Logs
- Dropping a Database
- 13 Managing a Recovery Catalog
- Overview of the Recovery Catalog
- Creating a Recovery Catalog
- Registering a Database in the Recovery Catalog
- Cataloging Backups in the Recovery Catalog
- Creating and Managing Virtual Private Catalogs
- Protecting the Recovery Catalog
- Managing Stored Scripts
- Maintaining a Recovery Catalog
- About Recovery Catalog Maintenance
- Resynchronizing the Recovery Catalog
- Updating the Recovery Catalog After Changing a DB_UNIQUE_NAME
- Unregistering a Target Database from the Recovery Catalog
- Resetting the Database Incarnation in the Recovery Catalog
- Upgrading the Recovery Catalog
- Importing and Moving a Recovery Catalog
- Dropping a Recovery Catalog
- Part V Diagnosing and Responding to Failures
- 14 RMAN Data Repair Concepts
- 15 Diagnosing and Repairing Failures with Data Recovery Advisor
- Overview of Data Recovery Advisor
- Listing Failures
- Checking for Block Corruptions by Validating the Database
- Determining Repair Options
- Repairing Failures
- Changing Failure Status and Priority
- 16 Validating Database Files and Backups
- 17 Performing Complete Database Recovery
- Overview of Complete Database Recovery
- Preparing for Complete Database Recovery
- Performing Complete Database Recovery
- 18 Performing Flashback and Database Point-in-Time Recovery
- Overview of Oracle Flashback Technology and Database Point-in-Time Recovery
- Rewinding a Table with Flashback Table
- Rewinding a DROP TABLE Operation with Flashback Drop
- Rewinding a Database with Flashback Database
- Performing Database Point-in-Time Recovery
- Flashback and Database Point-in-Time Recovery Scenarios
- 19 Performing Block Media Recovery
- 20 Performing RMAN Recovery: Advanced Scenarios
- 21 Performing RMAN Tablespace Point-in-Time Recovery (TSPITR)
- Overview of RMAN TSPITR
- TSPITR Restrictions, Special Cases, and Limitations
- Planning and Preparing for TSPITR
- Performing Fully Automated RMAN TSPITR
- Overriding Defaults for RMAN TSPITR with an RMAN-Managed Auxiliary Instance
- Performing RMAN TSPITR Using Your Own Auxiliary Instance
- Troubleshooting RMAN TSPITR
- Part VI Tuning and Troubleshooting
- 22 Tuning RMAN Performance
- Purpose of RMAN Performance Tuning
- Basic Concepts of RMAN Performance Tuning
- Using V$ Views to Diagnose RMAN Performance Problems
- Tuning RMAN Backup Performance
- 23 Troubleshooting RMAN Operations
- Interpreting RMAN Message Output
- Using V$ Views for RMAN Troubleshooting
- Testing the Media Management API
- Terminating an RMAN Command
- Part VII Transferring Data with RMAN
- 24 Duplicating a Database
- Overview of RMAN Database Duplication
- Preparing to Duplicate a Database
- Placing the Source Database in the Proper State
- Starting RMAN and Connecting to Databases
- Configuring RMAN Channels for Use in Duplication
- Duplicating a Database
- Restarting DUPLICATE After a Failure
- 25 Duplicating a Database: Advanced Topics
- Specifying Alternative Names for Duplicate Database Files
- Specifying Non-OMF or Non-ASM Alternative Names for Duplicate Database Files
- Specifying OMF or ASM Alternative Names for Duplicate Database Files
- Making Disk Backups Accessible Without Shared Disk
- Duplicating a Database When No Server Parameter File Exists
- Starting the Auxiliary Instance When No Server Parameter File Exists
- Duplicating a Subset of the Source Database Tablespaces
- Specifying Alternative Names for Duplicate Database Files
- 26 Creating Transportable Tablespace Sets
- Overview of Creating Transportable Tablespace Sets
- Customizing Initialization Parameters for the Auxiliary Instance
- Creating a Transportable Tablespace Set
- Troubleshooting the Creation of Transportable Tablespace Sets
- Transportable Tablespace Set Scenarios
- 27 Transporting Data Across Platforms
- Overview of Cross-Platform Data Transportation
- Performing Cross-Platform Tablespace Conversion on the Source Host
- Performing Cross-Platform Data File Conversion on the Destination Host
- Checking the Database Before Cross-Platform Database Conversion
- Converting Data Files on the Source Host When Transporting a Database
- Converting Data Files on the Destination Host When Transporting a Database
- Part VIII Performing User-Managed Backup and Recovery
- 28 Making User-Managed Database Backups
- Querying V$ Views to Obtain Backup Information
- Making User-Managed Backups of the Whole Database
- Making User-Managed Backups of Tablespaces and Data Files
- Making User-Managed Backups of Offline Tablespaces and Data Files
- Making User-Managed Backups of Online Tablespaces and Data Files
- Making User-Managed Backups of the Control File
- Making User-Managed Backups of Archived Redo Logs
- Making User-Managed Backups in SUSPEND Mode
- Making User-Managed Backups to Raw Devices
- Making Backups with the Volume Shadow Copy Service (VSS)
- Verifying User-Managed Data File Backups
- 29 Performing User-Managed Database Flashback and Recovery
- Performing Flashback Database with SQL*Plus
- Overview of User-Managed Media Recovery
- Performing Complete Database Recovery
- Performing Incomplete Database Recovery
- Recovering a Database in NOARCHIVELOG Mode
- Troubleshooting Media Recovery
- 30 Performing User-Managed Recovery: Advanced Scenarios
- Responding to the Loss of a Subset of the Current Control Files
- Recovering After the Loss of All Current Control Files
- Re-Creating a Control File
- Re-Creating Data Files When Backups Are Unavailable
- Recovering NOLOGGING Tables and Indexes
- Recovering Transportable Tablespaces
- Recovering After the Loss of Online Redo Log Files
- Recovering from a Dropped Table Without Using Flashback Features
- Dropping a Database with SQL*Plus
- Glossary
- Index

[1]
Oracle® Database
Backup and Recovery User's Guide
11g Release 2 (11.2)
E10642-08
May 2015
A guide to backup and recovery of Oracle databases,
including RMAN backup and recovery, RMAN data transfer,
Oracle Flashback Technology, and user-managed backup and
recovery
Oracle Database Backup and Recovery User's Guide, 11g Release 2 (11.2)
E10642-08
Copyright © 2003, 2015, Oracle and/or its affiliates. All rights reserved.
Primary Author: Lance Ashdown
Contributors: Katherine Weill, Tammy Bednar, Anand Beldalker, Timothy Chien, Mark Dilman, Raymond
Guzman, Stephan Haisley, Wei Hu, Alex Hwang, Ashok Joshi, Vasudha Krishnaswamy, J. William Lee
Valarie Moore, Muthu Olagappan, Vsevolod Panteleenko, Francisco Sanchez, Vinay Srihari, Margaret
Susairaj, Mike Stewart, Steven Wertheimer, Wanli Yang, Rob Zijlstra
This software and related documentation are provided under a license agreement containing restrictions on
use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your
license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license,
transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse
engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is
prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If
you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it
on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software,
any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users
are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and
agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and
adaptation of the programs, including any operating system, integrated software, any programs installed on
the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to
the programs. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management
applications. It is not developed or intended for use in any inherently dangerous applications, including
applications that may create a risk of personal injury. If you use this software or hardware in dangerous
applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other
measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages
caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of
their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks
are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD,
Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced
Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content,
products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and
expressly disclaim all warranties of any kind with respect to third-party content, products, and services
unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its
affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of
third-party content, products, or services, except as set forth in an applicable agreement between you and
Oracle.

iii
Contents
Preface ............................................................................................................................................................... xix
What's New in Backup and Recovery?.......................................................................................... xxi
Part I Overview of Backup and Recovery
1 Introduction to Backup and Recovery
Purpose of Backup and Recovery.......................................................................................................... 1-1
Data Protection................................................................................................................................... 1-2
Data Preservation............................................................................................................................... 1-3
Data Transfer ...................................................................................................................................... 1-3
Oracle Backup and Recovery Solutions............................................................................................... 1-3
Oracle Flashback Technology................................................................................................................ 1-5
Logical Flashback Features............................................................................................................... 1-5
Flashback Database............................................................................................................................ 1-7
Data Recovery Advisor............................................................................................................................ 1-7
Backup and Recovery Documentation Roadmap .............................................................................. 1-8
Recovery Manager Documentation Roadmap............................................................................ 1-10
User-Managed Backup and Recovery Documentation Roadmap........................................... 1-10
2 Getting Started with RMAN
Overview of the RMAN Environment................................................................................................. 2-1
Starting RMAN and Connecting to a Database ................................................................................. 2-2
Showing the Default RMAN Configuration ...................................................................................... 2-3
Backing Up a Database............................................................................................................................ 2-4
Backing Up a Database in ARCHIVELOG Mode.......................................................................... 2-4
Backing Up a Database in NOARCHIVELOG Mode ................................................................... 2-5
Typical Backup Options.................................................................................................................... 2-5
Making Incremental Backups........................................................................................................... 2-6
Validating Database Files and Backups.......................................................................................... 2-7
Scripting RMAN Operations............................................................................................................ 2-8
Reporting on RMAN Operations.......................................................................................................... 2-9
Listing Backups .................................................................................................................................. 2-9
Reporting on Database Files and Backups .................................................................................. 2-10
Maintaining RMAN Backups ............................................................................................................. 2-10
iv
Cross-checking Backups................................................................................................................. 2-10
Deleting Obsolete Backups............................................................................................................ 2-11
Diagnosing and Repairing Failures with Data Recovery Advisor .............................................. 2-11
Listing Failures and Determining Repair Options..................................................................... 2-11
Repairing Failures........................................................................................................................... 2-13
Rewinding a Database with Flashback Database........................................................................... 2-13
Restoring and Recovering Database Files........................................................................................ 2-14
Preparing to Restore and Recover Database Files...................................................................... 2-14
Recovering the Whole Database ................................................................................................... 2-15
Recovering Tablespaces ................................................................................................................. 2-15
Recovering Individual Data Blocks.............................................................................................. 2-16
Part II Starting and Configuring RMAN and Flashback Database
3 Recovery Manager Architecture
About the RMAN Environment ............................................................................................................ 3-1
RMAN Command-Line Client............................................................................................................... 3-3
RMAN Channels ...................................................................................................................................... 3-3
Channels and Devices ....................................................................................................................... 3-4
Automatic and Manual Channels.................................................................................................... 3-4
RMAN Repository.................................................................................................................................... 3-5
Media Management ................................................................................................................................. 3-6
RMAN Interaction with a Media Manager .................................................................................... 3-6
Oracle Secure Backup ........................................................................................................................ 3-6
Backup Solutions Program ............................................................................................................... 3-7
Fast Recovery Area................................................................................................................................... 3-7
RMAN in a Data Guard Environment ................................................................................................. 3-7
RMAN Configuration in a Data Guard Environment.................................................................. 3-7
RMAN File Management in a Data Guard Environment ............................................................ 3-8
4 Starting and Interacting with the RMAN Client
Starting and Exiting RMAN................................................................................................................... 4-1
Specifying the Location of RMAN Output ......................................................................................... 4-2
Setting Globalization Support Environment Variables for RMAN .............................................. 4-2
Entering RMAN Commands.................................................................................................................. 4-2
Entering RMAN Commands at the RMAN Prompt..................................................................... 4-3
Using Command Files with RMAN................................................................................................ 4-3
Entering Comments in RMAN Command Files............................................................................ 4-4
Using Substitution Variables in Command Files .......................................................................... 4-4
Checking RMAN Syntax................................................................................................................... 4-5
Making Database Connections with RMAN...................................................................................... 4-7
About RMAN Database Connections ............................................................................................. 4-7
Making RMAN Database Connections from the Operating System Command Line............. 4-9
Making Database Connections from the RMAN Prompt ......................................................... 4-10
Connecting RMAN to an Auxiliary Database ............................................................................ 4-11
Making RMAN Database Connections Within Command Files ............................................. 4-11
v
Diagnosing RMAN Connection Problems .................................................................................. 4-12
Using the RMAN Pipe Interface ........................................................................................................ 4-12
Executing Multiple RMAN Commands in Succession Through a Pipe: Example................ 4-13
Executing RMAN Commands in a Single Job Through a Pipe: Example............................... 4-14
5 Configuring the RMAN Environment
Configuring the Environment for RMAN Backups .......................................................................... 5-1
Showing and Clearing Persistent RMAN Configurations........................................................... 5-2
Configuring the Default Device for Backups: Disk or SBT.......................................................... 5-3
Configuring the Default Type for Backups: Backup Sets or Copies........................................... 5-4
Configuring Channels ....................................................................................................................... 5-4
Configuring Control File and Server Parameter File Autobackups ........................................... 5-7
Configuring RMAN to Make Backups to a Media Manager........................................................... 5-9
Prerequisites for Using a Media Manager with RMAN............................................................... 5-9
Determining the Location of the Media Management Library ................................................... 5-9
Configuring Media Management Software for RMAN Backups............................................. 5-10
Testing Whether the Media Manager Library Is Integrated Correctly ................................... 5-11
Configuring SBT Channels for Use with a Media Manager ..................................................... 5-13
Configuring the Fast Recovery Area.................................................................................................. 5-14
Overview of the Fast Recovery Area............................................................................................ 5-14
Enabling the Fast Recovery Area.................................................................................................. 5-16
Disabling the Fast Recovery Area................................................................................................. 5-20
Configuring Locations for Control Files and Redo Logs .......................................................... 5-20
Configuring RMAN File Creation in the Fast Recovery Area.................................................. 5-21
Configuring the Backup Retention Policy ....................................................................................... 5-22
Configuring a Redundancy-Based Retention Policy ................................................................. 5-22
Configuring a Recovery Window-Based Retention Policy....................................................... 5-23
Disabling the Retention Policy...................................................................................................... 5-23
Backup Optimization and the CONFIGURE command................................................................ 5-24
Overview of Backup Optimization............................................................................................... 5-24
Effect of Retention Policies on Backup Optimization for SBT Backups.................................. 5-25
Configuring Backup Optimization............................................................................................... 5-26
Configuring an Archived Redo Log Deletion Policy ..................................................................... 5-27
About Archived Redo Log Deletion Policies .............................................................................. 5-27
Enabling an Archived Redo Log Deletion Policy....................................................................... 5-28
Configuring RMAN in a Data Guard Environment....................................................................... 5-29
6 Configuring the RMAN Environment: Advanced Topics
Configuring Advanced Channel Options ........................................................................................... 6-1
About Channel Control Options...................................................................................................... 6-1
Configuring Specific Channel Parameters ..................................................................................... 6-2
Configuring Advanced Backup Options ............................................................................................. 6-3
Configuring the Maximum Size of Backup Sets............................................................................ 6-4
Configuring the Maximum Size of Backup Pieces........................................................................ 6-4
Configuring Backup Duplexing....................................................................................................... 6-5
Configuring Tablespaces for Exclusion from Whole Database Backups................................... 6-5
vi
Configuring Compression Options ................................................................................................. 6-6
Configuring Backup Encryption...................................................................................................... 6-7
Configuring Auxiliary Instance Data File Names .......................................................................... 6-11
Configuring the Snapshot Control File Location............................................................................ 6-11
Viewing the Configured Location of the Snapshot Control File.............................................. 6-12
Setting the Location of the Snapshot Control File...................................................................... 6-12
Configuring RMAN for Use with a Shared Server......................................................................... 6-12
Enabling Lost Write Detection ........................................................................................................... 6-14
7 Using Flashback Database and Restore Points
Understanding Flashback Database, Restore Points and Guaranteed Restore Points............... 7-1
Flashback Database............................................................................................................................ 7-2
Flashback Database Window ........................................................................................................... 7-2
Limitations of Flashback Database.................................................................................................. 7-3
Normal Restore Points....................................................................................................................... 7-4
Guaranteed Restore Points ............................................................................................................... 7-4
Logging for Flashback Database and Guaranteed Restore Points ................................................. 7-5
Guaranteed Restore Points and Fast Recovery Area Space Usage ............................................ 7-5
Logging for Guaranteed Restore Points with Flashback Logging Disabled ............................. 7-6
Logging for Flashback Database with Guaranteed Restore Points Defined ............................. 7-7
Prerequisites for Flashback Database and Guaranteed Restore Points ........................................ 7-7
Using Normal and Guaranteed Restore Points .................................................................................. 7-8
Creating Normal and Guaranteed Restore Points ........................................................................ 7-8
Listing Restore Points........................................................................................................................ 7-8
Dropping Restore Points................................................................................................................... 7-9
Using Flashback Database................................................................................................................... 7-10
Enabling Flashback Database........................................................................................................ 7-10
Disabling Flashback Database Logging....................................................................................... 7-10
Configuring the Environment for Optimal Flashback Database Performance...................... 7-11
Monitoring the Effect of Flashback Database on Performance ................................................ 7-11
Flashback Writer (RVWR) Behavior with I/O Errors ............................................................... 7-12
Part III Backing Up and Archiving Data
8 RMAN Backup Concepts
Consistent and Inconsistent RMAN Backups .................................................................................... 8-1
Consistent Backups............................................................................................................................ 8-1
Inconsistent Backups ......................................................................................................................... 8-2
Online Backups and Backup Mode ...................................................................................................... 8-2
Backup Sets................................................................................................................................................ 8-3
Backup Sets and Backup Pieces ....................................................................................................... 8-3
Block Compression for Backup Sets................................................................................................ 8-4
Binary Compression for Backup Sets.............................................................................................. 8-4
Backup Undo ...................................................................................................................................... 8-5
Encryption for Backup Sets............................................................................................................... 8-5
Filenames for Backup Pieces ............................................................................................................ 8-5
vii
Number and Size of Backup Pieces................................................................................................. 8-6
Number and Size of Backup Sets..................................................................................................... 8-6
Multiplexed Backup Sets................................................................................................................... 8-7
Proxy Copies....................................................................................................................................... 8-8
Image Copies............................................................................................................................................. 8-9
RMAN-Created Image Copies ......................................................................................................... 8-9
User-Managed Image Copies ........................................................................................................ 8-10
Multiple Copies of RMAN Backups ................................................................................................. 8-10
Duplexed Backup Sets.................................................................................................................... 8-11
Backups of Backups ........................................................................................................................ 8-11
Control File and Server Parameter File Autobackups.................................................................... 8-12
When RMAN Performs Control File Autobackups ................................................................... 8-12
How RMAN Performs Control File Autobackups..................................................................... 8-13
Incremental Backups ............................................................................................................................ 8-13
Multilevel Incremental Backups ................................................................................................... 8-14
Block Change Tracking .................................................................................................................. 8-16
Incremental Backup Algorithm..................................................................................................... 8-16
Recovery with Incremental Backups............................................................................................ 8-17
Backup Retention Policies................................................................................................................... 8-17
Recovery Window........................................................................................................................... 8-18
Backup Redundancy....................................................................................................................... 8-20
Batch Deletes of Obsolete Backups............................................................................................... 8-20
Backup Retention Policy and Fast Recovery Area Deletion Rules .......................................... 8-21
9 Backing Up the Database
Overview of RMAN Backups ................................................................................................................ 9-1
Purpose of RMAN Backups.............................................................................................................. 9-1
Basic Concepts of RMAN Backups.................................................................................................. 9-1
Specifying Backup Output Options ..................................................................................................... 9-2
Specifying the Device Type for an RMAN Backup....................................................................... 9-2
Specifying Backup Set or Copy for an RMAN Backup to Disk................................................... 9-3
Specifying a Format for RMAN Backups ....................................................................................... 9-3
Specifying Tags for an RMAN Backup........................................................................................... 9-4
Making Compressed Backups.......................................................................................................... 9-6
Backing Up Database Files with RMAN ............................................................................................. 9-6
Backing Up a Whole Database with RMAN .................................................................................. 9-7
Backing Up Tablespaces and Datafiles with RMAN .................................................................... 9-7
Backing Up Control Files with RMAN ........................................................................................... 9-8
Backing Up Server Parameter Files with RMAN .......................................................................... 9-9
Backing Up a Database in NOARCHIVELOG Mode ................................................................ 9-10
Backing Up Archived Redo Logs with RMAN................................................................................ 9-10
About Backups of Archived Redo Logs....................................................................................... 9-10
Backing Up Archived Redo Log Files .......................................................................................... 9-12
Backing Up Only Archived Redo Logs That Need Backups.................................................... 9-12
Deleting Archived Redo Logs After Backups............................................................................. 9-13
Making and Updating Incremental Backups................................................................................... 9-14
Purpose of Incremental Backups .................................................................................................. 9-14
viii
Planning an Incremental Backup Strategy .................................................................................. 9-15
Making Incremental Backups........................................................................................................ 9-15
Incrementally Updating Backups ................................................................................................. 9-16
Using Block Change Tracking to Improve Incremental Backup Performance ...................... 9-20
Making Database Backups for Long-Term Storage ....................................................................... 9-23
Purpose of Archival Backups ........................................................................................................ 9-23
Basic Concepts of Archival Backups ............................................................................................ 9-23
Making an Archival Backup for Long-Term Storage................................................................. 9-24
Making a Temporary Archival Backup ....................................................................................... 9-25
Backing Up RMAN Backups............................................................................................................... 9-26
About Backups of Backups............................................................................................................ 9-26
Backing Up Backup Sets with RMAN.......................................................................................... 9-28
Backing Up Image Copy Backups with RMAN ......................................................................... 9-29
10 Backing Up the Database: Advanced Topics
Limiting the Size of RMAN Backup Sets......................................................................................... 10-1
About Backup Set Size.................................................................................................................... 10-1
Limiting the Size of Backup Sets with BACKUP ... MAXSETSIZE.......................................... 10-2
Dividing the Backup of a Large Data File into Sections............................................................ 10-2
Using Backup Optimization to Skip Files........................................................................................ 10-3
Optimizing a Daily Archived Log Backup to a Single Tape: Scenario.................................... 10-4
Optimizing a Daily Archived Log Backup to Multiple Media Families: Scenario................ 10-4
Creating a Weekly Secondary Backup of Archived Logs: Example........................................ 10-5
Skipping Offline, Read-Only, and Inaccessible Files ................................................................... 10-6
Duplexing Backup Sets........................................................................................................................ 10-6
Duplexing Backup Sets with CONFIGURE BACKUP COPIES ............................................... 10-7
Duplexing Backup Sets with BACKUP ... COPIES .................................................................... 10-8
Making Split Mirror Backups with RMAN..................................................................................... 10-8
Encrypting RMAN Backups.............................................................................................................. 10-10
About RMAN Backup Encryption Settings............................................................................... 10-10
Making Transparent-Mode Encrypted Backups ...................................................................... 10-11
Making Password-Mode Encrypted Backups........................................................................... 10-11
Making Dual-Mode Encrypted Backups ................................................................................... 10-12
Restarting RMAN Backups ............................................................................................................... 10-12
About Restartable Backups.......................................................................................................... 10-12
Restarting a Backup After It Partially Completes .................................................................... 10-13
Managing Backup Windows............................................................................................................. 10-13
About Backup Windows.............................................................................................................. 10-13
Specifying a Backup Duration..................................................................................................... 10-14
Permitting Partial Backups in a Backup Window.................................................................... 10-14
Minimizing Backup Load and Duration.................................................................................... 10-14
Part IV Managing RMAN Backups
11 Reporting on RMAN Operations
Overview of RMAN Reporting .......................................................................................................... 11-1
ix
Purpose of RMAN Reporting........................................................................................................ 11-1
Basic Concepts of RMAN Reporting............................................................................................ 11-1
Listing Backups and Recovery-Related Objects ............................................................................. 11-3
About the LIST Command............................................................................................................. 11-3
Listing All Backups and Copies.................................................................................................... 11-5
Listing Selected Backups and Copies........................................................................................... 11-7
Listing Database Incarnations....................................................................................................... 11-9
Reporting on Backups and Database Schema ................................................................................. 11-9
About Reports of RMAN Backups ............................................................................................. 11-10
Reporting on Files Needing a Backup Under a Retention Policy .......................................... 11-10
Reporting on Datafiles Affected by Unrecoverable Operations ............................................ 11-11
Reporting on Obsolete Backups.................................................................................................. 11-12
Reporting on the Database Schema............................................................................................ 11-13
Using V$ Views to Query Backup Metadata ................................................................................. 11-14
Querying Details of Past and Current RMAN Jobs ................................................................. 11-14
Determining the Encryption Status of Backup Pieces ............................................................. 11-15
Querying Recovery Catalog Views.................................................................................................. 11-16
About Recovery Catalog Views .................................................................................................. 11-16
Querying Catalog Views for the Target DB_KEY or DBID Values ....................................... 11-17
Querying RC_BACKUP_FILES................................................................................................... 11-18
12 Maintaining RMAN Backups and Repository Records
Overview of RMAN Backup and Repository Maintenance ......................................................... 12-1
Purpose of Backup and Repository Maintenance ...................................................................... 12-1
Basic Concepts of Backup and Repository Maintenance .......................................................... 12-2
Maintaining the Control File Repository ......................................................................................... 12-3
About Control File Records ........................................................................................................... 12-3
Preventing the Loss of Control File Records............................................................................... 12-5
Protecting the Control File............................................................................................................. 12-5
Maintaining the Fast Recovery Area ................................................................................................. 12-6
Deletion Rules for the Fast Recovery Area.................................................................................. 12-6
Monitoring Fast Recovery Area Space Usage............................................................................. 12-7
Managing Space for Flashback Logs in the Fast Recovery Area.............................................. 12-7
Responding to a Full Fast Recovery Area ................................................................................... 12-8
Changing the Fast Recovery Area to a New Location............................................................... 12-9
Disabling the Fast Recovery Area................................................................................................. 12-9
Responding to an Instance Crash During File Creation............................................................ 12-9
Updating the RMAN Repository ....................................................................................................... 12-9
Crosschecking the RMAN Repository ....................................................................................... 12-10
Changing the Repository Status of Backups and Copies........................................................ 12-12
Adding Backup Records to the RMAN Repository ................................................................. 12-14
Removing Records from the RMAN Repository...................................................................... 12-16
Deleting RMAN Backups and Archived Redo Logs.................................................................... 12-17
Overview of RMAN Deletion...................................................................................................... 12-17
Deleting All Backups and Copies ............................................................................................... 12-19
Deleting Specified Backups and Copies .................................................................................... 12-20
Deleting Expired RMAN Backups and Copies......................................................................... 12-21
x
Deleting Obsolete RMAN Backups Based on Retention Policies........................................... 12-21
Dropping a Database.......................................................................................................................... 12-22
13 Managing a Recovery Catalog
Overview of the Recovery Catalog .................................................................................................... 13-1
Purpose of the Recovery Catalog.................................................................................................. 13-1
Basic Concepts for the Recovery Catalog .................................................................................... 13-2
Basic Steps of Managing a Recovery Catalog ............................................................................. 13-3
Creating a Recovery Catalog ............................................................................................................... 13-4
Configuring the Recovery Catalog Database.............................................................................. 13-4
Creating the Recovery Catalog Schema Owner.......................................................................... 13-6
Executing the CREATE CATALOG Command.......................................................................... 13-6
Registering a Database in the Recovery Catalog ............................................................................ 13-7
About Registration of a Database in the Recovery Catalog...................................................... 13-7
Registering a Database with the REGISTER DATABASE Command..................................... 13-8
Cataloging Backups in the Recovery Catalog.................................................................................. 13-9
Creating and Managing Virtual Private Catalogs........................................................................... 13-9
About Virtual Private Catalogs..................................................................................................... 13-9
Creating and Granting Privileges to a Virtual Private Catalog Owner ................................ 13-10
Creating a Virtual Private Catalog ............................................................................................. 13-11
Revoking Privileges from a Virtual Private Catalog Owner .................................................. 13-12
Dropping a Virtual Private Catalog ........................................................................................... 13-12
Protecting the Recovery Catalog....................................................................................................... 13-13
Backing Up the Recovery Catalog .............................................................................................. 13-13
Recovering the Recovery Catalog............................................................................................... 13-15
Managing Stored Scripts.................................................................................................................... 13-15
About Stored Scripts..................................................................................................................... 13-15
Creating Stored Scripts................................................................................................................. 13-16
Replacing Stored Scripts .............................................................................................................. 13-17
Executing Stored Scripts .............................................................................................................. 13-17
Creating and Executing Dynamic Stored Scripts ..................................................................... 13-18
Printing Stored Scripts.................................................................................................................. 13-19
Listing Stored Script Names........................................................................................................ 13-20
Deleting Stored Scripts................................................................................................................. 13-20
Executing a Stored Script at RMAN Startup............................................................................. 13-21
Maintaining a Recovery Catalog ...................................................................................................... 13-21
About Recovery Catalog Maintenance ...................................................................................... 13-21
Resynchronizing the Recovery Catalog..................................................................................... 13-22
Updating the Recovery Catalog After Changing a DB_UNIQUE_NAME........................... 13-25
Unregistering a Target Database from the Recovery Catalog................................................ 13-26
Resetting the Database Incarnation in the Recovery Catalog................................................. 13-28
Upgrading the Recovery Catalog ............................................................................................... 13-29
Importing and Moving a Recovery Catalog.............................................................................. 13-31
Dropping a Recovery Catalog........................................................................................................... 13-33
Part V Diagnosing and Responding to Failures
xi
14 RMAN Data Repair Concepts
Overview of RMAN Data Repair....................................................................................................... 14-1
Problems Requiring Data Repair.................................................................................................. 14-1
RMAN Data Repair Techniques ................................................................................................... 14-2
RMAN Restore Operations ................................................................................................................. 14-3
Backup Selection.............................................................................................................................. 14-3
Restore Failover............................................................................................................................... 14-4
About RMAN Restore Operations and ASM.............................................................................. 14-4
Restore Optimization...................................................................................................................... 14-4
RMAN Media Recovery....................................................................................................................... 14-5
Selection of Incremental Backups and Archived Redo Logs.................................................... 14-5
Database Incarnations .................................................................................................................... 14-6
15 Diagnosing and Repairing Failures with Data Recovery Advisor
Overview of Data Recovery Advisor................................................................................................. 15-1
Purpose of Data Recovery Advisor.............................................................................................. 15-1
Basic Concepts of Data Recovery Advisor .................................................................................. 15-2
Basic Steps of Diagnosing and Repairing Failures..................................................................... 15-6
Listing Failures ...................................................................................................................................... 15-6
Listing All Failures.......................................................................................................................... 15-7
Listing a Subset of Failures............................................................................................................ 15-8
Checking for Block Corruptions by Validating the Database ..................................................... 15-8
Determining Repair Options ............................................................................................................ 15-10
Determining Repair Options for All Failures ........................................................................... 15-10
Determining Repair Options for a Subset of Failures.............................................................. 15-12
Repairing Failures............................................................................................................................... 15-12
About Repairing Failures............................................................................................................. 15-12
Repairing a Failure........................................................................................................................ 15-13
Changing Failure Status and Priority.............................................................................................. 15-14
16 Validating Database Files and Backups
Overview of RMAN Validation ......................................................................................................... 16-1
Purpose of RMAN Validation....................................................................................................... 16-1
Basic Concepts of RMAN Validation ........................................................................................... 16-1
Checking for Block Corruption with the VALIDATE Command............................................... 16-4
Validating Database Files with BACKUP VALIDATE ................................................................. 16-6
Validating Backups Before Restoring Them ................................................................................... 16-7
17 Performing Complete Database Recovery
Overview of Complete Database Recovery...................................................................................... 17-1
Purpose of Complete Database Recovery.................................................................................... 17-1
Scope of This Chapter..................................................................................................................... 17-1
Preparing for Complete Database Recovery.................................................................................... 17-2
Identifying the Database Files to Restore or Recover................................................................ 17-3
Determining the DBID of the Database ....................................................................................... 17-5
xii
Previewing Backups Used in Restore Operations...................................................................... 17-5
Validating Backups Before Restoring Them ............................................................................... 17-8
Restoring Archived Redo Logs Needed for Recovery............................................................... 17-8
Performing Complete Database Recovery ..................................................................................... 17-10
About Complete Database Recovery ......................................................................................... 17-10
Performing Complete Recovery of the Whole Database......................................................... 17-10
Performing Complete Recovery of a Tablespace...................................................................... 17-13
Performing Complete Recovery After Switching to a Copy................................................... 17-16
18 Performing Flashback and Database Point-in-Time Recovery
Overview of Oracle Flashback Technology and Database Point-in-Time Recovery............... 18-1
Purpose of Flashback and Database Point-in-Time-Recovery ................................................. 18-1
Basic Concepts of Point-in-Time Recovery and Flashback Features....................................... 18-1
Rewinding a Table with Flashback Table........................................................................................ 18-4
Prerequisites of Flashback Table................................................................................................... 18-4
Performing a Flashback Table Operation.................................................................................... 18-5
Rewinding a DROP TABLE Operation with Flashback Drop..................................................... 18-7
About Flashback Drop.................................................................................................................... 18-7
Prerequisites of Flashback Drop ................................................................................................... 18-7
Performing a Flashback Drop Operation..................................................................................... 18-8
Rewinding a Database with Flashback Database......................................................................... 18-11
Prerequisites of Flashback Database .......................................................................................... 18-11
Performing a Flashback Database Operation............................................................................ 18-11
Monitoring Flashback Database.................................................................................................. 18-14
Performing Database Point-in-Time Recovery ............................................................................. 18-15
Prerequisites of Database Point-in-Time Recovery.................................................................. 18-15
Performing Database Point-in-Time Recovery......................................................................... 18-15
Flashback and Database Point-in-Time Recovery Scenarios ..................................................... 18-17
Rewinding an OPEN RESETLOGS Operation with Flashback Database............................. 18-17
Rewinding the Database to an SCN in an Abandoned Incarnation Branch......................... 18-19
Recovering the Database to an Ancestor Incarnation.............................................................. 18-20
19 Performing Block Media Recovery
Overview of Block Media Recovery.................................................................................................. 19-1
Purpose of Block Media Recovery................................................................................................ 19-1
Basic Concepts of Block Media Recovery.................................................................................... 19-2
Prerequisites for Block Media Recovery .......................................................................................... 19-4
Recovering Individual Blocks ............................................................................................................ 19-4
Recovering All Blocks in V$DATABASE_BLOCK_CORRUPTION.......................................... 19-5
20 Performing RMAN Recovery: Advanced Scenarios
Recovering a NOARCHIVELOG Database with Incremental Backups .................................... 20-1
Restoring the Server Parameter File .................................................................................................. 20-2
Restoring the Server Parameter File from a Control File Autobackup ................................... 20-3
Creating an Initialization Parameter File with RMAN.............................................................. 20-4
Performing Recovery with a Backup Control File.......................................................................... 20-4
xiii
About Recovery with a Backup Control File .............................................................................. 20-4
Performing Recovery with a Backup Control File and No Recovery Catalog....................... 20-6
Performing Disaster Recovery............................................................................................................ 20-8
Prerequisites of Disaster Recovery ............................................................................................... 20-8
Recovering the Database After a Disaster................................................................................... 20-9
Restoring a Database on a New Host .............................................................................................. 20-11
Preparing to Restore a Database on a New Host ..................................................................... 20-11
Testing the Restore of a Database on a New Host ................................................................... 20-12
21 Performing RMAN Tablespace Point-in-Time Recovery (TSPITR)
Overview of RMAN TSPITR .............................................................................................................. 21-1
Purpose of RMAN TSPITR ............................................................................................................ 21-1
Basic Concepts of RMAN TSPITR ................................................................................................ 21-2
TSPITR Restrictions, Special Cases, and Limitations.................................................................... 21-5
Limitations of TSPITR .................................................................................................................... 21-5
Special Considerations When Not Using a Recovery Catalog ................................................. 21-6
Planning and Preparing for TSPITR ................................................................................................. 21-6
Step 1: Select the Right Target Time for TSPITR ........................................................................ 21-6
Step 2: Determine the Recovery Set.............................................................................................. 21-7
Step 3: Identify and Preserve Objects That Are Lost After TSPITR......................................... 21-8
Performing Fully Automated RMAN TSPITR................................................................................ 21-9
Overriding Defaults for RMAN TSPITR with an RMAN-Managed Auxiliary Instance ..... 21-10
Renaming TSPITR Recovery Set Data Files with SET NEWNAME ...................................... 21-11
Naming TSPITR Auxiliary Set Data Files.................................................................................. 21-11
Using Image Copies for Faster RMAN TSPITR Performance ................................................ 21-15
Customizing Initialization Parameters for the Automatic Auxiliary Instance in TSPITR . 21-17
Performing RMAN TSPITR Using Your Own Auxiliary Instance ........................................... 21-19
Preparing Your Own Auxiliary Instance for RMAN TSPITR ................................................ 21-19
Preparing RMAN Commands for TSPITR with Your Own Auxiliary Instance.................. 21-21
Executing TSPITR with Your Own Auxiliary Instance ........................................................... 21-22
Performing TSPITR with Your Own Auxiliary Instance: Scenario........................................ 21-23
Troubleshooting RMAN TSPITR .................................................................................................... 21-24
Troubleshooting Filename Conflicts .......................................................................................... 21-24
Troubleshooting the Identification of Tablespaces with Undo Segments............................ 21-24
Troubleshooting the Restart of a Manual Auxiliary Instance After TSPITR Failure .......... 21-24
Part VI Tuning and Troubleshooting
22 Tuning RMAN Performance
Purpose of RMAN Performance Tuning .......................................................................................... 22-1
Basic Concepts of RMAN Performance Tuning.............................................................................. 22-1
Read Phase ....................................................................................................................................... 22-3
Copy Phase....................................................................................................................................... 22-6
Write Phase for System Backup Tape (SBT)................................................................................ 22-6
Write Phase for Disk....................................................................................................................... 22-9
Using V$ Views to Diagnose RMAN Performance Problems.................................................... 22-10
xiv
Monitoring RMAN Job Progress with V$SESSION_LONGOPS ........................................... 22-10
Identifying Bottlenecks with V$BACKUP_SYNC_IO and V$BACKUP_ASYNC_IO ........ 22-12
Tuning RMAN Backup Performance .............................................................................................. 22-13
Step 1: Remove the RATE Parameter from Channel Settings ................................................ 22-13
Step 2: If You Use Synchronous Disk I/O, Set DBWR_IO_SLAVES..................................... 22-14
Step 3: If You Fail to Allocate Shared Memory, Set LARGE_POOL_SIZE........................... 22-14
Step 4: Tune the Read, Write, and Copy Phases....................................................................... 22-15
23 Troubleshooting RMAN Operations
Interpreting RMAN Message Output ............................................................................................... 23-1
Identifying Types of Message Output ......................................................................................... 23-1
Recognizing RMAN Error Message Stacks ................................................................................. 23-2
Identifying Error Codes ................................................................................................................. 23-2
Interpreting RMAN Error Stacks.................................................................................................. 23-5
Identifying RMAN Return Codes................................................................................................. 23-7
Using V$ Views for RMAN Troubleshooting ................................................................................. 23-7
Monitoring RMAN Interaction with the Media Manager ........................................................ 23-7
Correlating Server Sessions with RMAN Channels................................................................... 23-8
Testing the Media Management API .............................................................................................. 23-11
Obtaining the sbttest Utility ........................................................................................................ 23-11
Obtaining Online Documentation for the sbttest Utility......................................................... 23-11
Using the sbttest Utility................................................................................................................ 23-12
Terminating an RMAN Command .................................................................................................. 23-12
Terminating the Session with ALTER SYSTEM KILL SESSION............................................ 23-13
Terminating the Session at the Operating System Level......................................................... 23-13
Terminating an RMAN Session That Is Not Responding in the Media Manager............... 23-13
Part VII Transferring Data with RMAN
24 Duplicating a Database
Overview of RMAN Database Duplication..................................................................................... 24-1
Purpose of Database Duplication ................................................................................................. 24-1
Basic Concepts of Database Duplication ..................................................................................... 24-2
Basic Steps of Database Duplication ............................................................................................ 24-6
Preparing to Duplicate a Database .................................................................................................... 24-6
Step 1: Choosing a Duplication Technique ................................................................................. 24-7
Step 2: Choosing a Strategy for Naming Duplicate Files .......................................................... 24-8
Step 3: Making Backups Accessible to the Duplicate Instance................................................. 24-9
Step 4: Preparing Remote Access to Databases ........................................................................ 24-11
Step 5: Creating an Initialization Parameter File and Starting the Auxiliary Instance....... 24-12
Placing the Source Database in the Proper State .......................................................................... 24-13
Starting RMAN and Connecting to Databases.............................................................................. 24-13
Configuring RMAN Channels for Use in Duplication................................................................ 24-14
Configuring Channels for Active Database Duplication ........................................................ 24-14
Configuring Channels for Backup-Based Duplication............................................................ 24-14
Duplicating a Database ...................................................................................................................... 24-15
xv
Backup-Based Duplication Without a Target Connection: Example..................................... 24-15
Backup-Based Duplication with a Target Connection: Example........................................... 24-16
Backup-Based Duplication Without a Target and a Recovery Catalog Connection: Example.......
24-16
Restarting DUPLICATE After a Failure.......................................................................................... 24-17
25 Duplicating a Database: Advanced Topics
Specifying Alternative Names for Duplicate Database Files....................................................... 25-1
Specifying Non-OMF or Non-ASM Alternative Names for Duplicate Database Files......... 25-1
Specifying OMF or ASM Alternative Names for Duplicate Database Files........................... 25-4
Making Disk Backups Accessible Without Shared Disk.............................................................. 25-8
Duplicating a Database When No Server Parameter File Exists.................................................. 25-9
Starting the Auxiliary Instance When No Server Parameter File Exists................................... 25-10
Duplicating a Subset of the Source Database Tablespaces ........................................................ 25-11
Excluding Specified Tablespaces ................................................................................................ 25-11
Including Specified Tablespaces................................................................................................. 25-12
26 Creating Transportable Tablespace Sets
Overview of Creating Transportable Tablespace Sets................................................................... 26-1
Purpose of Creating Transportable Tablespace Sets.................................................................. 26-1
Basic Concepts of Transportable Tablespace Sets ...................................................................... 26-2
Basic Steps of Creating Transportable Tablespace Sets............................................................. 26-4
Customizing Initialization Parameters for the Auxiliary Instance ............................................. 26-5
Setting Initialization Parameters for the Auxiliary Instance..................................................... 26-5
Setting the Location of the Auxiliary Instance Parameter File................................................. 26-6
Creating a Transportable Tablespace Set......................................................................................... 26-6
Troubleshooting the Creation of Transportable Tablespace Sets ............................................... 26-7
Transportable Tablespace Set Scenarios .......................................................................................... 26-8
Creating a Transportable Tablespace Set at a Specified Time or SCN.................................... 26-8
Specifying Locations for Data Pump Files................................................................................... 26-8
Specifying Auxiliary File Locations.............................................................................................. 26-9
27 Transporting Data Across Platforms
Overview of Cross-Platform Data Transportation.......................................................................... 27-1
Purpose of Cross-Platform Data Transportation........................................................................ 27-1
Basic Concepts of Cross-Platform Data Transportation............................................................ 27-2
Performing Cross-Platform Tablespace Conversion on the Source Host .................................. 27-3
Performing Cross-Platform Data File Conversion on the Destination Host ............................. 27-4
About Cross-Platform Data File Conversion on the Destination Host ................................... 27-4
Using CONVERT DATAFILE to Convert Data File Formats................................................... 27-5
Checking the Database Before Cross-Platform Database Conversion ....................................... 27-7
Converting Data Files on the Source Host When Transporting a Database.............................. 27-9
Converting Data Files on the Destination Host When Transporting a Database .................. 27-11
Performing Preliminary Data File Conversion Steps on the Source Host............................ 27-12
Converting Data Files on the Destination Host........................................................................ 27-13
xvi
Part VIII Performing User-Managed Backup and Recovery
28 Making User-Managed Database Backups
Querying V$ Views to Obtain Backup Information ...................................................................... 28-1
Listing Database Files Before a Backup ....................................................................................... 28-1
Determining Data File Status for Online Tablespace Backups................................................. 28-2
Making User-Managed Backups of the Whole Database.............................................................. 28-3
Making User-Managed Backups of Tablespaces and Data Files................................................. 28-4
Making User-Managed Backups of Offline Tablespaces and Data Files ................................ 28-4
Making User-Managed Backups of Online Tablespaces and Data Files................................. 28-5
Making User-Managed Backups of the Control File.................................................................... 28-10
Backing Up the Control File to a Binary File............................................................................. 28-10
Backing Up the Control File to a Trace File............................................................................... 28-11
Making User-Managed Backups of Archived Redo Logs ........................................................... 28-11
Making User-Managed Backups in SUSPEND Mode ................................................................. 28-11
About the Suspend/Resume Feature......................................................................................... 28-12
Making Backups in a Suspended Database............................................................................... 28-12
Making User-Managed Backups to Raw Devices......................................................................... 28-14
Backing Up to Raw Devices on Linux and UNIX..................................................................... 28-14
Backing Up to Raw Devices on Windows................................................................................. 28-16
Making Backups with the Volume Shadow Copy Service (VSS) ............................................. 28-17
Verifying User-Managed Data File Backups ................................................................................. 28-17
Testing the Restoration of Data File Backups ........................................................................... 28-17
Running the DBVERIFY Utility .................................................................................................. 28-17
29 Performing User-Managed Database Flashback and Recovery
Performing Flashback Database with SQL*Plus ............................................................................ 29-1
Overview of User-Managed Media Recovery.................................................................................. 29-2
About User-Managed Restore and Recovery.............................................................................. 29-2
Automatic Recovery with the RECOVER Command................................................................ 29-4
Recovery When Archived Logs Are in the Default Location ................................................... 29-5
Recovery When Archived Logs Are in a Nondefault Location................................................ 29-5
Recovery Cancellation.................................................................................................................... 29-6
Parallel Media Recovery ................................................................................................................ 29-7
Performing Complete Database Recovery ....................................................................................... 29-7
Performing Closed Database Recovery ....................................................................................... 29-8
Performing Open Database Recovery........................................................................................ 29-11
Performing Incomplete Database Recovery................................................................................... 29-13
Performing Cancel-Based Incomplete Recovery...................................................................... 29-14
Performing Time-Based or Change-Based Incomplete Recovery.......................................... 29-16
Recovering a Database in NOARCHIVELOG Mode................................................................... 29-16
Troubleshooting Media Recovery.................................................................................................... 29-18
About User-Managed Media Recovery Problems.................................................................... 29-18
Investigating the Media Recovery Problem: Phase 1............................................................... 29-20
Trying to Fix the Recovery Problem Without Corrupting Blocks: Phase 2.......................... 29-20
Deciding Whether to Allow Recovery to Mark as Corrupt Blocks: Phase 3 ........................ 29-22
xvii
Allowing Recovery to Corrupt Blocks: Phase 4........................................................................ 29-23
Performing Trial Recovery........................................................................................................... 29-23
30 Performing User-Managed Recovery: Advanced Scenarios
Responding to the Loss of a Subset of the Current Control Files ............................................... 30-1
Copying a Multiplexed Control File to a Default Location ...................................................... 30-1
Copying a Multiplexed Control File to a Nondefault Location ............................................... 30-2
Recovering After the Loss of All Current Control Files ................................................................ 30-2
Recovering with a Backup Control File in the Default Location ............................................. 30-3
Recovering with a Backup Control File in a Nondefault Location ......................................... 30-4
Recovering Through an Added Data File with a Backup Control File ................................... 30-4
Recovering Read-Only Tablespaces with a Backup Control File............................................. 30-5
Re-Creating a Control File ................................................................................................................... 30-6
Recovering Through a RESETLOGS with a Created Control File........................................... 30-7
Recovery of Read-Only Files with a Re-Created Control File.................................................. 30-8
Re-Creating Data Files When Backups Are Unavailable .............................................................. 30-8
Recovering NOLOGGING Tables and Indexes.............................................................................. 30-9
Recovering Transportable Tablespaces .......................................................................................... 30-10
Recovering After the Loss of Online Redo Log Files................................................................... 30-10
Recovering After Losing a Member of a Multiplexed Online Redo Log Group ................. 30-11
Recovering After Losing All Members of an Online Redo Log Group................................. 30-12
Recovering from a Dropped Table Without Using Flashback Features................................... 30-15
Dropping a Database with SQL*Plus.............................................................................................. 30-16
Glossary
Index
xviii

xix
Preface
This preface contains the following topics:
■Audience
■Documentation Accessibility
■Related Documentation
■Relocated Documentation
■Conventions
Audience
Backup and Recovery User's Guide is intended for database administrators who perform
the following tasks:
■Back up, restore, and recover Oracle databases
■Perform maintenance on backups of database files
■Transfer data between a file system and ASM or between platforms when
installing Oracle Database
To use this document, you must know the following:
■Relational database concepts and basic database administration as described in
Oracle Database Concepts and the Oracle Database Administrator's Guide
■The operating system environment under which you run the database
Documentation Accessibility
For information about Oracle's commitment to accessibility, visit the Oracle
Accessibility Program website at
http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc
.
Access to Oracle Support
Oracle customers have access to electronic support through My Oracle Support. For
information, visit
http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info
or
visit
http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs
if you are hearing
impaired.
Related Documentation
For more information about backup and recovery, see these Oracle resources:

xx
■Oracle Database Backup and Recovery Reference
■Oracle Database Utilities
■Oracle Database Storage Administrator's Guide
You can access information about the Backup Solutions Program (BSP) at
http://www.oracle.com/technetwork/database/features/availability/bsp-08881
4.html
Many books in the documentation set use the sample schemas of the seed database,
which is installed by default when you install Oracle Database. Refer to Oracle
Database Sample Schemas for information about how these schemas were created and
how you can use them yourself.
Relocated Documentation
The following chapters have been relocated:
■Chapter 24: "Creating Transportable Tablespace Sets." You can reference this
material in Oracle Database Administrator's Guide.
■Chapter 26: "Performing ASM Data Migration." This information is now included
in the Database Storage Administrator's Guide.
Conventions
The following text conventions are used in this document:
Convention Meaning
boldface Boldface type indicates graphical user interface elements associated
with an action, or terms defined in text or the glossary.
italic Italic type indicates book titles, emphasis, or placeholder variables for
which you supply particular values.
monospace
Monospace type indicates commands within a paragraph, URLs, code
in examples, text that appears on the screen, or text that you enter.

xxi
What's New in Backup and Recovery?
This section describes new features of backup and recovery for Oracle Database 11g
Release 2 and provides pointers to additional information.
The release of Recovery Manager (RMAN) continues to enhance and extend the
reliability, efficiency, and availability of Oracle Database backup and recovery. Some
highlights in this release are the inclusion of Oracle's Database Backup Cloud offering,
referred to as Oracle Secure Backup (OSB) Cloud Module, the addition of Expanded
Backup Compression Levels, and several DUPLICATE Database Command
Enhancements.
New Backup and Recovery Features for Oracle 11g Release 2
The following Backup and Recovery features are new in Oracle Database 11g Release 2
(11.2):
■Oracle Secure Backup (OSB) Cloud Module
Users can take advantage of the Internet-based data storage services offered by
Amazon Simple Storage Service (Amazon S3) for their RMAN backup and
recovery tasks. The OSB Cloud Module interface extends the Amazon S3
functionality and provides an easy-to-manage, cost-efficient, and scalable
alternative to maintaining in-house data storage and a local, fully configured
backup infrastructure.
■DUPLICATE Database Command Enhancements
Users can duplicate a database without connecting to a target database. The only
requirements for this operation are a connection to a catalog and an auxiliary
database. This new functionality is useful when the target database is not always
available.
Users can also duplicate a database without connecting to a target database and a
recovery catalog. In this case, the only requirement is that you provide a disk
backup location where RMAN can find all the backups, data file copies, archived
logs, and control file copies for database duplication. This database duplication
enhancement is helpful when it is not possible to connect to the target database
and the recovery catalog.
When you duplicate from a target database, RMAN determines if any excluded
tablespaces contain
SYS-
owned objects, materialized views, and identifies
tablespaces that are not self-contained before starting any duplication operations.
See Also: Appendix C in Oracle Database Backup and Recovery
Reference

xxii
■RMAN Tablespace Point-in-Time Recovery (TSPITR) Enhancements
TSPITR can be used to recover a dropped tablespace and to recover to a point in
time before the tablespace was brought online. The latter TSPITR operation can be
repeated as many times as necessary.
■Automatic Block Repair
The enhancements to corrupt block detection make block repair more efficient and
increase availability. The automatic block repair enhancement complements the
Oracle Database 11g Release 1 automatic block corruption detection.
A detected corrupt block (for example, through a user's SQL query) is now
automatically repaired by using a good block from a physical standby database.
With automatic block repair, a user querying data in the corrupt block no longer
sees the corrupt block error message displayed (
ORA-01578
). Instead, there is a
pause while the corrupt block is repaired, and then the results of the SQL query
are returned. The automatic block repair is transparent to the user unless the
repair fails. Block recovery is faster because no redo must be applied to the block
that is taken from the physical standby database.
Automatic block repair requires an Oracle Active Data Guard license because
real-time query mode must be enabled on the physical standby database.
The operation occurs automatically but can also be explicitly invoked with the
RMAN
RECOVER BLOCK
command.
■
SET NEWNAME
Options
The
SET NEWNAME
command is more powerful and easier to use. You can use this
command on a specific tablespace or on all data files and temp files. You can also
change the names for multiple files in the database.
A new string format identifier "
%b
" makes it easier to move files around. Using
SET
NEWNAME
with the format identifier "
%b
" enables you to designate a file name
without its directory path. This option is particularly useful when you want to
keep the names of your data files the same but move the data files to a different
directory location.
See Also: Chapter 24, "Duplicating a Database", and Oracle Database
Backup and Recovery Reference to learn about the associated
DUPLICATE
command options
NOREDO
and
UNDO TABLESPACE
Note: Before this release, TSPITR did not operate on dropped
tablespaces.
See Also: Chapter 19, "Performing Block Media Recovery" and the
Oracle Database Backup and Recovery Reference
RECOVER
command
See Also:
■Chapter 25, "Duplicating a Database: Advanced Topics"
■Example 25–2, "Duplicating with SET NEWNAME FOR
DATAFILE and FOR TABLESPACE"
■The
SET
option in the Oracle Database Backup and Recovery Reference
to learn about the enhanced
SET NEWNAME
functionality
xxiii
■
CONVERT DATABASE
Option
A new option,
SKIP UNNECESSARY DATAFILES,
is now supported for the
CONVERT
DATABASE
command. When the option is invoked, the only data files that are
converted are those that require RMAN processing during transfer between the
specified platforms. The rest of the data files can be used by the destination
database through shared storage or path name. By skipping the conversion of data
files that do not contain undo segments, overall database transport time can be
reduced. You can use this option when converting at the source or converting
ON
DESTINATION PLATFORM
.
■Expanded Backup Compression Levels
RMAN now offers a wider range of compression levels with the Advanced
Compression Option (ACO). Although the existing
BASIC
compression option may
be suitable for most environments, you may want to explore the ACO backup
compression levels (
LOW
,
MEDIUM
, and
HIGH
) to achieve better performance or
higher compression ratios.
■
INCARNATION
Specifier Enhancement
Incarnations may now be used to further qualify archived redo log ranges for the
BACKUP
,
RESTORE
, and
LIST
commands. You can now specify
ALL
or
CURRENT
or
designate a particular incarnation number when listing ranges of archived logs.
■
TO DESTINATION
syntax has been added to the
BACKUP
command. This addition
enables you to designate a specific directory location for backups to disk and is
primarily for use with the
BACKUP RECOVERY AREA
command. If backup
optimization is enabled, then RMAN only skips backups of identical files that
reside in the directory location specified by the
TO DESTINATION
option.
Changes in RMAN Functionality or Prerequisites
The Block Change Tracking feature can be used at a physical standby database only if
the Oracle Active Data Guard option is licensed.
See Also: The
CONVERT DATABASE
option in the Oracle Database
Backup and Recovery Reference
See Also: "Binary Compression for Backup Sets" on page 8-4 and the
CONFIGURE
...
COMPRESSION ALGORITHM
command option in the Oracle
Database Backup and Recovery Reference
See Also: Oracle Database Backup and Recovery Reference for settings
and examples
See Also:
BACKUP
command and examples of the new setting in the
Oracle Database Backup and Recovery Reference
xxiv

1
Introduction to Backup and Recovery 1-1
1
Introduction to Backup and Recovery
This chapter explains Oracle Database backup and recovery and summarizes the
Oracle solutions. This chapter contains the following topics:
■Purpose of Backup and Recovery
■Oracle Backup and Recovery Solutions
■Oracle Flashback Technology
■Data Recovery Advisor
■Backup and Recovery Documentation Roadmap
Purpose of Backup and Recovery
As a backup administrator, your principal duty is to devise, implement, and manage a
backup and recovery strategy. In general, the purpose of a backup and recovery
strategy is to protect the database against data loss and reconstruct the database after
data loss. Typically, backup administration tasks include the following:
■Planning and testing responses to different kinds of failures
■Configuring the database environment for backup and recovery
■Setting up a backup schedule
■Monitoring the backup and recovery environment
■Troubleshooting backup problems
■Recovering from data loss if the need arises
As a backup administrator, you may also be asked to perform other duties that are
related to backup and recovery:
■Data preservation, which involves creating a database copy for long-term storage
■Data transfer, which involves moving data from one database or one host to
another
The purpose of this manual is to explain how to perform the preceding tasks.
Note: To get started with Recovery Manager (RMAN) right away,
proceed to Chapter 2, "Getting Started with RMAN."

Purpose of Backup and Recovery
1-2 Backup and Recovery User's Guide
Data Protection
As a backup administrator, your primary job is making and monitoring backups for
data protection. A backup is a copy of data of a database that you can use to
reconstruct data. A backup can be either a physical backup or a logical backup.
Physical backups are copies of the physical files used in storing and recovering a
database. These files include data files, control files, and archived redo logs.
Ultimately, every physical backup is a copy of files that store database information to
another location, whether on disk or on offline storage media such as tape.
Logical backups contain logical data such as tables and stored procedures. You can use
Oracle Data Pump to export logical data to binary files, which you can later import
into the database. The Data Pump command-line clients
expdp
and
impdp
use the
DBMS_DATAPUMP
and
DBMS_METADATA
PL/SQL packages.
Physical backups are the foundation of any sound backup and recovery strategy.
Logical backups are a useful supplement to physical backups in many circumstances
but are not sufficient protection against data loss without physical backups.
Unless otherwise specified, the term backup as used in the backup and recovery
documentation refers to a physical backup. Backing up a database is the act of making
a physical backup. The focus in the backup and recovery documentation set is almost
exclusively on physical backups.
While several problems can halt the normal operation of an Oracle database or affect
database I/O operations, only the following typically require DBA intervention and
data recovery: media failure, user errors, and application errors. Other failures may
require DBA intervention without causing data loss or requiring recovery from
backup. For example, you may need to restart the database after an instance failure or
allocate more disk space after statement failure because of a full data file.
Media Failures
A media failure is a physical problem with a disk that causes a failure of a read from or
write to a disk file that is required to run the database. Any database file can be
vulnerable to a media failure. The appropriate recovery technique following a media
failure depends on the files affected and the types of backup available.
One particularly important aspect of backup and recovery is developing a disaster
recovery strategy to protect against catastrophic data loss, for example, the loss of an
entire database host.
User Errors
User errors occur when, either due to an error in application logic or a manual
mistake, data in a database is changed or deleted incorrectly. User errors are estimated
to be the greatest single cause of database downtime.
Data loss due to user error can be either localized or widespread. An example of
localized damage is deleting the wrong person from the employees table. This type of
damage requires surgical detection and repair. An example of widespread damage is a
batch job that deletes the company orders for the current month. In this case, drastic
action is required to avoid a extensive database downtime.
While user training and careful management of privileges can prevent most user
errors, your backup strategy determines how gracefully you recover the lost data
when user error does cause data loss.

Oracle Backup and Recovery Solutions
Introduction to Backup and Recovery 1-3
Application Errors
Sometimes a software malfunction can corrupt data blocks. In a physical corruption,
which is also called a media corruption, the database does not recognize the block at
all: the checksum is invalid, the block contains all zeros, or the header and footer of
the block do not match. If the corruption is not extensive, then you can often repair it
easily with block media recovery.
Data Preservation
Data preservation is related to data protection, but serves a different purpose. For
example, you may need to preserve a copy of a database as it existed at the end of a
business quarter. This backup is not part of the disaster recovery strategy. The media
to which these backups are written are often unavailable after the backup is complete.
You may send the tape into fire storage or ship a portable hard drive to a testing
facility. RMAN provides a convenient way to create a backup and exempt it from your
backup retention policy. This type of backup is known as an archival backup.
Data Transfer
In some situations you may need to take a backup of a database or database
component and move it to another location. For example, you can use Recovery
Manager (RMAN) to create a database copy, create a tablespace copy that can be
imported into another database, or move an entire database from one platform to
another. These tasks are not strictly speaking part of a backup and recovery strategy,
but they do require the use of database backups, and so may be included in the duties
of a backup administrator.
Oracle Backup and Recovery Solutions
When implementing a backup and recovery strategy, you have the following solutions
available:
■Recovery Manager (RMAN)
Recovery Manager is fully integrated with the Oracle database to perform a range
of backup and recovery activities, including maintaining an RMAN repository of
historical data about backups. You can access RMAN through the command line
or through Oracle Enterprise Manager.
■User-managed backup and recovery
In this solution, you perform backup and recovery with a mixture of host
operating system commands and SQL*Plus recovery commands.You are
responsible for determining all aspects of when and how backups and recovery
are done.
These solutions are supported by Oracle and are fully documented, but RMAN is the
preferred solution for database backup and recovery. RMAN provides a common
See Also:
■Chapter 9, "Backing Up the Database"
■Oracle Database Utilities to learn how to use Data Pump
See Also: "Making Database Backups for Long-Term Storage" on
page 9-23
See Also: The chapters in Part VII, "Transferring Data with RMAN"

Oracle Backup and Recovery Solutions
1-4 Backup and Recovery User's Guide
interface for backup tasks across different host operating systems, and offers several
backup techniques not available through user-managed methods.
Most of this manual focuses on RMAN-based backup and recovery. User-managed
backup and recovery techniques are covered in Section VIII, "Performing
User-Managed Backup and Recovery." The most noteworthy are the following:
■Incremental backups
An incremental backup stores only blocks changed since a previous backup.
Thus, they provide more compact backups and faster recovery, thereby reducing
the need to apply redo during data file media recovery. If you enable block
change tracking, then you can improve performance by avoiding full scans of
every input data file. You use the
BACKUP INCREMENTAL
command to perform
incremental backups.
■Block media recovery
You can repair a data file with only a small number of corrupt data blocks without
taking it offline or restoring it from backup. You use the
RECOVER BLOCK
command
to perform block media recovery.
■Binary compression
A binary compression mechanism integrated into Oracle Database reduces the
size of backups.
■Encrypted backups
RMAN uses backup encryption capabilities integrated into Oracle Database to
store backup sets in an encrypted format. To create encrypted backups on disk, the
database must use the Advanced Security Option. To create encrypted backups
directly on tape, RMAN must use the Oracle Secure Backup SBT interface, but
does not require the Advanced Security Option.
■Automated database duplication
Easily create a copy of your database, supporting various storage configurations,
including direct duplication between ASM databases.
■ Cross-platform data conversion
Whether you use RMAN or user-managed methods, you can supplement physical
backups with logical backups of schema objects made with Data Pump Export utility.
You can later use Data Pump Import to re-create data after restore and recovery.
Logical backups are mostly beyond the scope of the backup and recovery
documentation.
Table 1–1 summarizes the features of the different backup techniques.
Table 1–1 Feature Comparison of Backup Techniques
Feature Recovery Manager User-Managed Data Pump Export
Closed database backups Supported. Requires
instance to be mounted. Supported. Not supported.
Open database backups Supported. No need to use
BEGIN
/
END
BACKUP
statements.
Supported. Must use
BEGIN
/
END
BACKUP
statements.
Requires rollback or undo
segments to generate
consistent backups.
Incremental backups Supported. Not supported. Not supported.

Oracle Flashback Technology
Introduction to Backup and Recovery 1-5
Oracle Flashback Technology
As explained in Oracle Database Concepts, Oracle Flashback Technology complements
your physical backup and recovery strategy. This set of features provides an additional
layer of data protection. Specifically, you can use the various features of Oracle
Flashback to view past states of data and rewind your database without restoring
backups or performing point-in-time recovery. In general, flashback features are more
efficient and less disruptive than media recovery in most situations in which they
apply.
Logical Flashback Features
Most of the flashback features of Oracle operate at the logical level, enabling you to
view and manipulate database objects. The logical-level flashback features of Oracle
do not depend on RMAN and are available whether or not RMAN is part of your
backup strategy. Except for Oracle Flashback Drop, the logical flashback features rely
on undo data, which are records of the effects of each database update and the values
overwritten in the update.
Oracle Database includes the following logical flashback features:
■Oracle Flashback Query
Corrupt block detection Supported. Identifies
corrupt blocks and logs in
V$DATABASE_BLOCK_
CORRUPTION
.
Not supported. Supported. Identifies
corrupt blocks in the
export log.
Automatic specification of
files to include in a backup Supported. Establishes the
name and locations of all
files to be backed up (whole
database, tablespaces, data
files, control files, and so
on).
Not supported. Files to be
backed up must be located
and copied manually.
Not applicable.
Backup repository Supported. Backups are
recorded in the control file,
which is the main repository
of RMAN metadata.
Additionally, you can store
this metadata in a recovery
catalog, which is a schema
in a different database.
Not supported. DBA must
keep own records of
backups.
Not supported.
Backups to a media
manager Supported. Interfaces with a
media manager. RMAN also
supports proxy copy, a
feature that allows a media
manager to manage
completely the transfer of
data between disk and
backup media.
Supported. Backup to tape
is manual or controlled by
a media manager.
Not supported.
Backup of initialization
parameter file Supported. Supported. Not supported.
Backup of password and
networking files Not supported. Supported. Not supported.
Platform-independent
language for backups Supported. Not supported. Supported.
Table 1–1 (Cont.) Feature Comparison of Backup Techniques
Feature Recovery Manager User-Managed Data Pump Export

Oracle Flashback Technology
1-6 Backup and Recovery User's Guide
You can specify a target time and run queries against a database, viewing results
as they would have appeared at the target time. To recover from an unwanted
change like an update to a table, you could choose a target time before the error
and run a query to retrieve the contents of the lost rows. Oracle Database Advanced
Application Developer's Guide explains how to use this feature.
■Oracle Flashback Version Query
You can view all versions of all rows that ever existed in one or more tables in a
specified time interval. You can also retrieve metadata about the differing versions
of the rows, including start and end time, operation, and transaction ID of the
transaction that created the version. You can use this feature to recover lost data
values and to audit changes to the tables queried. Oracle Database Advanced
Application Developer's Guide explains how to use this feature.
■Oracle Flashback Transaction Query
You can view changes made by a single transaction, or by all the transactions
during a specific time period. Oracle Database Advanced Application Developer's
Guide explains how to use this feature.
■Oracle Flashback Transaction
You can reverse a transaction. Oracle Database determines the dependencies
between transactions and in effect creates a compensating transaction that reverses
the unwanted changes. The database rewinds to a state as if the transaction, and
any transactions that could be dependent on it, had never happened. Oracle
Database Advanced Application Developer's Guide explains how to use this feature.
■Oracle Flashback Table
You can recover a table or set of tables to a specified point in time in the past
without taking any part of the database offline. In many cases, Flashback Table
eliminates the need to perform more complicated point-in-time recovery
operations. Flashback Table restores tables while automatically maintaining
associated attributes such as current indexes, triggers, and constraints, and in this
way enabling you to avoid finding and restoring database-specific properties.
"Rewinding a Table with Flashback Table" on page 18-4 explains how to use this
feature.
■Oracle Flashback Drop
You can reverse the effects of a
DROP
TABLE
statement. "Rewinding a DROP TABLE
Operation with Flashback Drop" on page 18-7 explains how to use this feature.
A flashback data archive enables you to use some logical flashback features to access
data from far back in the past. A flashback data archive consists of one or more
tablespaces or parts of tablespaces. When you create a flashback data archive, you
specify the name, retention period, and tablespace. You can also specify a default
flashback data archive. The database automatically purges old historical data the day
after the retention period expires.
You can turn flashback archiving on and off for individual tables. By default, flashback
archiving is turned off for every table.

Data Recovery Advisor
Introduction to Backup and Recovery 1-7
Flashback Database
At the physical level, Oracle Flashback Database provides a more efficient data
protection alternative to database point-in-time recovery (DBPITR). If the current
data files have unwanted changes, then you can use the RMAN command
FLASHBACK
DATABASE
to revert the data files to their contents at a past time. The end product is
much like the result of a DBPITR, but is generally much faster because it does not
require restoring data files from backup and requires less redo than media recovery.
Flashback Database uses flashback logs to access past versions of data blocks and
some information from archived redo logs. Flashback Database requires that you
configure a fast recovery area for a database because the flashback logs can only be
stored there. Flashback logging is not enabled by default. Space used for flashback logs
is managed automatically by the database and balanced against space required for
other files in the fast recovery area.
Oracle Database also supports restore points along with Flashback Database and
backup and recovery. A restore point is an alias corresponding to a system change
number (SCN). You can create a restore point at any time if you anticipate needing to
return part or all of a database to its contents at that time. A guaranteed restore point
ensures that you can use Flashback Database to return a database to the time of the
restore point.
Data Recovery Advisor
Oracle Database includes a Data Recovery Advisor tool that automatically diagnoses
persistent data failures, presents appropriate repair options, and executes repairs at
your request. Data Recovery Advisor provides a single point of entry for Oracle
backup and recovery solutions. You can use Data Recovery Advisor through the
Enterprise Manager Database Control or Grid Control console or through the RMAN
command-line client.
A database failure usually manifests itself as a set of symptoms: error messages, alerts,
trace files and dumps, and failed data integrity checks. Data Recovery Advisor
automatically diagnoses and informs you of these failures. For Data Recovery Advisor,
a failure is a persistent data corruption that can be directly mapped to a set of repair
actions. Each failure has a status of open or closed. Each failure also has a priority of
critical, high, or low.
Failures are detected by data integrity checks, which are diagnostic procedures
executed to assess the health of the database or its components. If a data integrity
check reveals a failure, then Data Recovery Advisor automatically assesses the effect
of a set of failures and maps it to a set of repair options. Usually, Data Recovery
Advisor presents both automated and manual repair options.
See Also:
■Chapter 18, "Performing Flashback and Database Point-in-Time
Recovery" to learn how to perform Flashback Table and
Flashback Drop
■ Oracle Database Advanced Application Developer's Guide for more
information on the logical flashback features
See Also: "Rewinding a Database with Flashback Database" on
page 18-11 to learn how to perform Flashback Database with the
FLASHBACK DATABASE
command

Backup and Recovery Documentation Roadmap
1-8 Backup and Recovery User's Guide
Data Recovery Advisor determines the best automated repair option and its effect on
the database. The repair option may include repairs such as data file restore and
recovery, media recovery, Flashback Database, and so on. Before presenting an
automated repair option, Data Recovery Advisor validates it for the specific
environment and the availability of media components required to complete the
proposed repair.
If you choose an automated repair option, then RMAN coordinates sessions on the
Oracle database to perform the repair for you. The Data Recovery Advisor tool verifies
the repair success and closes the appropriate failures.
Backup and Recovery Documentation Roadmap
Figure 1–1 illustrates the recommended way to navigate the backup and recovery
documentation. The roadmap is divided into two main paths: RMAN and
user-managed backup and recovery. Optional paths are shown as splitting off and then
rejoining each main path.
If you are new to Oracle Database and want to learn about backup recovery, then the
best entry point is Oracle Database 2 Day DBA. The backup and recovery chapter
explains how to use Enterprise Manager to perform basic operations. Optionally, you
can expand your knowledge of basic backup and recovery principles by reading the
relevant chapter in Oracle Database Concepts.
See Also: Chapter 15, "Diagnosing and Repairing Failures with Data
Recovery Advisor," to learn how to use Data Recovery Advisor

Backup and Recovery Documentation Roadmap
Introduction to Backup and Recovery 1-9
Figure 1–1 Backup and Recovery Documentation Roadmap
As shown in Figure 1–1, you can either implement your backup and recovery strategy
with RMAN, which is recommended, or with user-managed tools.
2 Day DBA
Introduction to
Backup and Recovery
User-Managed
Path
Backup and Recovery Concepts
(in
Database Concepts
)
Performing Database
Recovery: Advanced
Performing Block
Media Recovery
Performing Database
Flashback and Recovery
Backing Up the Database
Getting Started
Starting RMAN
Managing the
Recovery Catalog
Configuring the
RMAN Environment
Reporting on RMAN
Operations
Using the Data
Recovery Advisor
Performing Flashback
and DBPITR
Backing Up the Database End
RMAN
Path
Maintaining RMAN
Backups
Performing Advanced
RMAN Recovery
Tuning RMAN
Performance
End
Performing Complete
Database Recovery

Backup and Recovery Documentation Roadmap
1-10 Backup and Recovery User's Guide
Recovery Manager Documentation Roadmap
If you use RMAN as your principal backup and recovery solution, then begin by
reading "Getting Started with RMAN" on page 2-1. This brief chapter, which explains
the most basic RMAN techniques, may be adequate for your purposes. For a more
comprehensive explanation of how to implement a backup and recovery strategy with
RMAN, read the chapters in the following order (optional chapters are not listed):
1. Read Chapter 4, "Starting and Interacting with the RMAN Client."
This chapter explains how to start the RMAN client and connect to databases.
2. Read Chapter 5, "Configuring the RMAN Environment."
This chapter explains how to perform basic tasks such as configuring a fast
recovery area, backup retention policy, and archived redo log deletion policy.
3. Read Chapter 9, "Backing Up the Database."
This chapter explains how to implement a basic backup strategy.
4. Read Chapter 11, "Reporting on RMAN Operations."
This chapter explains how to monitor RMAN backup and recovery operations.
Specifically, the chapter explains how to use the reporting commands (
LIST
,
REPORT
, and
SHOW
) and the relevant V$ and recovery catalog views.
5. Read Chapter 12, "Maintaining RMAN Backups and Repository Records."
This chapter explains how to verify the existence of backups, change the
repository status of backups, delete backups, and perform other maintenance
tasks.
6. Read Chapter 15, "Diagnosing and Repairing Failures with Data Recovery
Advisor."
This chapter explains how to use the Data Recovery Advisor tool. You can use it to
list failures, obtain advice about to respond to these failures, and in some cases
automatically repair the failures.
7. Read Chapter 18, "Performing Flashback and Database Point-in-Time Recovery."
This chapter explains how to use the
FLASHBACK DATABASE
command and perform
point-in-time recovery with the
RECOVER DATABASE
command.
8. Read Chapter 17, "Performing Complete Database Recovery."
This chapter explains how to recover individual tablespaces or the database.
User-Managed Backup and Recovery Documentation Roadmap
If you do not use RMAN as your principal backup and recovery solution, then you
must use third-party tools to make your backups and SQL or SQL*Plus commands to
perform recovery. Read the chapters in the following order:
1. Read Chapter 28, "Making User-Managed Database Backups."
This chapter explains how to make backups with third-party tools.
2. Read Chapter 29, "Performing User-Managed Database Flashback and Recovery."
This chapter explains how to use the SQL statement
FLASHBACK DATABASE
and to
perform recovery with the SQL*Plus
RECOVER
command.
3. Read Chapter 30, "Performing User-Managed Recovery: Advanced Scenarios."
This chapter explains various recovery scenarios.

2
Getting Started with RMAN 2-1
2
Getting Started with RMAN
This chapter is intended for new users who want to start using RMAN right away
without first reading the more detailed chapters in this book. This chapter provides the
briefest possible digest of the most important RMAN concepts and tasks. It is not a
substitute for the rest of the backup and recovery documentation set.
This chapter contains the following topics:
■Overview of the RMAN Environment
■Starting RMAN and Connecting to a Database
■Showing the Default RMAN Configuration
■Backing Up a Database
■Reporting on RMAN Operations
■Maintaining RMAN Backups
■Diagnosing and Repairing Failures with Data Recovery Advisor
■Rewinding a Database with Flashback Database
■Restoring and Recovering Database Files
Overview of the RMAN Environment
Recovery Manager (RMAN) is an Oracle Database client that performs backup and
recovery tasks on your databases and automates administration of your backup
strategies. It greatly simplifies backing up, restoring, and recovering database files.
The RMAN environment consists of the utilities and databases that play a role in
backing up your data. At a minimum, the environment for RMAN must include the
following components:
■A target database
An Oracle database to which RMAN is connected with the
TARGET
keyword. A
target database is a database on which RMAN is performing backup and recovery
operations. RMAN always maintains metadata about its operations on a database
in the control file of the database. The RMAN metadata is known as the RMAN
repository.
■The RMAN client
An Oracle Database executable that interprets commands, directs server sessions
to execute those commands, and records its activity in the target database control
file. The RMAN executable is automatically installed with the database and is

Starting RMAN and Connecting to a Database
2-2 Backup and Recovery User's Guide
typically located in the same directory as the other database executables. For
example, the RMAN client on Linux is located in
$ORACLE_HOME/bin
.
Some environments use the following optional components:
■A fast recovery area
A disk location in which the database can store and manage files related to backup
and recovery. You set the fast recovery area location and size with the
DB_
RECOVERY_FILE_DEST
and
DB_RECOVERY_FILE_DEST_SIZE
initialization parameters.
■A media manager
An application required for RMAN to interact with sequential media devices such
as tape libraries. A media manager controls these devices during backup and
recovery, managing the loading, labeling, and unloading of media. Media
management devices are sometimes called SBT (system backup to tape) devices.
■A recovery catalog
A separate database schema used to record RMAN activity against one or more
target databases. A recovery catalog preserves RMAN repository metadata if the
control file is lost, making it much easier to restore and recover following the loss
of the control file. The database may overwrite older records in the control file, but
RMAN maintains records forever in the catalog unless the records are deleted by
the user.
This chapter explains how to use RMAN in the most basic configuration, which is
without a recovery catalog or media manager.
Starting RMAN and Connecting to a Database
The RMAN client is started by issuing the
rman
command at the command prompt of
your operating system. RMAN then displays a prompt for your commands as shown
in the following example:
% rman
RMAN>
RMAN connections to a database are specified and authenticated in the same way as
SQL*Plus connections to a database. The only difference is that RMAN connections to
a target or auxiliary database require the
SYSDBA
privilege. The
AS SYSDBA
keywords
are implied and cannot be explicitly specified. See Oracle Database Administrator's Guide
to learn about database connection options for SQL*Plus.
You can connect to a database with command-line options or by using the
CONNECT
TARGET
command. The following example starts RMAN and then connects to a target
See Also:
■Chapter 3, "Recovery Manager Architecture"for a more detailed
overview of the RMAN environment
■Oracle Database Backup and Recovery Reference for
BACKUP
command
syntax and semantics
Caution: Good security practice requires that passwords should not
be entered in plain text on the command line. You should enter
passwords in RMAN only when requested by an RMAN prompt. See
Oracle Database Security Guide to learn about password protection.

Showing the Default RMAN Configuration
Getting Started with RMAN 2-3
database through Oracle Net,
AS SYSDBA
is not specified because it is implied. RMAN
prompts for a password.
% rman
RMAN> CONNECT TARGET SYS@prod
target database Password: password
connected to target database: PROD (DBID=39525561)
The following variation starts RMAN and then connects to a target database by using
operating system authentication:
% rman
RMAN> CONNECT TARGET /
connected to target database: PROD (DBID=39525561)
To quit the RMAN client, enter
EXIT
at the RMAN prompt:
RMAN> EXIT
Syntax of Common RMAN Command-line Options
RMAN
[ TARGET connectStringSpec
| { CATALOG connectStringSpec }
| LOG ['] filename ['] [ APPEND ]
.
.
.
]...
connectStringSpec::=
['] [userid] [/ [password]] [@net_service_name] [']
The following example appends the output from an RMAN session to a text file at
/tmp/msglog.log
% rman TARGET / LOG /tmp/msglog.log APPEND
Showing the Default RMAN Configuration
The RMAN backup and recovery environment is preconfigured for each target
database. The configuration is persistent and applies to all subsequent operations on
this target database, even if you exit and restart RMAN.
RMAN configured settings can specify backup devices, configure a connection to a
backup device (known as a channel), policies affecting backup strategy, and others.
The default configuration is adequate for most purposes.
To show the current configuration for a database:
1. Start RMAN and connect to a target database.
2. Run the
SHOW ALL
command.
For example, enter the command at the RMAN prompt as follows:
RMAN> SHOW ALL;
See Also: Chapter 4, "Starting and Interacting with the
RMAN Client," to learn more about starting and using the RMAN
client

Backing Up a Database
2-4 Backup and Recovery User's Guide
The output lists the
CONFIGURE
commands to re-create this configuration.
Backing Up a Database
Use the
BACKUP
command to back up files. RMAN backs up data to the configured
default device for the type of backup requested. By default, RMAN creates backups on
disk. If a fast recovery area is enabled, and if you do not specify the
FORMAT
parameter
(see Table 2–1), then RMAN creates backups in the recovery area and automatically
gives them unique names.
By default, RMAN creates backup sets rather than image copies. A backup set consists
of one or more backup pieces, which are physical files written in a format that only
RMAN can access. A multiplexed backup set contains the blocks from multiple input
files. RMAN can write backup sets to disk or tape.
If you specify
BACKUP
AS
COPY
, then RMAN copies each file as an image copy, which is
a bit-for-bit copy of a database file created on disk. Image copies are identical to copies
created with operating system commands like
cp
on Linux or
COPY
on Windows, but
are recorded in the RMAN repository and so are usable by RMAN. You can use
RMAN to make image copies while the database is open.
Backing Up a Database in ARCHIVELOG Mode
If a database runs in
ARCHIVELOG
mode, then you can back up the database while it is
open. The backup is called an inconsistent backup because redo is required during
recovery to bring the database to a consistent state. If you have the archived redo logs
needed to recover the backup, open database backups are as effective for data
protection as consistent backups.
To back up the database and archived redo logs while the database is open:
1. Start RMAN and connect to a target database.
2. Run the
BACKUP DATABASE
command.
For example, enter the following command at the RMAN prompt to back up the
database and all archived redo log files to the default backup device:
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
See Also: Chapter 5, "Configuring the RMAN Environment," and
Chapter 6, "Configuring the RMAN Environment: Advanced Topics,"
to learn how to configure the RMAN environment
See Also:
■Chapter 8, "RMAN Backup Concepts," to learn concepts relating
to RMAN backups
■Chapter 9, "Backing Up the Database," to learn how to back up
database files with RMAN
■Oracle Database Backup and Recovery Reference for
BACKUP
command
syntax and semantics

Backing Up a Database
Getting Started with RMAN 2-5
Backing Up a Database in NOARCHIVELOG Mode
If a database runs in
NOARCHIVELOG
mode, then the only valid database backup is a
consistent backup. For the backup to be consistent, the database must be mounted
after a consistent shutdown. No recovery is required after restoring the backup.
To make a consistent database backup:
1. Start RMAN and connect to a target database.
2. Shut down the database consistently and then mount it.
For example, enter the following commands to guarantee that the database is in a
consistent state for a backup:
RMAN> SHUTDOWN IMMEDIATE;
RMAN> STARTUP FORCE DBA;
RMAN> SHUTDOWN IMMEDIATE;
RMAN> STARTUP MOUNT;
3. Run the
BACKUP DATABASE
command.
For example, enter the following command at the RMAN prompt to back up the
database to the default backup device:
RMAN> BACKUP DATABASE;
The following variation of the command creates image copy backups of all data
files in the database:
RMAN> BACKUP AS COPY DATABASE;
4. Open the database and resume normal operations.
The following command opens the database:
RMAN> ALTER DATABASE OPEN;
Typical Backup Options
The
BACKUP
command includes a host of options, parameters, and clauses that control
backup output. Table 2–1 lists some typical backup options.
Table 2–1 Common Backup Options
Option Description Example
FORMAT
Specifies a location and name for backup
pieces and copies. You must use substitution
variables to generate unique file names.
The most common substitution variable is
%U
,
which generates a unique name. Others
include
%d
for the DB_NAME,
%t
for the
backup set time stamp,
%s
for the backup set
number, and
%p
for the backup piece number.
BACKUP
FORMAT 'AL_%d/%t/%s/%p'
ARCHIVELOG LIKE '%arc_dest%';
TAG
Specifies a user-defined string as a label for
the backup. If you do not specify a tag, then
RMAN assigns a default tag with the date
and time. Tags are always stored in the
RMAN repository in uppercase.
BACKUP
TAG 'weekly_full_db_bkup'
DATABASE MAXSETSIZE 10M;
See Also: "Specifying Backup Output Options" on page 9-2

Backing Up a Database
2-6 Backup and Recovery User's Guide
Making Incremental Backups
If you specify
BACKUP
INCREMENTAL
, then RMAN creates an incremental backup of a
database. Incremental backups capture block-level changes to a database made after a
previous incremental backup. Incremental backups are generally smaller and faster to
make than full database backups. Recovery with incremental backups is faster than
using redo logs alone.
The starting point for an incremental backup strategy is a level 0 incremental backup,
which backs up all blocks in the database. An incremental backup at level 0 is identical
in content to a full backup, however, unlike a full backup the level 0 backup is
considered a part of the incremental backup strategy.
A level 1 incremental backup contains only blocks changed after a previous
incremental backup. If no level 0 backup exists in either the current or parent database
incarnation when you run a level 1 backup, then RMAN makes a level 0 backup
automatically.
A level 1 backup can be a cumulative incremental backup, which includes all blocks
changed since the most recent level 0 backup, or a differential incremental backup,
which includes only blocks changed since the most recent incremental backup.
Incremental backups are differential by default.
When restoring incremental backups, RMAN uses the level 0 backup as the starting
point, then updates changed blocks based on level 1 backups where possible to avoid
reapplying changes from redo one at a time. Recovering with incremental backups
requires no additional effort on your part. If incremental backups are available, then
RMAN uses them during recovery.
To make incremental backups of the database:
1. Start RMAN and connect to a target database.
2. Run the
BACKUP INCREMENTAL
command.
The following example creates a level 0 incremental backup to serve as a base for
an incremental backup strategy:
BACKUP INCREMENTAL LEVEL 0 DATABASE;
The following example creates a level 1 cumulative incremental backup:
BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;
The following example creates a level 1 differential incremental backup:
BACKUP INCREMENTAL LEVEL 1 DATABASE;
Making Incrementally Updated Backups
The RMAN incrementally updated backup feature is an efficient incremental backup
strategy. The strategy has the following main features:
Note: You cannot make incremental backups when a
NOARCHIVELOG
database is open, although you can make incremental backups when
the database is mounted after a consistent shutdown.
See Also: "Incremental Backups" on page 8-13 for a more detailed
conceptual overview of incremental backups and "Making and
Updating Incremental Backups" on page 9-14

Backing Up a Database
Getting Started with RMAN 2-7
■The strategy requires a level 0 data file copy as a base. This copy has either a
system-defined or user-defined tag.
■Periodically, level 1 differential backups are created with the same tag as the level
0 data file copy. The
BACKUP FOR RECOVER OF COPY
command specifies that an
incremental backup should contain only blocks changed since the most recent
incremental backup with the same tag.
■Periodically, the incremental backups are applied to the level 0 data file copy.
Because the data file copy has been updated with more recent changes, it now
requires less media recovery.
Table 2–2 explains which options to use with
FOR RECOVER OF COPY
to implement an
incrementally updated backup strategy.
To implement an incrementally updated backup strategy:
1. Start RMAN and connect to a target database.
2. Run the
RECOVER COPY
and
BACKUP INCREMENTAL
commands.
The following script, run on a regular basis, is all that is required to implement a
strategy based on incrementally updated backups.
RECOVER COPY OF DATABASE
WITH TAG 'incr_update';
BACKUP
INCREMENTAL LEVEL 1
FOR RECOVER OF COPY WITH TAG 'incr_update'
DATABASE;
Validating Database Files and Backups
You can use the
VALIDATE
command to confirm that all database files exist, are in their
correct location, and are free of physical corruption. The
CHECK LOGICAL
option also
checks for logical block corruption.
Table 2–2 FOR RECOVER OF COPY Options
BACKUP Option Description Example
FOR RECOVER OF COPY
WITH TAG 'tag_name'
Use
TAG
to identify the tag of the data
file copy serving as basis for the
backup strategy. RMAN
automatically assigns the same tag to
every level 1 backup of this copy.
If no level 0 data file copy with the
specified tag exists in either the
current or parent database
incarnation, then RMAN creates a
level 0 data file copy with the
specified tag.
BACKUP
INCREMENTAL LEVEL 1
FOR RECOVER OF COPY
WITH TAG 'incr_update'
DATABASE;
FOR RECOVER OF COPY
DATAFILECOPY FORMAT
'format'
Specifies where RMAN creates the
data file copy if a copy does not exist.
If you add a new data file to the
database, then you do not need to
change your script, because RMAN
automatically creates the level 0 copy
required by the incremental backup
routine.
BACKUP
INCREMENTAL LEVEL 1
FOR RECOVER OF COPY
DATAFILECOPY FORMAT
'/disk2/df1.cpy'
DATABASE;
See Also: "Incrementally Updating Backups" on page 9-16

Backing Up a Database
2-8 Backup and Recovery User's Guide
To validate database files:
1. Start RMAN and connect to a target database.
2. Run the
BACKUP VALIDATE ...
command for the desired files.
For example, enter the following commands to validate all database files and
archived redo log files for physical and logical corruption:
BACKUP VALIDATE CHECK LOGICAL
DATABASE ARCHIVELOG ALL;
You can also use the
VALIDATE
command to check individual data blocks, as
shown in the following example:
VALIDATE DATAFILE 4 BLOCK 10 TO 13;
You can also validate backup sets, as shown in the following example:
VALIDATE BACKUPSET 3;
You specify backup sets by primary key, which is shown in the output of the
LIST
BACKUP
command.
Scripting RMAN Operations
RMAN supports the use of command files to manage recurring tasks such as weekly
backups. A command file is a client-side text file containing RMAN commands,
exactly as you enter them at the RMAN prompt. You can use any file extension. The
RUN
command provides a degree of flow-of-control in your scripts.
To create and run a command file:
1. Use a text editor to create a command file.
For example, create a command file with the following contents:
# my_command_file.txt
CONNECT TARGET /
BACKUP DATABASE PLUS ARCHIVELOG;
LIST BACKUP;
EXIT;
2. Start RMAN and then execute the contents of a command file by running the
@
command at the RMAN prompt:
% rman
RMAN> @/my_dir/my_command_file.txt # runs specified command file
You can also launch RMAN with a command file to run, as shown here:
% rman @/my_dir/my_command_file.txt
See Also:
■Chapter 16, "Validating Database Files and Backups"
■Oracle Database Backup and Recovery Reference for
VALIDATE
command syntax and semantics

Reporting on RMAN Operations
Getting Started with RMAN 2-9
Reporting on RMAN Operations
The RMAN
LIST
and
REPORT
commands generate reports on backup activities based
on the RMAN repository. Use the
SHOW ALL
command to display the current RMAN
configuration.
Listing Backups
Run the
LIST
BACKUP
and
LIST
COPY
commands to display information about backups
and data file copies listed in the repository. For backups, you can control the format of
LIST
output with the options in Table 2–3 and Table 2–4.
For both backups and copies you have additional options shown in Table 2–4.
To list backups and copies:
1. Start RMAN and connect to a target database.
2. Run the
LIST
command at the RMAN prompt.
You can display specific objects, as in the following examples:
LIST BACKUP OF DATABASE;
LIST COPY OF DATAFILE 1, 2;
LIST BACKUP OF ARCHIVELOG FROM SEQUENCE 10;
LIST BACKUPSET OF DATAFILE 1;
See Also: "Using Command Files with RMAN" on page 4-3 to learn
more about command files, and "Using Substitution Variables in
Command Files" on page 4-4 to learn how to use substitution
variables in command files and pass parameters at run time
Table 2–3 LIST Options for Backups
Option Example Explanation
BY
BACKUP LIST
BACKUP
OF
DATABASE
BY
BACKUP
Organizes the output by backup set. This is the
default mode of presentation.
BY
FILE LIST
BACKUP
BY
FILE
Lists the backups according to which file was
backed up.
SUMMARY LIST
BACKUP
SUMMARY
Displays summary output.
Table 2–4 Additional LIST Options
Option Example Explanation
EXPIRED LIST
EXPIRED
COPY
Lists backups that are recorded in the RMAN repository
but that were not present at the expected location on disk
or tape during the last
CROSSCHECK
command. An expired
backup may have been deleted by an operating system
utility.
RECOVERABLE LIST
BACKUP
RECOVERABLE
Lists data file backups or copies that have status
AVAILABLE
in the RMAN repository and that can be restored and
recovered.

Maintaining RMAN Backups
2-10 Backup and Recovery User's Guide
Reporting on Database Files and Backups
The
REPORT
command performs more complex analysis than
LIST
. Some main options
are shown in Table 2–5.
To generate reports of database files and backups:
1. Start RMAN and connect to a target database.
2. Run the
REPORT
command at the RMAN prompt.
The following example reports backups that are obsolete according to the
currently configured backup retention policy:
REPORT OBSOLETE;
The following example reports the data files and temp files in the database:
REPORT SCHEMA;
Maintaining RMAN Backups
RMAN repository metadata is always stored in the control file of the target database.
The RMAN maintenance commands use this metadata when managing backups.
Cross-checking Backups
The
CROSSCHECK
command synchronizes the logical records of RMAN backups and
copies with the files on storage media. If a backup is on disk, then
CROSSCHECK
See Also:
■"Listing Backups and Recovery-Related Objects" on page 11-3 to
learn more about the
LIST
command
■Oracle Database Backup and Recovery Reference for
LIST
command
syntax
Table 2–5 REPORT Options
Option Example Explanation
NEED
BACKUP REPORT
NEED
BACKUP DATABASE
Shows which files need backing up under current
retention policy. Use optional
REDUNDANCY
and
RECOVERY
WINDOW
parameters to specify different
criteria.
OBSOLETE REPORT
OBSOLETE
Lists backups that are obsolete under the configured
backup retention policy. Use the optional
REDUNDANCY
and
RECOVERY
WINDOW
parameters to
override the default.
SCHEMA REPORT
SCHEMA
Reports the tablespaces and data files in the
database at the current time (default) or a different
time.
UNRECOVERABLE REPORT
UNRECOVERABLE
Lists all data files for which an unrecoverable
operation has been performed against an object in
the data file since the last backup of the data file.
See Also: "Reporting on Backups and Database Schema" on
page 11-9 to learn how to use the
REPORT
command for RMAN
reporting

Diagnosing and Repairing Failures with Data Recovery Advisor
Getting Started with RMAN 2-11
determines whether the header of the file is valid. If a backup is on tape, then RMAN
queries the RMAN repository for the names and locations of the backup pieces. It is a
good idea to crosscheck backups and copies before deleting them.
To crosscheck all backups and copies on disk:
1. Start RMAN and connect to a target database.
2. Run the
CROSSCHECK
command, as shown in the following example:
CROSSCHECK BACKUP;
CROSSCHECK COPY;
Deleting Obsolete Backups
The
DELETE
command removes RMAN backups and copies from disk and tape,
updates the status of the files to
DELETED
in the control file repository, and removes the
records from the recovery catalog (if you use a catalog). If you run RMAN
interactively, and if you do not specify the
NOPROMPT
option, then
DELETE
displays a list
of files and prompts for confirmation before deleting any file in the list.
The
DELETE OBSOLETE
command is particular useful because RMAN deletes backups
and data file copies recorded in the RMAN repository that are obsolete, that is, no
longer needed. You can use options on the
DELETE
command to specify what is
obsolete or use the configured backup retention policy.
To delete obsolete backups and copies:
1. Start RMAN and connect to a target database.
2. Run the
DELETE OBSOLETE
command, as shown in the following example:
DELETE OBSOLETE;
Diagnosing and Repairing Failures with Data Recovery Advisor
The simplest way to diagnose and repair database problems is to use the Data
Recovery Advisor. This Oracle Database tool provides an infrastructure for
diagnosing persistent data failures, presenting repair options to the user, and
automatically executing repairs.
Listing Failures and Determining Repair Options
A failure is a persistent data corruption detected by the Health Monitor. Examples
include physical and logical data block corruptions and missing data files. Each failure
has a failure priority and failure status. The priority can be
CRITICAL
,
HIGH
, or
LOW
.
The status can be
OPEN
or
CLOSED
.
You can run the
LIST
FAILURE
command to show all known failures. If failures exist,
then run the
ADVISE FAILURE
command in the same session to determine manual and
See Also: "Crosschecking the RMAN Repository" on page 12-10 to
learn how to crosscheck RMAN backups
See Also: "Deleting RMAN Backups and Archived Redo Logs" on
page 12-17 to learn how to use the
DELETE
command
See Also: "Overview of Data Recovery Advisor" on page 15-1

Diagnosing and Repairing Failures with Data Recovery Advisor
2-12 Backup and Recovery User's Guide
automated repair options. The following example illustrates these two commands
(sample output included).
Example 2–1 LIST FAILURE and ADVISE FAILURE
RMAN> LIST FAILURE;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
142 HIGH OPEN 23-APR-07 One or more non-system datafiles are missing
101 HIGH OPEN 23-APR-07 Datafile 1: '/disk1/oradata/prod/system01.dbf'
contains one or more corrupt blocks
RMAN> ADVISE FAILURE;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
142 HIGH OPEN 23-APR-07 One or more non-system datafiles are missing
101 HIGH OPEN 23-APR-07 Datafile 1: '/disk1/oradata/prod/system01.dbf'
contains one or more corrupt blocks
analyzing automatic repair options; this may take some time
using channel ORA_DISK_1
analyzing automatic repair options complete
Mandatory Manual Actions
========================
no manual actions available
Optional Manual Actions
=======================
1. If file /disk1/oradata/prod/users01.dbf was unintentionally renamed or moved, restore it
Automated Repair Options
========================
Option Repair Description
------ ------------------
1 Restore and recover datafile 28; Perform block media recovery of
block 56416 in file 1
Strategy: The repair includes complete media recovery with no data loss
Repair script: /disk1/oracle/log/diag/rdbms/prod/prod/hm/reco_660500184.hm
The
ADVISE FAILURE
output shows both manual and automated repair options. First
try to fix the problem manually. If you cannot fix the problem manually, then review
the automated repair section.
An automated repair option describes a server-managed repair for one or more
failures. Repairs are consolidated when possible so that a single repair can fix multiple
failures. The repair option indicates which repair is performed and whether data is lost
by performing the repair operation.
In Example 2–1, the output indicates the file name of a repair script containing RMAN
commands. If you do not want to use Data Recovery Advisor to repair the failure
automatically, then you can use the script as the basis of your own recovery strategy.
See Also: "Listing Failures" on page 15-6 and "Determining Repair
Options" on page 15-10

Rewinding a Database with Flashback Database
Getting Started with RMAN 2-13
Repairing Failures
After running
LIST FAILURE
and
ADVISE FAILURE
in an RMAN session, you can run
REPAIR FAILURE
to execute a repair option. If you execute
REPAIR FAILURE
with no
other command options, then RMAN uses the first repair option of the most recent
ADVISE FAILURE
command in the current session. Alternatively, specify the repair
option number obtained from the most recent
ADVISE FAILURE
command.
Example 2–2 illustrates how to repair the failures identified in Example 2–1.
Example 2–2 REPAIR FAILURE
RMAN> REPAIR FAILURE;
By default,
REPAIR FAILURE
prompts for confirmation before it begins executing. After
executing a repair, Data Recovery Advisor reevaluates all existing failures on the
possibility that they may also have been fixed. Data Recovery Advisor always verifies
that failures are still relevant and automatically closes fixed failures. If a repair fails to
complete because of an error, then the error triggers a new assessment and
re-evaluation of existing failures and repairs.
Rewinding a Database with Flashback Database
You can use the Oracle Flashback Database to rewind the whole database to a past
time. Unlike media recovery, you do not need to restore data files to return the
database to a past state.
To use the RMAN
FLASHBACK DATABASE
command, your database must have been
previously configured to generate flashback logs. This configuration task is described
in "Flashback Database" on page 7-2. Flashback Database works by rewinding changes
to the data files that exist at the moment that you run the command. You cannot use
the command to repair media failures or missing data files.
The database must be mounted when you issue
FLASHBACK DATABASE
. If you have
previously created a restore point, then you can flash back to this restore point if it
falls within the flashback database window.
To rewind a database with Flashback Database:
1. Start RMAN and connect to a target database.
2. Ensure that the database is in a mounted state.
The following commands shut down and then mount the database:
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
3. Run the
FLASHBACK DATABASE
command.
The following examples illustrate different forms of the command:
FLASHBACK DATABASE TO SCN 861150;
FLASHBACK DATABASE
TO RESTORE POINT BEFORE_CHANGES;
FLASHBACK DATABASE
TO TIMESTAMP TO_DATE(04-DEC-2009 03:30:00','DD-MON-YYYY HH24:MI:SS');
See Also: "Repairing Failures" on page 15-12

Restoring and Recovering Database Files
2-14 Backup and Recovery User's Guide
4. After performing the Flashback Database, open the database read-only in
SQL*Plus and run some queries to verify the database contents.
Open the database read-only as follows:
SQL "ALTER DATABASE OPEN READ ONLY";
5. If satisfied with the results, then issue the following sequence of commands to
shut down and then open the database:
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE OPEN RESETLOGS;
Restoring and Recovering Database Files
Use the
RESTORE
and
RECOVER
commands for RMAN restore and recovery of physical
database files. Restoring data files is retrieving them from backups as needed for a
recovery operation. Media recovery is the application of changes from redo logs and
incremental backups to a restored data file to bring the data file forward to a desired
SCN or point in time.
Preparing to Restore and Recover Database Files
If you must recover the database because a media failure damages database files, then
you should first ensure that you have the necessary backups. You can use the
RESTORE
... PREVIEW
command to report, but not restore, the backups that RMAN could use to
restore to the specified time. RMAN queries the metadata and does not actually read
the backup files. The database can be open when you run this command.
To preview a database restore and recovery:
1. Start RMAN and connect to the target database.
2. Optionally, list the current tablespaces and data files, as shown in the following
command:
RMAN> REPORT SCHEMA;
3. Run the
RESTORE DATABASE
command with the
PREVIEW
option.
The following command specifies
SUMMARY
so that the backup metadata is not
displayed in verbose mode (sample output included):
RMAN> RESTORE DATABASE PREVIEW SUMMARY;
Starting restore at 21-MAY-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=80 device type=DISK
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
11 B F A DISK 18-MAY-07 1 2 NO
TAG20070518T181114
See Also: "Rewinding a Database with Flashback Database" on
page 18-11
See Also: Chapter 17, "Performing Complete Database Recovery"

Restoring and Recovering Database Files
Getting Started with RMAN 2-15
13 B F A DISK 18-MAY-07 1 2 NO
TAG20070518T181114
using channel ORA_DISK_1
List of Archived Log Copies for database with db_unique_name PROD
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
47 1 18 A 18-MAY-07
Name: /disk1/oracle/dbs/db1r_60ffa882_1_18_0622902157.arc
Media recovery start SCN is 586534
Recovery must be done beyond SCN 587194 to clear datafile fuzziness
validation succeeded for backup piece
Finished restore at 21-MAY-07
Recovering the Whole Database
Use the
RESTORE
DATABASE
and
RECOVER
DATABASE
commands to recover the whole
database. You must have previously made backups of all needed files. This scenario
assumes that you can restore all data files to their original locations. If the original
locations are inaccessible, then use the
SET NEWNAME
command as described in
"Restoring Datafiles to a Nondefault Location" on page 17-10.
To recover the whole database:
1. Prepare for recovery as explained in "Preparing to Restore and Recover Database
Files" on page 2-14.
2. Place the database in a mounted state.
The following example terminates the database instance (if it is started) and
mounts the database:
RMAN> STARTUP FORCE MOUNT;
3. Restore the database.
The following example uses the preconfigured disk channel to restore the
database:
RMAN> RESTORE DATABASE;
4. Recover the database, as shown in the following example:
RMAN> RECOVER DATABASE;
5. Open the database, as shown in the following example:
RMAN> ALTER DATABASE OPEN;
Recovering Tablespaces
Use the
RESTORE
TABLESPACE
and
RECOVER
TABLESPACE
commands on individual
tablespaces when the database is open. In this case, you must take the tablespace that
needs recovery offline, restore and then recover the tablespace, and bring the
recovered tablespace online.
If you need to restore a data file to a new location, then use the RMAN
SET NEWNAME
command within a
RUN
command to specify the new file name. Afterward, use a
SWITCH DATAFILE ALL
command, which is equivalent to using the SQL statement

Restoring and Recovering Database Files
2-16 Backup and Recovery User's Guide
ALTER DATABASE RENAME FILE
, to update the control file to reflect the new names for
all data files for which a
SET NEWNAME
has been issued in the
RUN
command.
Unlike in user-managed media recovery, you should not place an online tablespace in
backup mode. Unlike user-managed tools, RMAN does not require extra logging or
backup mode because it knows the format of data blocks.
To recover an individual tablespace when the database is open:
1. Prepare for recovery as explained in "Preparing to Restore and Recover Database
Files" on page 2-14.
2. Take the tablespace to be recovered offline:
The following example takes the
USERS
tablespace offline:
RMAN> SQL 'ALTER TABLESPACE users OFFLINE';
3. Restore and recover the tablespace.
The following
RUN
command, which you execute at the RMAN prompt, sets a new
name for the data file in the
USERS
tablespace:
RUN
{
SET NEWNAME FOR DATAFILE '/disk1/oradata/prod/users01.dbf'
TO '/disk2/users01.dbf';
RESTORE TABLESPACE users;
SWITCH DATAFILE ALL; # update control file with new file names
RECOVER TABLESPACE users;
}
4. Bring the tablespace online, as shown in the following example:
RMAN> SQL 'ALTER TABLESPACE users ONLINE';
You can also use
RESTORE DATAFILE
and
RECOVER DATAFILE
for recovery at the data file
level.
Recovering Individual Data Blocks
RMAN can recover individual corrupted data file blocks. When RMAN performs a
complete scan of a file for a backup, any corrupted blocks are listed in
V$DATABASE_
BLOCK_CORRUPTION
. Corruption is usually reported in alert logs, trace files, or results of
SQL queries.
To recover data blocks:
1. Obtain the block numbers of the corrupted blocks if you do not have this
information.
The easiest way to locate trace files and the alert log is to connect SQL*Plus to the
target database and execute the following query:
SQL> SELECT NAME, VALUE
2 FROM V$DIAG_INFO;
2. Start RMAN and connect to the target database.
See Also:
■"Performing Complete Recovery of a Tablespace" on page 17-13
■"Online Backups and Backup Mode" on page 8-2

Restoring and Recovering Database Files
Getting Started with RMAN 2-17
3. Run the
RECOVER
command to repair the blocks.
The following RMAN command recovers all corrupted blocks:
RMAN> RECOVER CORRUPTION LIST;
You can also recover individual blocks, as shown in the following example:
RMAN> RECOVER DATAFILE 1 BLOCK 233, 235 DATAFILE 2 BLOCK 100 TO 200;
See Also: Chapter 19, "Performing Block Media Recovery"

Restoring and Recovering Database Files
2-18 Backup and Recovery User's Guide

Part II
Par t II
Starting and Configuring RMAN and
Flashback Database
The chapters in this part explain the basic components of the RMAN environment and
how to configure it. This part contains the following chapters:
■Chapter 3, "Recovery Manager Architecture"
■Chapter 4, "Starting and Interacting with the RMAN Client"
■Chapter 5, "Configuring the RMAN Environment"
■Chapter 6, "Configuring the RMAN Environment: Advanced Topics"
■Chapter 7, "Using Flashback Database and Restore Points"

3
Recovery Manager Architecture 3-1
3
Recovery Manager Architecture
This chapter describes the Recovery Manager (RMAN) interface and the basic
components of the RMAN environment. This chapter contains the following topics:
■About the RMAN Environment
■RMAN Command-Line Client
■RMAN Channels
■RMAN Repository
■Media Management
■Fast Recovery Area
■RMAN in a Data Guard Environment
About the RMAN Environment
The Recovery Manager environment consists of the various applications and databases
that play a role in a backup and recovery strategy.
Table 3–1 lists some components in a typical RMAN environment.
Table 3–1 Components of the RMAN Environment
Component Description
RMAN client The client application that manages backup and recovery operations for a target
database. The RMAN client can use Oracle Net to connect to a target database, so it
can be located on any host that is connected to the target host through Oracle Net.
target database A database containing the control files, datafiles, and optional archived redo logs
that RMAN backs up or restores. RMAN uses the target database control file to
gather metadata about the target database and to store information about its own
operations. The work of backup and recovery is performed by server sessions
running on the target database.
recovery catalog database A database containing a recovery catalog, which contains metadata that RMAN
uses to perform backup and recovery. You can create one recovery catalog that
contains the RMAN metadata for multiple target databases. Unless you are using
RMAN with a physical standby database, a recovery catalog is optional when
using RMAN because RMAN stores its metadata in the control file of each target
database.
recovery catalog schema The user within the recovery catalog database that owns the metadata tables
maintained by RMAN. RMAN periodically propagates metadata from the target
database control file into the recovery catalog.

About the RMAN Environment
3-2 Backup and Recovery User's Guide
The only required components in an RMAN environment are a target database and
RMAN client, but most real-world configurations are more complicated. For example,
you use an RMAN client connecting to multiple media managers and multiple target
databases and auxiliary databases, all accessed through Enterprise Manager.
Figure 3–1 illustrates components in a possible RMAN environment. The figure shows
that the primary database, standby database, and recovery catalog databases all reside
on different computers. The primary and standby database hosts use a locally attached
tape drive. The RMAN client and Enterprise Manager console run on a separate
computer.
physical standby database A copy of the primary database that is updated with archived redo logs generated
by the primary database. A physical standby database has the same
DBID
and
DB_
NAME
values as the primary database, but a different
DB_UNIQUE_NAME
. You can fail
over to the standby database if the primary database becomes inaccessible.
RMAN can create, back up, or recover a standby database. Backups that you make
at a standby database are usable at primary database or another standby database
for same production database. The recovery catalog is required when you use
RMAN in the Data Guard environment.
Note: A logical standby database is treated as a separate database by RMAN
because it has a different DBID from its primary database.
See Also: Oracle Data Guard Concepts and Administration to learn how to use RMAN
in a Data Guard environment
duplicate database A copy of the primary database that you can use for testing purposes. The DBID is
different from the database from which it was created.
fast recovery area A disk location that you can use to store recovery-related files such as control file
and online redo log copies, archived redo logs, flashback logs, and RMAN
backups. Oracle Database and RMAN manage the files in the fast recovery area
automatically.
media manager A vendor-specific application that enables RMAN to back up to a storage system
such as tape
media management catalog A vendor-specific repository of metadata about a media management application
Oracle Enterprise Manager A browser-based interface to the database, including backup and recovery through
RMAN
Table 3–1 (Cont.) Components of the RMAN Environment
Component Description

RMAN Channels
Recovery Manager Architecture 3-3
Figure 3–1 Sample RMAN Environment
RMAN Command-Line Client
Use the RMAN command-line client to enter commands that you can use to manage
all aspects of backup and recovery operations. RMAN uses a command language
interpreter that can execute commands in interactive or batch mode. Even when you
use the backup and recovery features in Enterprise Manager that are built on top of
RMAN, an RMAN client executes behind the scenes.
RMAN Channels
The RMAN client directs database server sessions to perform all backup and recovery
tasks. What constitutes a session depends on the operating system. For example, on
Linux, a server session corresponds to a server process, whereas on Windows it
corresponds to a thread within the database service.
The RMAN client itself does not perform backup, restore, or recovery operations.
When you connect the RMAN client to a target database, RMAN allocates server
sessions on the target instance and directs them to perform the operations.
An RMAN channel represents one stream of data to a device, and corresponds to one
database server session. The channel reads data into PGA memory, processes it, and
See Also: Oracle Database Net Services Administrator's Guide to learn
about Oracle Net

RMAN Channels
3-4 Backup and Recovery User's Guide
writes it to the output device. See "Basic Concepts of RMAN Performance Tuning" on
page 22-1 for a low-level description of how channels work.
Most RMAN commands are executed by channels, which must be either configured to
persist across RMAN sessions, or manually allocated in each RMAN session. As
illustrated in Figure 3–2, a channel establishes a connection from the RMAN client to a
target or auxiliary database instance by starting a server session on the instance.
Figure 3–2 Channel Allocation
Channels and Devices
The RMAN-supported device types are disk and SBT (system backup to tape). An SBT
device is controlled by a third-party media manager. Typically, SBT devices are tape
libraries and tape drives.
If you use a disk channel for a backup, then the channel creates the backup on disk in
the file name space of the target database instance creating the backup. You can make a
backup on any device that can store a data file. RMAN does not call a media manager
when making disk backups.
To create backups on nondisk media, you must use media management software such
as Oracle Secure Backup and allocate channels supported by this software. RMAN
contacts the media manager whenever the channel type allocated is not disk. How and
when the SBT channels cause the media manager to allocate resources is
vendor-specific. Some media managers allocate resources when you issue the
command; others do not allocate resources until you open a file for reading or writing.
Automatic and Manual Channels
You can use the
CONFIGURE CHANNEL
command to configure channels for use with disk
or tape across RMAN sessions. This technique is known as automatic channel
allocation. RMAN comes preconfigured with one
DISK
channel that you can use for
backups to disk.
When you run a command that can use automatic channels, RMAN automatically
allocates the channels with the options that you specified in the
CONFIGURE
command.
For the
BACKUP
command, RMAN allocates only the type of channel required to back
up to the specified media. For the
RESTORE
command and RMAN maintenance
See Also: "Configuring the Default Device for Backups: Disk or SBT"
on page 5-3
Recovery Manager
channel ch1
Oracle
Recovery
Catalog
Target
database
Disk
Server
session

RMAN Repository
Recovery Manager Architecture 3-5
commands, RMAN allocates all necessary channels for the device types required to
execute the command. RMAN determines the names for automatic channels.
You can also manually allocate channels. Each manually allocated channel uses a
separate connection to the database. When you manually allocate a channel, you give
it a user-defined name such as
dev1
or
ch2
.
The number of channels available for use with a device when you run a command
determines whether RMAN reads from or write to this device in parallel while
performing the command. When the work is done in parallel, the backup of the files is
done by multiple channels. Each channel may back up multiple files, but unless a
multisection backup is performed, no file is backed up by more than one channel.
RMAN Repository
The RMAN repository is the collection of metadata about the target databases that
RMAN uses for backup, recovery, and maintenance. RMAN always stores its metadata
in the control file. The version of this metadata in the control file is the authoritative
record of RMAN backups of your database. This is one reason why protecting your
control file is an important part of your backup strategy. RMAN can conduct all
necessary backup and recovery operations using just the control file to store the
RMAN repository information, and maintains all records necessary to meet your
configured retention policy.
You can also create a recovery catalog, which is a repository of RMAN metadata
stored in an Oracle database schema. The control file has finite space for records of
backup activities, whereas a recovery catalog can store a much longer history. You can
simplify backup and recovery administration by creating a single recovery catalog that
contains the RMAN metadata for all of your databases.
The owner of a recovery catalog can grant or revoke restricted access to the catalog to
other database users. Each restricted user has full read/write access to his own
metadata, which is called a virtual private catalog. When one or more virtual private
catalogs exist in a database, the database contains just one set of catalog tables. These
tables are owned by the base recovery catalog owner. The owner of the base recovery
catalog controls which databases each virtual private catalog user can access.
Some RMAN features only function when you use a recovery catalog. For example,
you can create a stored script in the recovery catalog and use this script to execute
RMAN jobs. Other RMAN commands are specifically related to managing the
recovery catalog and so are not available (and not needed) if RMAN is not connected
to a recovery catalog.
The recovery catalog is maintained solely by RMAN. A target database instance never
accesses the catalog directly. RMAN propagates information about the database
structure, archived redo logs, backup sets, and data file copies into the recovery
catalog from the target database control file after any operation that updates the
repository, and also before certain operations.
See Also:
■Oracle Database Backup and Recovery Reference for
ALLOCATE
CHANNEL
syntax
■Oracle Database Backup and Recovery Reference on
ALLOCATE
CHANNEL
FOR
MAINTENANCE
■"Configuring Channels for Disk" on page 5-5 and "Configuring
SBT Channels for Use with a Media Manager" on page 5-13

Media Management
3-6 Backup and Recovery User's Guide
Media Management
The Oracle Media Management Layer (MML) API lets third-party vendors build a
media manager, software that works with RMAN and the vendor's hardware to allow
backups to sequential media devices such as tape drives. A media manager handles
loading, unloading, and labeling of sequential media such as tapes. You must install
media manager software to use RMAN with sequential media devices.
When backing up or restoring, the RMAN client connects to a target database instance
and directs the instance to send requests to its media manager. No direct
communication occurs between the RMAN client and the media manager.
RMAN Interaction with a Media Manager
Before performing backup or restore to a media manager, you must allocate one or
more channels to handle the communication with the media manager. You can also
configure default channels for the media manager. The default channels are used for
all backup and recovery tasks that employ the media manager and for which you have
not explicitly allocated channels.
RMAN does not issue specific commands to load, label, or unload tapes. When
backing up, RMAN gives the media manager a stream of bytes and associates a unique
name with this stream. When RMAN must restore the backup, it asks the media
manager to retrieve the byte stream. All details of how and where that stream is stored
are handled entirely by the media manager. For example, the media manager labels
and keeps track of the tape and names of files on each tape, and automatically loads
and unloads tapes, or signals an operator to do so.
Some media managers support proxy copy functionality, in which they handle the
entire data movement between data files and the backup devices. These products may
use technologies such as high-speed connections between storage and media
subsystems to reduce the load on the primary database server. RMAN provides a list
of files requiring backup or restore to the media manager, which in turn makes all
decisions regarding how and when to move the data.
Oracle Secure Backup
Oracle Secure Backup is a media manager that provides reliable and secure data
protection through file system backup to tape. All major tape drives and tape libraries
in SAN, Gigabit Ethernet, and SCSI environments are supported.
Although Oracle Secure Backup has no specialized knowledge of database backup and
recovery algorithms, it can serve as a media management layer for RMAN through the
SBT interface. In this capacity, Oracle Secure Backup provides the same services for
RMAN as other supported third-party SBT libraries. Oracle Secure Backup has some
features, however, that are not available in other media managers.
See Also: Chapter 12, "Maintaining RMAN Backups and
Repository Records" and Chapter 13, "Managing a Recovery
Catalog"
See Also: "Configuring SBT Channels for Use with a Media
Manager" on page 5-13
See Also: Oracle Secure Backup Administrator's Guide to learn how to
use Oracle Secure Backup

RMAN in a Data Guard Environment
Recovery Manager Architecture 3-7
Backup Solutions Program
The Oracle Backup Solutions Program (BSP), part of the Oracle PartnerNetwork, is a
group of media manager vendors whose products are compliant with Oracle's MML
specification. Several products may be available for your platform from media
management vendors. For more information, contact your Oracle representative for a
list of available products, contact individual vendors to ask them if they participate, or
access the Backup Solutions Program website at:
http://www.oracle.com/technetwork/database/features/availability/bsp-08881
4.html
Oracle does not certify media manager vendors for compatibility with RMAN.
Questions about availability, version compatibility, and functionality can only be
answered by the media manager vendor, not Oracle.
Fast Recovery Area
The components that create different backup and recovery-related files have no
knowledge of each other or of the size of the file systems where they store their data.
With automatic disk-based backup and recovery, you can create a fast recovery area
(also called the recovery area), which automates management of backup-related files.
A fast recovery area minimizes the need to manually manage disk space for
backup-related files and balance the use of space among the different types of files. In
this way, a fast recovery area simplifies the ongoing administration of your database.
Oracle recommends that you enable a recovery area to simplify backup management.
When you create a recovery area, you choose a location on disk and set an upper
bound for storage space. You also set a backup retention policy that governs how long
backup files are needed for recovery. The database manages the storage used for
backups, archived redo logs, and other recovery-related files for the database within
this space. Files no longer needed are eligible for deletion when RMAN must reclaim
space for new files.
RMAN in a Data Guard Environment
When using RMAN in a Data Guard environment, a recovery catalog is required. The
recovery catalog can store the metadata for all primary and standby databases.
A database in a Data Guard environment is uniquely identified by the
DB_UNIQUE_NAME
parameter in the initialization parameter file. For RMAN to work correctly in a Data
Guard environment, the
DB_UNIQUE_NAME
must be unique across all the databases with
the same DBID.
RMAN Configuration in a Data Guard Environment
To simplify ongoing use of RMAN for backup and recovery, you can set some
persistent configuration settings for each primary and physical standby database in a
Data Guard environment. These settings control many aspects of RMAN behavior. For
example, you can configure the backup retention policy, default destinations for
backups to tape or disk, default backup device type, and so on.
See Also: "Configuring the Fast Recovery Area" on page 5-14 to
learn about the fast recovery area and how to configure it
See Also: Oracle Data Guard Concepts and Administration to learn how
to use RMAN in a Data Guard environment

RMAN in a Data Guard Environment
3-8 Backup and Recovery User's Guide
You can use the
CONFIGURE
command with the
FOR DB_UNIQUE_NAME
clause to create a
persistent configuration for a database in a Data Guard environment without
connecting to the standby database or primary database as
TARGET
. For example, you
connect RMAN to the recovery catalog, run the
SET DBID
command, and then can
create a configuration for a physical standby database before its creation so that the
RMAN configuration applies when the database is created.
RMAN updates the control file of the database when connected to it as
TARGET
during
a recovery catalog resynchronization. If you use
FOR DB_UNIQUE_NAME
for a database
without being connected as
TARGET
to this database, however, then RMAN changes
configurations in the recovery catalog only.
RMAN File Management in a Data Guard Environment
RMAN uses a recovery catalog to track file names for all database files in a Data Guard
environment. The catalog also records where the online redo log files, standby redo log
files, temp files, archived redo log files, backup sets, and image copies are created.
Interchangeability of Backups in a Data Guard Environment
RMAN commands use the recovery catalog metadata to function transparently across
different physical databases in the Data Guard environment. For example, you can
back up a tablespace on a physical standby database and restore and recover it on the
primary database. Similarly, you can back up a tablespace on a primary database and
restore and recover it on a physical standby database.
Backups of standby control files and nonstandby control files are interchangeable. For
example, you can restore a standby control file on a primary database and a primary
control file on a physical standby database. This interchangeability means that you can
offload control file backups to one database in a Data Guard environment. RMAN
automatically updates the file names for database files during restore and recovery at
the databases.
Association of Backups in a Data Guard Environment
The recovery catalog tracks the files in the Data Guard environment by associating
every database file or backup file with a
DB_UNIQUE_NAME
. The database that creates a
file is associated with the file. For example, if RMAN backs up the database with the
unique name of
standby1
, then
standby1
is associated with this backup. A backup
remains associated with the database that created it unless you use the
CHANGE
...RESET DB_UNIQUE_NAME
command to associate the backup with a different
database.
Accessibility of Backups in a Data Guard Environment
The accessibility of a backup is different from its association. In a Data Guard
environment, the recovery catalog considers disk backups as accessible only to the
database with which they are associated, whereas tape backups created on one
database are accessible to all databases. If a backup file is not associated with any
database, then the row describing it in the recovery catalog view shows
null
for the
See Also: "Configuring RMAN in a Data Guard Environment" on
page 5-29
Note: Backups of logical standby databases are not usable at the
primary database.

RMAN in a Data Guard Environment
Recovery Manager Architecture 3-9
SITE_KEY
column. By default, RMAN associates a file whose
SITE_KEY
is
null
with the
database to which they are connected as
TARGET
.
RMAN commands such as
BACKUP
,
RESTORE
, and
CROSSCHECK
work on any accessible
backup. For example, for a
RECOVER COPY
operation, RMAN considers only image
copies that are associated with the database as eligible to be recovered. RMAN
considers the incremental backups on disk and tape as eligible to recover the image
copies. In a database recovery, RMAN considers only the disk backups associated with
the database and all files on tape as eligible to be restored.
To illustrate the differences in backup accessibility, assume that databases
PROD
and
STANDBY1
reside on different hosts. RMAN backs up data file
1
on
PROD
to
/prmhost/disk1/df1.dbf
on the production host and also to tape. RMAN backs up
data file
1
on
STANDBY1
to
/sbyhost/disk2/df1.dbf
on the standby host and also to
tape. If RMAN is connected to database
prod
, then you cannot use RMAN commands
to perform operations with the
/sbyhost/disk2/df1.dbf
backup located on the
standby host. However, RMAN does consider the tape backup made on
STANDBY1
as
eligible to be restored.
Note: You can transfer a backup from a standby host to a primary
host or vice versa, connect as
TARGET
to the database on this host, and
then use the
CATALOG
command to catalog the backup. After a file is
cataloged by the target database, the file is associated with the target
database.
See Also:
■Oracle Data Guard Concepts and Administration to learn how to
perform RMAN backup and recovery in a Data Guard
environment
■"Maintenance Commands in a Data Guard Environment" on
page 12-2
■Chapter 13, "Managing a Recovery Catalog" to learn how to
manage a recovery catalog in a Data Guard environment
■Oracle Database Backup and Recovery Reference for
CONFIGURE
syntax

RMAN in a Data Guard Environment
3-10 Backup and Recovery User's Guide

4
Starting and Interacting with the RMAN Client 4-1
4
Starting and Interacting with the RMAN Client
This chapter explains how to start the RMAN command-line interface and make
database connections. This chapter contains the following topics:
■Starting and Exiting RMAN
■Specifying the Location of RMAN Output
■