Oracle Database Backup And Recovery User’s Guide User S

User Manual: user guide pdf -FilePursuit

Open the PDF directly: View PDF PDF.
Page Count: 598 [warning: Documents this large are best viewed by clicking the View PDF Link!]

Oracle® Database
Backup and Recovery User's Guide
11g Release 1 (11.1)
B28270-03
August 2008
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 1 (11.1)
B28270-03
Copyright © 2003, 2008, Oracle. All rights reserved.
Primary Author: Lance Ashdown
Contributing Author: Antonio Romero, Katherine Weill
Contributors: Tammy Bednar, Anand Beldalker, Timothy Chien, Mark Dilman, Senad Dizdar, Raymond
Guzman, Stephan Haisley, Wei Hu, Alex Hwang, Ashok Joshi, Vasudha Krishnaswamy, J. William Lee,
Valarie Moore, Muthu Olagappan, Vsevolod Panteleenko, Cris Pedregal-Martin, Samitha Samaranayake,
Francisco Sanchez, Vivian Schupmann, Vinay Srihari, Margaret Susairaj, Mike Stewart, Steven Wertheimer,
Wanli Yang, Rob Zijlstra
The Programs (which include both the software and documentation) contain proprietary information; they
are provided under a license agreement containing restrictions on use and disclosure and are also protected
by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly,
or decompilation of the Programs, except to the extent required to obtain interoperability with other
independently created software or as specified by law, is prohibited.
The information contained in this document is subject to change without notice. If you find any problems in
the documentation, please report them to us in writing. This document is not warranted to be error-free.
Except as may be expressly permitted in your license agreement for these Programs, no part of these
Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose.
If the Programs are delivered to the United States Government or anyone licensing or using the Programs on
behalf of the United States Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data
delivered to U.S. Government customers are "commercial computer software" or "commercial technical data"
pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As
such, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation
and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license
agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, Commercial
Computer Software—Restricted Rights (June 1987). Oracle USA, Inc., 500 Oracle Parkway, Redwood City,
CA 94065.
The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently
dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup,
redundancy and other measures to ensure the safe use of such applications if the Programs are used for such
purposes, and we disclaim liability for any damages caused by such use of the Programs.
Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.
The Programs may provide links to Web sites and access to content, products, and services from third
parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites.
You bear all risks associated with the use of such content. If you choose to purchase any products or services
from a third party, the relationship is directly between you and the third party. Oracle is not responsible for:
(a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the
third party, including delivery of products or services and warranty obligations related to purchased
products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from
dealing with any third party.
v
Contents
Preface ............................................................................................................................................................... xxi
What's New in Backup and Recovery?........................................................................................ xxiii
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 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-4
Typical Backup Options.................................................................................................................... 2-5
Making Incremental Backups........................................................................................................... 2-5
Validating Database Files and Backups.......................................................................................... 2-7
Scripting RMAN Operations............................................................................................................ 2-8
Reporting on RMAN Operations.......................................................................................................... 2-8
Listing Backups .................................................................................................................................. 2-8
Reporting on Database Files and Backups ..................................................................................... 2-9
Maintaining RMAN Backups ............................................................................................................. 2-10
vi
Crosschecking Backups.................................................................................................................. 2-10
Deleting Obsolete Backups............................................................................................................ 2-10
Diagnosing and Repairing Failures with Data Recovery Advisor .............................................. 2-11
Listing Failures and Determining Repair Options..................................................................... 2-11
Repairing Failures........................................................................................................................... 2-12
Rewinding a Database with Flashback Database........................................................................... 2-13
Restoring and Recovering Database Files........................................................................................ 2-13
Preparing to Restore and Recover Database Files...................................................................... 2-14
Recovering the Whole Database ................................................................................................... 2-14
Recovering Tablespaces ................................................................................................................. 2-15
Recovering Individual Data Blocks.............................................................................................. 2-16
Part II Starting and Configuring RMAN
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
Flash 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-8
Making Database Connections from the RMAN Prompt ......................................................... 4-10
Connecting RMAN to an Auxiliary Database ............................................................................ 4-10
Making RMAN Database Connections Within Command Files ............................................. 4-11
vii
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-13
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-8
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-10
Configuring SBT Channels for Use with a Media Manager ..................................................... 5-12
Configuring the Flash Recovery Area ............................................................................................... 5-13
Overview of the Flash Recovery Area ......................................................................................... 5-14
Enabling the Flash Recovery Area................................................................................................ 5-16
Configuring Locations for Control Files and Redo Logs .......................................................... 5-19
Configuring RMAN File Creation in the Flash Recovery Area................................................ 5-20
Configuring the Backup Retention Policy ....................................................................................... 5-21
Configuring a Redundancy-Based Retention Policy ................................................................. 5-21
Configuring a Recovery Window-Based Retention Policy....................................................... 5-22
Disabling the Retention Policy...................................................................................................... 5-22
Configuring Backup Optimization.................................................................................................... 5-23
Overview of Backup Optimization............................................................................................... 5-23
Effect of Retention Policies on Backup Optimization for SBT Backups.................................. 5-24
Configuring Backup Optimization............................................................................................... 5-25
Configuring an Archived Redo Log Deletion Policy ..................................................................... 5-26
About Archived Redo Log Deletion Policies .............................................................................. 5-26
Enabling an Archived Redo Log Deletion Policy....................................................................... 5-27
Configuring Oracle Flashback Database and Restore Points....................................................... 5-27
About Restore Points and Flashback Database .......................................................................... 5-28
Prerequisites for Flashback Database and Guaranteed Restore Points................................... 5-32
Enabling Flashback Database........................................................................................................ 5-33
Creating Normal and Guaranteed Restore Points ..................................................................... 5-33
Configuring the Environment for Optimal Flashback Database Performance...................... 5-34
Configuring RMAN in a Data Guard Environment....................................................................... 5-35
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
viii
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-6
Configuring the Backup Compression Algorithm........................................................................ 6-6
Configuring Backup Encryption...................................................................................................... 6-7
Configuring Auxiliary Instance Datafile Names ............................................................................ 6-10
Configuring the Snapshot Control File Location............................................................................ 6-11
Viewing the Configured Location of the Snapshot Control File.............................................. 6-11
Setting the Location of the Snapshot Control File...................................................................... 6-11
Configuring RMAN for Use with a Shared Server......................................................................... 6-11
Enabling Lost Write Detection............................................................................................................ 6-13
Part III Backing Up and Archiving Data
7 RMAN Backup Concepts
Consistent and Inconsistent RMAN Backups .................................................................................... 7-1
Consistent Backups............................................................................................................................ 7-1
Inconsistent Backups ......................................................................................................................... 7-2
Online Backups and Backup Mode ...................................................................................................... 7-2
Backup Sets................................................................................................................................................ 7-3
Backup Sets and Backup Pieces ....................................................................................................... 7-3
Compression for Backup Sets........................................................................................................... 7-4
Encryption for Backup Sets............................................................................................................... 7-4
Filenames for Backup Pieces ............................................................................................................ 7-5
Number and Size of Backup Pieces................................................................................................. 7-5
Number and Size of Backup Sets..................................................................................................... 7-6
Multiplexed Backup Sets................................................................................................................... 7-6
Proxy Copies....................................................................................................................................... 7-8
Image Copies............................................................................................................................................. 7-8
RMAN-Created Image Copies ......................................................................................................... 7-8
User-Managed Image Copies ........................................................................................................... 7-9
Multiple Copies of RMAN Backups ................................................................................................. 7-10
Duplexed Backup Sets.................................................................................................................... 7-10
Backups of Backups ........................................................................................................................ 7-11
Control File and Server Parameter File Autobackups.................................................................... 7-12
When RMAN Performs Control File Autobackups ................................................................... 7-12
How RMAN Performs Control File Autobackups..................................................................... 7-12
Incremental Backups ............................................................................................................................ 7-13
Multilevel Incremental Backups ................................................................................................... 7-13
Block Change Tracking................................................................................................................... 7-15
Incremental Backup Algorithm..................................................................................................... 7-16
Recovery with Incremental Backups............................................................................................ 7-16
Backup Retention Policies................................................................................................................... 7-17
Recovery Window........................................................................................................................... 7-17
Backup Redundancy....................................................................................................................... 7-19
ix
Batch Deletes of Obsolete Backups............................................................................................... 7-19
Backup Retention Policy and Flash Recovery Area Deletion Rules........................................ 7-20
8 Backing Up the Database
Overview of RMAN Backups ................................................................................................................ 8-1
Purpose of RMAN Backups.............................................................................................................. 8-1
Basic Concepts of RMAN Backups.................................................................................................. 8-1
Specifying Backup Output Options ..................................................................................................... 8-2
Specifying the Device Type for an RMAN Backup....................................................................... 8-2
Specifying Backup Set or Copy for an RMAN Backup to Disk................................................... 8-3
Specifying a Format for RMAN Backups ....................................................................................... 8-3
Specifying Tags for an RMAN Backup........................................................................................... 8-4
Making Compressed Backups.......................................................................................................... 8-6
Backing Up Database Files with RMAN ............................................................................................. 8-7
Making Whole Database Backups with RMAN ............................................................................ 8-7
Backing Up Tablespaces and Datafiles with RMAN .................................................................... 8-8
Backing Up Control Files with RMAN ........................................................................................... 8-8
Backing Up Server Parameter Files with RMAN ....................................................................... 8-10
Backing Up a Database in NOARCHIVELOG Mode ................................................................ 8-10
Backing Up Archived Redo Logs with RMAN................................................................................ 8-11
About Backups of Archived Redo Logs....................................................................................... 8-11
Backing Up Archived Redo Log Files .......................................................................................... 8-12
Backing Up Only Archived Redo Logs That Need Backups.................................................... 8-13
Deleting Archived Redo Logs After Backups............................................................................. 8-13
Making and Updating Incremental Backups................................................................................... 8-14
Purpose of Incremental Backups .................................................................................................. 8-14
Planning an Incremental Backup Strategy .................................................................................. 8-15
Making Incremental Backups........................................................................................................ 8-16
Incrementally Updating Backups ................................................................................................. 8-17
Using Block Change Tracking to Improve Incremental Backup Performance ...................... 8-20
Making Database Backups for Long-Term Storage........................................................................ 8-23
Purpose of Archival Backups ........................................................................................................ 8-23
Basic Concepts of Archival Backups ............................................................................................ 8-23
Making an Archival Backup for Long-Term Storage................................................................. 8-24
Making a Temporary Archival Backup ....................................................................................... 8-25
Backing Up RMAN Backups............................................................................................................... 8-26
About Backups of Backups............................................................................................................ 8-26
Backing Up Backup Sets with RMAN.......................................................................................... 8-28
Backing Up Image Copy Backups with RMAN ......................................................................... 8-29
9 Backing Up the Database: Advanced Topics
Limiting the Size of RMAN Backup Sets............................................................................................ 9-1
About Backup Set Size....................................................................................................................... 9-1
Limiting the Size of Backup Sets with BACKUP ... MAXSETSIZE............................................. 9-2
Dividing the Backup of a Large Datafile into Sections................................................................. 9-2
Using Backup Optimization to Skip Files........................................................................................... 9-3
x
Optimizing a Daily Archived Log Backup to a Single Tape: Scenario....................................... 9-4
Optimizing a Daily Archived Log Backup to Multiple Media Families: Scenario................... 9-4
Creating a Weekly Secondary Backup of Archived Logs: Example........................................... 9-5
Skipping Offline, Read-Only, and Inaccessible Files....................................................................... 9-6
Duplexing Backup Sets........................................................................................................................... 9-6
Duplexing Backup Sets with CONFIGURE BACKUP COPIES .................................................. 9-7
Duplexing Backup Sets with BACKUP ... COPIES ....................................................................... 9-8
Making Split Mirror Backups with RMAN........................................................................................ 9-8
Encrypting RMAN Backups................................................................................................................ 9-10
About RMAN Backup Encryption Settings................................................................................. 9-10
Making Transparent-Mode Encrypted Backups ........................................................................ 9-11
Making Password-Mode Encrypted Backups............................................................................. 9-11
Making Dual-Mode Encrypted Backups ..................................................................................... 9-11
Restarting RMAN Backups ................................................................................................................. 9-12
About Restartable Backups............................................................................................................ 9-12
Restarting a Backup After It Partially Completes ...................................................................... 9-13
Managing Backup Windows ............................................................................................................... 9-13
About Backup Windows................................................................................................................ 9-13
Specifying a Backup Duration....................................................................................................... 9-13
Permitting Partial Backups in a Backup Window...................................................................... 9-14
Minimizing Backup Load and Duration...................................................................................... 9-14
Part IV Managing RMAN Backups
10 Reporting on RMAN Operations
Overview of RMAN Reporting .......................................................................................................... 10-1
Purpose of RMAN Reporting........................................................................................................ 10-1
Basic Concepts of RMAN Reporting............................................................................................ 10-1
Listing Backups and Recovery-Related Objects ............................................................................. 10-3
About the LIST Command............................................................................................................. 10-3
Listing Backups and Copies .......................................................................................................... 10-5
Listing Selected Backups and Copies........................................................................................... 10-7
Listing Database Incarnations....................................................................................................... 10-9
Listing Restore Points..................................................................................................................... 10-9
Reporting on Backups and Database Schema ............................................................................... 10-10
About Reports of RMAN Backups ............................................................................................. 10-10
Reporting on Files Needing a Backup Under a Retention Policy .......................................... 10-11
Reporting on Datafiles Affected by Unrecoverable Operations ............................................ 10-12
Reporting on Obsolete Backups.................................................................................................. 10-13
Reporting on the Database Schema............................................................................................ 10-14
Using V$ Views to Query Backup Metadata.................................................................................. 10-15
Querying Details of Past and Current RMAN Jobs ................................................................. 10-15
Determining the Encryption Status of Backup Pieces ............................................................. 10-16
Querying Recovery Catalog Views .................................................................................................. 10-17
About Recovery Catalog Views .................................................................................................. 10-17
Querying Catalog Views for the Target DB_KEY or DBID Values ....................................... 10-18
Querying RC_BACKUP_FILES................................................................................................... 10-19
xi
11 Maintaining RMAN Backups and Repository Records
Overview of RMAN Backup and Repository Maintenance ......................................................... 11-1
Purpose of Backup and Repository Maintenance ...................................................................... 11-1
Basic Concepts of Backup and Repository Maintenance .......................................................... 11-2
Maintaining the Control File Repository ......................................................................................... 11-3
About Control File Records ........................................................................................................... 11-3
Preventing the Loss of Control File Records............................................................................... 11-5
Protecting the Control File............................................................................................................. 11-5
Maintaining the Flash Recovery Area............................................................................................... 11-6
Deletion Rules for the Flash Recovery Area................................................................................ 11-6
Monitoring Flash Recovery Area Space Usage........................................................................... 11-7
Managing Space For Flashback Logs in the Flash Recovery Area........................................... 11-7
Responding to a Full Flash Recovery Area ................................................................................. 11-8
Dropping Restore Points................................................................................................................ 11-9
Changing the Flash Recovery Area to a New Location............................................................. 11-9
Disabling the Flash Recovery Area............................................................................................... 11-9
Responding to an Instance Crash During File Creation.......................................................... 11-10
Monitoring Flashback Database Performance Impact............................................................. 11-10
Flashback Writer (RVWR) Behavior With I/O Errors ............................................................ 11-11
Updating the RMAN Repository ..................................................................................................... 11-11
Crosschecking the RMAN Repository ....................................................................................... 11-12
Changing the Repository Status of Backups and Copies........................................................ 11-14
Adding Backup Records to the RMAN Repository ................................................................. 11-16
Removing Records from the RMAN Repository...................................................................... 11-18
Deleting RMAN Backups and Archived Redo Logs.................................................................... 11-19
Overview of RMAN Deletion...................................................................................................... 11-19
Deleting All Backups and Copies ............................................................................................... 11-21
Deleting Specified Backups and Copies .................................................................................... 11-22
Deleting Expired RMAN Backups and Copies......................................................................... 11-23
Deleting Obsolete RMAN Backups Based on Retention Policies........................................... 11-23
Dropping a Database.......................................................................................................................... 11-24
12 Managing a Recovery Catalog
Overview of the Recovery Catalog .................................................................................................... 12-1
Purpose of the Recovery Catalog.................................................................................................. 12-1
Basic Concepts for the Recovery Catalog .................................................................................... 12-2
Basic Steps of Managing a Recovery Catalog ............................................................................. 12-3
Creating a Recovery Catalog ............................................................................................................... 12-4
Configuring the Recovery Catalog Database.............................................................................. 12-4
Creating the Recovery Catalog Schema Owner.......................................................................... 12-6
Executing the CREATE CATALOG Command.......................................................................... 12-6
Registering a Database in the Recovery Catalog ............................................................................ 12-7
About Registration of a Database in the Recovery Catalog...................................................... 12-7
Registering a Database with the REGISTER DATABASE Command..................................... 12-8
Cataloging Backups in the Recovery Catalog.................................................................................. 12-9
Creating and Managing Virtual Private Catalogs........................................................................... 12-9
xii
About Virtual Private Catalogs..................................................................................................... 12-9
Creating and Granting Privileges to a Virtual Private Catalog Owner ................................ 12-10
Creating a Virtual Private Catalog ............................................................................................. 12-11
Revoking Privileges from a Virtual Private Catalog Owner .................................................. 12-12
Dropping a Virtual Private Catalog ........................................................................................... 12-12
Protecting the Recovery Catalog....................................................................................................... 12-13
Backing Up the Recovery Catalog .............................................................................................. 12-13
Recovering the Recovery Catalog............................................................................................... 12-15
Managing Stored Scripts.................................................................................................................... 12-15
About Stored Scripts..................................................................................................................... 12-15
Creating Stored Scripts................................................................................................................. 12-16
Replacing Stored Scripts .............................................................................................................. 12-17
Executing Stored Scripts .............................................................................................................. 12-17
Creating and Executing Dynamic Stored Scripts ..................................................................... 12-18
Printing Stored Scripts.................................................................................................................. 12-19
Listing Stored Script Names........................................................................................................ 12-20
Deleting Stored Scripts................................................................................................................. 12-20
Executing a Stored Script at RMAN Startup............................................................................. 12-21
Maintaining a Recovery Catalog ...................................................................................................... 12-21
About Recovery Catalog Maintenance ...................................................................................... 12-21
Resynchronizing the Recovery Catalog..................................................................................... 12-22
Updating the Recovery Catalog After Changing a DB_UNIQUE_NAME........................... 12-25
Unregistering a Target Database from the Recovery Catalog................................................ 12-26
Resetting the Database Incarnation in the Recovery Catalog................................................. 12-28
Upgrading the Recovery Catalog ............................................................................................... 12-29
Importing and Moving a Recovery Catalog.............................................................................. 12-31
Dropping a Recovery Catalog........................................................................................................... 12-33
Part V Diagnosing and Responding to Failures
13 RMAN Data Repair Concepts
Overview of RMAN Data Repair....................................................................................................... 13-1
Problems Requiring Data Repair .................................................................................................. 13-1
RMAN Data Repair Techniques ................................................................................................... 13-2
RMAN Restore Operations ................................................................................................................. 13-3
Backup Selection.............................................................................................................................. 13-3
Restore Failover............................................................................................................................... 13-4
Restore Optimization...................................................................................................................... 13-4
RMAN Media Recovery....................................................................................................................... 13-5
Selection of Incremental Backups and Archived Redo Logs.................................................... 13-5
Database Incarnations .................................................................................................................... 13-5
14 Diagnosing and Repairing Failures with Data Recovery Advisor
Overview of Data Recovery Advisor................................................................................................. 14-1
Purpose of Data Recovery Advisor.............................................................................................. 14-1
Basic Concepts of Data Recovery Advisor .................................................................................. 14-2
xiii
Basic Steps of Diagnosing and Repairing Failures..................................................................... 14-6
Listing Failures ...................................................................................................................................... 14-6
Listing All Failures.......................................................................................................................... 14-7
Listing a Subset of Failures............................................................................................................ 14-7
Checking for Block Corruptions by Validating the Database...................................................... 14-8
Determining Repair Options ............................................................................................................ 14-10
Determining Repair Options for All Failures ........................................................................... 14-10
Determining Repair Options for a Subset of Failures.............................................................. 14-11
Repairing Failures............................................................................................................................... 14-12
About Repairing Failures............................................................................................................. 14-12
Repairing a Failure........................................................................................................................ 14-13
Changing Failure Status and Priority.............................................................................................. 14-14
15 Validating Database Files and Backups
Overview of RMAN Validation.......................................................................................................... 15-1
Purpose of RMAN Validation....................................................................................................... 15-1
Basic Concepts of RMAN Validation ........................................................................................... 15-1
Checking for Block Corruption with the VALIDATE Command................................................ 15-4
Parallelizing the Validation of a Datafile..................................................................................... 15-5
Validating Database Files with BACKUP VALIDATE................................................................... 15-6
Validating Backups Before Restoring Them.................................................................................... 15-6
16 Performing Flashback and Database Point-in-Time Recovery
Overview of Flashback Technology and Database Point-in-Time Recovery ............................ 16-1
Purpose of Flashback and Database Point-in-Time-Recovery ................................................. 16-1
Basic Concepts of Point-in-Time Recovery and Flashback Features....................................... 16-1
Rewinding a Table with Flashback Table......................................................................................... 16-4
Prerequisites for Flashback Table ................................................................................................. 16-4
Performing a Flashback Table Operation.................................................................................... 16-5
Rewinding a DROP TABLE Operation with Flashback Drop ..................................................... 16-7
About Flashback Drop.................................................................................................................... 16-7
Prerequisites of Flashback Drop ................................................................................................... 16-7
Performing a Flashback Drop Operation..................................................................................... 16-8
Rewinding a Database with Flashback Database......................................................................... 16-11
Prerequisites of Flashback Database .......................................................................................... 16-11
Performing a Flashback Database Operation............................................................................ 16-12
Performing Database Point-in-Time Recovery.............................................................................. 16-14
Prerequisites of Database Point-in-Time Recovery.................................................................. 16-15
Performing Database Point-in-Time Recovery......................................................................... 16-15
Flashback and Database Point-in-Time Recovery Scenarios...................................................... 16-17
Rewinding an OPEN RESETLOGS Operation with Flashback Database............................. 16-17
Rewinding the Database to an SCN in an Abandoned Incarnation Branch......................... 16-18
Recovering the Database to an Ancestor Incarnation.............................................................. 16-20
17 Performing Complete Database Recovery
Overview of Complete Database Recovery...................................................................................... 17-1
xiv
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
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-9
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 Block Media Recovery
Overview of Block Media Recovery.................................................................................................. 18-1
Purpose of Block Media Recovery................................................................................................ 18-1
Basic Concepts of Block Media Recovery.................................................................................... 18-2
Prerequisites for Block Media Recovery .......................................................................................... 18-3
Recovering Individual Blocks ............................................................................................................ 18-4
Recovering All Blocks in V$DATABASE_BLOCK_CORRUPTION........................................... 18-5
19 Performing RMAN Recovery: Advanced Scenarios
Recovering a NOARCHIVELOG Database with Incremental Backups .................................... 19-1
Restoring the Server Parameter File .................................................................................................. 19-2
Restoring the Server Parameter File from a Control File Autobackup ................................... 19-3
Creating an Initialization Parameter File with RMAN.............................................................. 19-4
Performing Recovery with a Backup Control File.......................................................................... 19-4
About Recovery with a Backup Control File .............................................................................. 19-4
Performing Recovery with a Backup Control File and No Recovery Catalog....................... 19-6
Performing Disaster Recovery............................................................................................................ 19-8
Prerequisites of Disaster Recovery ............................................................................................... 19-8
Recovering the Database After a Disaster................................................................................... 19-8
Restoring a Database on a New Host .............................................................................................. 19-10
Preparing to Restore a Database on a New Host ..................................................................... 19-11
Testing the Restore of a Database on a New Host ................................................................... 19-12
20 Performing RMAN Tablespace Point-in-Time Recovery (TSPITR)
Overview of RMAN TSPITR .............................................................................................................. 20-1
Purpose of RMAN TSPTIR ............................................................................................................ 20-1
Basic Concepts of RMAN TSPITR ................................................................................................ 20-2
Basic Steps of RMAN TSPITR ....................................................................................................... 20-3
Prerequisites and Consequences of TSPITR ................................................................................... 20-3
Consequences of TSPITR ............................................................................................................... 20-4
Special Considerations When Not Using a Recovery Catalog ................................................. 20-4
Planning and Preparing for TSPITR ................................................................................................. 20-5
xv
Choosing the Right Target Time for TSPITR .............................................................................. 20-5
Determining the Recovery Set....................................................................................................... 20-5
Identifying and Preserving Objects That Will Be Lost After TSPITR...................................... 20-7
Performing Fully Automated RMAN TSPITR................................................................................ 20-8
Performing Customized RMAN TSPITR with an RMAN-Managed Auxiliary Instance..... 20-10
Renaming Oracle Managed Files in TSPITR............................................................................. 20-10
Renaming TSPITR Recovery Set Datafiles with SET NEWNAME........................................ 20-10
Naming TSPITR Auxiliary Set Datafiles.................................................................................... 20-11
Using Image Copies for Faster RMAN TSPITR Performance ................................................ 20-14
Customizing Initialization Parameters for the Automatic Auxiliary Instance in TSPITR . 20-16
Performing RMAN TSPITR Using Your Own Auxiliary Instance............................................ 20-18
Preparing Your Own Auxiliary Instance for RMAN TSPITR ................................................ 20-18
Preparing RMAN Commands for TSPITR with Your Own Auxiliary Instance.................. 20-20
Executing TSPITR with Your Own Auxiliary Instance ........................................................... 20-20
Performing TSPITR with Your Own Auxiliary Instance: Scenario........................................ 20-21
Troubleshooting RMAN TSPITR..................................................................................................... 20-23
Troubleshooting Filename Conflicts .......................................................................................... 20-23
Troubleshooting Identification of Tablespaces with Undo Segments................................... 20-23
Troubleshooting the Restart of a Manual Auxiliary Instance After TSPITR Failure .......... 20-23
Part VI Tuning and Troubleshooting
21 Tuning RMAN Performance
Purpose of RMAN Performance Tuning........................................................................................... 21-1
Basic Concepts of RMAN Performance Tuning .............................................................................. 21-1
Read Phase ....................................................................................................................................... 21-3
Copy Phase....................................................................................................................................... 21-6
Write Phase for SBT ........................................................................................................................ 21-6
Write Phase for Disk....................................................................................................................... 21-9
Using V$ Views to Diagnose RMAN Performance Problems.................................................... 21-10
Monitoring RMAN Job Progress with V$SESSION_LONGOPS ........................................... 21-10
Identifying Bottlenecks with V$BACKUP_SYNC_IO and V$BACKUP_ASYNC_IO ........ 21-12
Tuning RMAN Backup Performance............................................................................................... 21-13
Step 1: Remove the RATE Parameter from Channel Settings ................................................ 21-13
Step 2: If You Use Synchronous Disk I/O, Set DBWR_IO_SLAVES..................................... 21-14
Step 3: If You Fail to Allocate Shared Memory, Set LARGE_POOL_SIZE........................... 21-14
Step 4: Tune the Read, Write, and Copy Phases....................................................................... 21-15
22 Troubleshooting RMAN Operations
Interpreting RMAN Message Output ............................................................................................... 22-1
Identifying Types of Message Output ......................................................................................... 22-1
Recognizing RMAN Error Message Stacks................................................................................. 22-2
Identifying Error Codes ................................................................................................................. 22-2
Interpreting RMAN Error Stacks.................................................................................................. 22-5
Identifying RMAN Return Codes................................................................................................. 22-7
Using V$ Views for RMAN Troubleshooting.................................................................................. 22-7
xvi
Monitoring RMAN Interaction with the Media Manager ........................................................ 22-8
Correlating Server Sessions with RMAN Channels................................................................... 22-9
Testing the Media Management API............................................................................................... 22-11
Obtaining the sbttest Utility ........................................................................................................ 22-11
Obtaining Online Documentation for the sbttest Utility......................................................... 22-11
Using the sbttest Utility................................................................................................................ 22-12
Terminating an RMAN Command................................................................................................... 22-13
Terminating the Session with ALTER SYSTEM KILL SESSION............................................ 22-13
Terminating the Session at the Operating System Level......................................................... 22-13
Terminating an RMAN Session That Is Hung in the Media Manager.................................. 22-13
Part VII Transferring Data with RMAN
23 Duplicating a Database
Overview of RMAN Database Duplication..................................................................................... 23-1
Purpose of Database Duplication ................................................................................................. 23-1
Basic Concepts of Database Duplication ..................................................................................... 23-2
Basic Steps of Database Duplication ............................................................................................ 23-3
Making Backups and Archived Logs Accessible to the Duplicate Instance ............................. 23-3
Making SBT Backups Accessible to the Duplicate Instance...................................................... 23-4
Making Disk Backups Accessible to the Duplicate Instance .................................................... 23-4
Choosing a Strategy for Naming Duplicate Files ........................................................................... 23-6
Preparing the Auxiliary Instance ....................................................................................................... 23-7
Step 1: Create an Oracle Password File for the Auxiliary Instance ......................................... 23-7
Step 2: Establish Oracle Net Connectivity to the Auxiliary Instance ...................................... 23-8
Step 3: Create an Initialization Parameter File for the Auxiliary Instance.............................. 23-8
Step 4: Start the Auxiliary Instance with SQL*Plus ................................................................. 23-10
Starting and Configuring RMAN Before Duplication ................................................................ 23-10
Step 1: Start RMAN and Connect to the Database Instances.................................................. 23-10
Step 2: Mount or Open the Source Database............................................................................. 23-11
Step 3: Configure RMAN Channels for Use in the Duplication............................................. 23-11
Duplicating a Database ...................................................................................................................... 23-11
Duplicating a Database to a Remote Host with the Same Directory Structure ................... 23-12
Duplicating a Database to a Remote Host with a Different Directory Structure................. 23-13
Creating a Duplicate Database on the Local Host.................................................................... 23-14
Duplicating a Database with Oracle Managed Files or Automatic Storage Management. 23-14
Naming Duplicate Files with Alternative Techniques ................................................................ 23-16
Naming Duplicate Control Files................................................................................................. 23-17
Naming Duplicate Online Redo Log Files................................................................................. 23-17
Naming Duplicate Datafiles ........................................................................................................ 23-18
Naming Duplicate Tempfiles ...................................................................................................... 23-19
RMAN Duplication Scenarios.......................................................................................................... 23-19
Duplicating a Subset of the Source Database Tablespaces...................................................... 23-19
Using DUPLICATE to Restore an Archival Backup ................................................................ 23-21
Using SET NEWNAME to Name Duplicate Files.................................................................... 23-22
Using CONFIGURE AUXNAME to Name Duplicate Files.................................................... 23-23
xvii
24 Creating Transportable Tablespace Sets
Overview of Creating Transportable Tablespace Sets ................................................................... 24-1
Purpose of Creating Transportable Tablespace Sets.................................................................. 24-1
Basic Concepts of Transportable Tablespace Sets ...................................................................... 24-2
Basic Steps of Creating Transportable Tablespace Sets............................................................. 24-4
Customizing Initialization Parameters for the Auxiliary Instance ............................................. 24-5
Setting Initialization Parameters for the Auxiliary Instance..................................................... 24-5
Setting the Location of the Auxiliary Instance Parameter File................................................. 24-6
Creating a Transportable Tablespace Set .......................................................................................... 24-7
Troubleshooting Creation of Transportable Tablespace Sets ....................................................... 24-8
Transportable Tablespace Set Scenarios ........................................................................................... 24-8
Creating a Transportable Tablespace Set at a Specified Time or SCN.................................... 24-8
Specifying Locations for Data Pump Files................................................................................... 24-9
Specifying Auxiliary File Locations............................................................................................ 24-10
25 Transporting Data Across Platforms
Overview of Cross-Platform Data Transportation.......................................................................... 25-1
Purpose of Cross-Platform Data Transportation........................................................................ 25-1
Basic Concepts of Cross-Platform Data Transportation............................................................ 25-2
Performing Cross-Platform Tablespace Conversion on the Source Host................................... 25-3
Performing Cross-Platform Datafile Conversion on the Destination Host............................... 25-4
About Cross-Platform Datafile Conversion on the Destination Host ..................................... 25-4
Using CONVERT DATAFILE to Convert Datafile Formats..................................................... 25-5
Checking the Database Before Cross-Platform Database Conversion ....................................... 25-7
Converting Datafiles on the Source Host When Transporting a Database................................ 25-9
Converting Datafiles on the Destination Host When Transporting the Database................. 25-11
Performing Preliminary Datafile Conversion Steps on the Source Host.............................. 25-11
Converting Datafiles on the Destination Host.......................................................................... 25-13
26 Performing ASM Data Migration
Overview of ASM Data Migration .................................................................................................... 26-1
Purpose of ASM Data Migration .................................................................................................. 26-1
Basic Concepts of ASM Data Migration....................................................................................... 26-1
Basics Steps of Data Migration to ASM ....................................................................................... 26-2
Preparing to Migrate the Database to ASM ..................................................................................... 26-2
Migrating the Database to ASM......................................................................................................... 26-4
Migrating a Database from ASM to Alternative Storage .............................................................. 26-8
Moving Datafiles Between ASM Disk Groups............................................................................... 26-8
Part VIII Performing User-Managed Backup and Recovery
27 Making User-Managed Database Backups
Querying V$ Views to Obtain Backup Information ...................................................................... 27-1
Listing Database Files Before a Backup ....................................................................................... 27-1
Determining Datafile Status for Online Tablespace Backups................................................... 27-2
xviii
Making User-Managed Backups of the Whole Database.............................................................. 27-3
Making Consistent Whole Database Backups ............................................................................ 27-3
Making User-Managed Backups of Tablespaces and Datafiles ................................................... 27-4
Making User-Managed Backups of Offline Tablespaces and Datafiles.................................. 27-4
Making User-Managed Backups of Online Tablespaces and Datafiles .................................. 27-5
Making User-Managed Backups of the Control File.................................................................... 27-10
Backing Up the Control File to a Binary File............................................................................. 27-10
Backing Up the Control File to a Trace File............................................................................... 27-11
Making User-Managed Backups of Archived Redo Logs ........................................................... 27-11
Making User-Managed Backups in SUSPEND Mode ................................................................. 27-11
About the Suspend/Resume Feature......................................................................................... 27-12
Making Backups in a Suspended Database............................................................................... 27-12
Making User-Managed Backups to Raw Devices......................................................................... 27-14
Backing Up to Raw Devices on Linux and UNIX..................................................................... 27-14
Backing Up to Raw Devices on Windows................................................................................. 27-16
Making Backups with the Volume Shadow Copy Service (VSS).............................................. 27-17
Verifying User-Managed Datafile Backups ................................................................................... 27-17
Testing the Restore of Datafile Backups .................................................................................... 27-17
Running the DBVERIFY Utility .................................................................................................. 27-17
28 Performing User-Managed Database Flashback and Recovery
Performing Flashback Database with SQL*Plus ............................................................................ 28-1
Overview of User-Managed Media Recovery.................................................................................. 28-2
About User-Managed Restore and Recovery.............................................................................. 28-2
Automatic Recovery with the RECOVER Command................................................................ 28-3
Recovery When Archived Logs Are in the Default Location ................................................... 28-5
Recovery When Archived Logs Are in a Nondefault Location................................................ 28-5
Recovery Cancellation.................................................................................................................... 28-6
Parallel Media Recovery ................................................................................................................ 28-7
Performing Complete Database Recovery ....................................................................................... 28-7
Performing Closed Database Recovery ....................................................................................... 28-8
Performing Open Database Recovery........................................................................................ 28-11
Performing Incomplete Database Recovery................................................................................... 28-13
Performing Cancel-Based Incomplete Recovery...................................................................... 28-14
Performing Time-Based or Change-Based Incomplete Recovery.......................................... 28-16
Recovering a Database in NOARCHIVELOG Mode................................................................... 28-16
Troubleshooting Media Recovery .................................................................................................... 28-17
About User-Managed Media Recovery Problems.................................................................... 28-18
Investigating the Media Recovery Problem: Phase 1............................................................... 28-19
Trying to Fix the Recovery Problem Without Corrupting Blocks: Phase 2.......................... 28-20
Deciding Whether to Allow Recovery to Corrupt Blocks: Phase 3........................................ 28-21
Allowing Recovery to Corrupt Blocks: Phase 4........................................................................ 28-23
Performing Trial Recovery........................................................................................................... 28-23
29 Performing User-Managed Recovery: Advanced Scenarios
Responding to the Loss of a Subset of the Current Control Files ............................................... 29-1
Copying a Multiplexed Control File to a Default Location ...................................................... 29-1
xix
Copying a Multiplexed Control File to a Nondefault Location ............................................... 29-2
Recovering After Loss of All Current Control Files....................................................................... 29-2
Recovering with a Backup Control File in the Default Location ............................................. 29-3
Recovering with a Backup Control File in a Nondefault Location ......................................... 29-4
Recovering Through an Added Datafile with a Backup Control File..................................... 29-4
Recovering Read-Only Tablespaces with a Backup Control File............................................. 29-5
Re-Creating a Control File ................................................................................................................... 29-6
Recovering Through a RESETLOGS with a Created Control File........................................... 29-7
Recovery of Read-Only Files with a Re-Created Control File.................................................. 29-8
Re-Creating Datafiles When Backups Are Unavailable................................................................ 29-8
Recovering NOLOGGING Tables and Indexes .............................................................................. 29-9
Recovering Transportable Tablespaces ........................................................................................... 29-10
Recovering After the Loss of Online Redo Log Files................................................................... 29-10
Recovering After Losing a Member of a Multiplexed Online Redo Log Group ................. 29-11
Recovering After the Loss of All Members of an Online Redo Log Group.......................... 29-12
Recovering from a Dropped Table Without Using Flashback Features ................................... 29-15
Dropping a Database with SQL*Plus.............................................................................................. 29-16
Glossary
Index
xx
xxi
Preface
This preface contains the following topics:
Audience
Documentation Accessibility
Related 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 need to 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 are running the database
Documentation Accessibility
Our goal is to make Oracle products, services, and supporting documentation
accessible, with good usability, to the disabled community. To that end, our
documentation includes features that make information available to users of assistive
technology. This documentation is available in HTML format, and contains markup to
facilitate access by the disabled community. Accessibility standards will continue to
evolve over time, and Oracle is actively engaged with other market-leading
technology vendors to address technical obstacles so that our documentation can be
accessible to all of our customers. For more information, visit the Oracle Accessibility
Program Web site at http://www.oracle.com/accessibility/.
Accessibility of Code Examples in Documentation
Screen readers may not always correctly read the code examples in this document. The
conventions for writing code require that closing braces should appear on an
xxii
otherwise empty line; however, some screen readers may not always read a line of text
that consists solely of a bracket or brace.
Accessibility of Links to External Web Sites in Documentation
This documentation may contain links to Web sites of other companies or
organizations that Oracle does not own or control. Oracle neither evaluates nor makes
any representations regarding the accessibility of these Web sites.
TTY Access to Oracle Support Services
Oracle provides dedicated Text Telephone (TTY) access to Oracle Support Services
within the United States of America 24 hours a day, 7 days a week. For TTY support,
call 800.446.2398. Outside the United States, call +1.407.458.2479.
Related Documentation
For more information, see these Oracle resources:
Oracle Database Backup and Recovery Reference
Oracle Database Utilities
Oracle Database Storage Administrator's Guide
You can access information about the Backup Solutions Program at
http://www.oracle.com/technology/deploy/availability
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 on how these schemas were created and how
you can use them yourself.
Oracle error message documentation is only available in HTML. If you only have
access to the Oracle Documentation CD, then you can browse the error messages by
range. Once you find the specific range, use your browser's "find in page" feature to
locate the specific message. When connected to the Internet, you can search for a
specific error message using the error message search feature of the Oracle online
documentation.
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.
xxiii
What's New in Backup and Recovery?
This section describes the new backup and recovery features in Oracle Database 11g
Release 1. The new features for this release greatly improve the manageability of
Oracle Database backup and recovery. In particular, manageability is increased by the
introduction of Data Recovery Advisor, better integration of RMAN with Data Guard,
expansion of the recovery catalog functionality, and improved management of
archived redo logs.
The new features in this release include:
Data Recovery Advisor
Data Recovery Advisor is a built-in tool to automatically diagnose data failures
and recommend repairs. You can repair failures manually or request that they be
repaired automatically. Data Recovery Advisor supports the LIST FAILURE,
CHANGE FAILURE, ADVISE FAILURE, and REPAIR FAILURE commands.
Improved integration with Data Guard
You can now set persistent RMAN configurations for a primary or physical
standby database when RMAN is not connected as TARGET to the database.
RMAN works seamlessly on all databases in the Data Guard environment,
enabling you to use backups made on one database for restore and recovery on
another database. The same recovery catalog can manage metadata for all primary
and standby databases.
Improved handling of long-term backups
You can create a long-term or archival backup with BACKUP ... KEEP that
retains only the archived log files needed to make the backup consistent.
Backup failover for archived redo logs in the flash recovery area
See Also: Chapter 14, "Diagnosing and Repairing Failures with Data
Recovery Advisor", and Oracle Database Backup and Recovery Reference
to learn about the Data Recovery Advisor commands
See Also: "Configuring RMAN in a Data Guard Environment" on
page 5-35, and Oracle Data Guard Concepts and Administration
See Also: "Making Database Backups for Long-Term Storage" on
page 8-23, and Oracle Database Backup and Recovery Reference to learn
about the BACKUP command
xxiv
When backing up archived redo log files located in the flash recovery area, RMAN
can fail over to archiving destinations outside the recovery area. RMAN can use an
intact copy of an archived log in an alternative location to continue writing
backups when a log in the recovery area is missing or corrupted.
Archived log deletion policy enhancements
When you CONFIGURE an archived log deletion policy, the configuration applies
to all archiving destinations, including the flash recovery area. Both BACKUP ...
DELETE INPUT and DELETE ... ARCHIVELOG obey this configuration, as does
the flash recovery area. You can also CONFIGURE an archived redo log deletion
policy so that logs are eligible for deletion only after being applied to or
transferred to standby database destinations. You can set the policy for mandatory
standby destinations only, or for any standby destinations.
Network-enabled database duplication without backups
You can use the DUPLICATE command to create a duplicate database or physical
standby database over the network without a need for pre-existing database
backups. This form of duplication is called active database duplication.
Recovery catalog enhancements
The owner of a recovery catalog can GRANT or REVOKE access to a subset of the
catalog to other database users in the same recovery catalog database. This subset
is called a virtual private catalog. You can also use the IMPORT CATALOG
command to merge one recovery catalog (or metadata for specific databases in the
catalog) into another recovery catalog.
Multisection backups
RMAN can back up a single file in parallel by dividing the work among multiple
channels. Each channel backs up one file section. You create a multisection
backup by specifying SECTION SIZE on the BACKUP command. Restoring a
multisection backup in parallel is automatic and requires no option.
You can parallelize validations of a file with VALIDATE ... SECTION SIZE.
See Also: "Archived Redo Log Failover" on page 8-11
See Also:
"Configuring an Archived Redo Log Deletion Policy" on
page 5-26,
Oracle Database Backup and Recovery Reference to learn about the
CONFIGURE ARCHIVELOG DELETION POLICY command
Oracle Data Guard Concepts and Administration to learn how to use
RMAN in a Data Guard environment
See Also: Chapter 23, "Duplicating a Database," and Oracle Database
Backup and Recovery Reference to learn about the DUPLICATE command
See Also: Chapter 12, "Managing a Recovery Catalog," and Oracle
Database Backup and Recovery Reference to learn about the recovery
catalog commands
xxv
Undo optimization
The BACKUP command does not back up undo that is not needed for recovery of a
backup. Undo is not needed if it was generated for a transaction that has already
committed. This undo can represent the majority of undo in the database.
Improved block media recovery performance
When performing block media recovery, RMAN automatically searches the
flashback logs, if they are available, for the required blocks before searching
backups. Using blocks from the flashback logs can significantly improve block
media recovery performance.
Improved block corruption detection
Several database components and utilities, including RMAN, can now detect a
corrupt block and record it in V$DATABASE_BLOCK_CORRUPTION. When
instance recovery detects a corrupt block, it records it in this view automatically.
Oracle Database automatically updates this view when block corruptions are
detected or repaired. The VALIDATE command is enhanced with many new
options such as VALIDATE ... BLOCK and VALIDATE DATABASE.
Faster backup compression
In addition to the existing BZIP2 algorithm for binary compression of backups,
RMAN also supports the ZLIB algorithm. ZLIB runs faster than BZIP2, but
produces larger files. ZLIB requires the Oracle Advanced Compression option.
You can use the CONFIGURE COMPRESSION ALGORITHM command to choose
between BZIP2 (default) and ZLIB for RMAN backups.
Block change tracking support for standby databases
You can enable block change tracking on a physical standby database. When you
back up the standby database, RMAN can use the block change tracking file to
quickly identify the blocks that changed since the last incremental backup.
See Also: "Dividing the Backup of a Large Datafile into Sections" on
page 9-2, and Oracle Database Backup and Recovery Reference to learn
about the BACKUP and VALIDATE commands
See Also: "Overview of Backup Optimization" on page 5-23, and
Oracle Database Backup and Recovery Reference to learn about the
BACKUP command
See Also: "Overview of Block Media Recovery" on page 18-1
See Also: Chapter 15, "Validating Database Files and Backups," and
Oracle Database Backup and Recovery Reference to learn about the
VALIDATE command
See Also: "Configuring the Backup Compression Algorithm" on
page 6-6, and Oracle Database Backup and Recovery Reference to learn
about the CONFIGURE command
See Also: "Making and Updating Incremental Backups" on
page 8-14
xxvi
Improved scripting with RMAN substitution variables
You can create RMAN command files and stored scripts that accept user input at
runtime. Thus, backup scripts can use RMAN substitution variables for tags,
filenames, restore point names, and so on.
Integration with VSS-enabled applications
The Oracle VSS writer is integrated with applications that use the Vo lume
Shadow Copy Service (VSS) infrastructure on Windows. You can use
VSS-enabled software and storage systems to back up and restore an Oracle
database. A key benefit is the ability to make a shadow copy of an open database.
Lost write detection
You can enable the DB_LOST_WRITE_PROTECT initialization parameter to detect a
lost write during managed recovery of a standby database or media recovery of a
primary database. Lost write detection is disabled by default.
Backup of read-only transportable tablespaces
In previous releases, RMAN could not back up transportable tablespaces until
they were made read/write at the destination database. Now RMAN can back up
transportable tablespaces when they are not read/write and restore these backups.
Backup and recovery enhancements in Oracle Enterprise Manager
Enterprise Manager includes an interface for Data Recovery Advisor.
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, never occurred.
Flashback data archive
See Also: "Using Substitution Variables in Command Files" on
page 4-4 and "Creating and Executing Dynamic Stored Scripts" on
page 12-18
See Also: Oracle Database Platform Guide for Microsoft Windows to
learn how to perform backup and recovery with VSS-enabled
applications, and Oracle Database Backup and Recovery Reference to learn
about the BACKUP command
See Also: "Enabling Lost Write Detection" on page 6-13
See Also: "Backing Up Tablespaces and Datafiles with RMAN" on
page 8-8
See Also: Oracle Database 2 Day DBA for details about Enterprise
Manager enhancements related to backup and recovery
See Also: Oracle Database Advanced Application Developer's Guide to
learn how to use this feature
xxvii
A flashback data archive enables the database to automatically track and store all
transactional changes to a table for the duration of its lifetime. Thus, you do not
need to build this functionality into database applications.
A flashback data archive is especially useful for compliance, audit reports, data
analysis, and DSS (Decision Support Systems). You can use some of the logical
flashback features with a flashback data archive to access data from far in the
past.
Improved media recovery performance for databases on SMP systems
Media recovery of databases on symmetric multiprocessing (SMP) computers is
now faster. The performance improvements include the following:
More parallelism
More efficient asynchronous redo read, parse, and apply
Fewer synchronization points in the parallel apply algorithm
The media recovery checkpoint at a redo log boundary no longer blocks the
apply of the next log
No configuration is necessary, although you can use new parallel recovery wait
events for tuning if the default apply rate is not satisfactory.
See Also: Oracle Database Advanced Application Developer's Guide to
learn how to configure and use a flashback data archive, and "Oracle
Flashback Technology" on page 1-5 for an overview of flashback
features
See Also: Oracle Database Reference to learn about Oracle wait events
xxviii
Part I
Part I Overview of Backup and Recovery
The chapters in this part introduce backup and recovery and explain how to devise a
backup and recovery strategy:
Chapter 1, "Introduction to Backup and Recovery"
Chapter 2, "Getting Started with RMAN"
1
Introduction to Backup and Recovery 1-1
1 Introduction to Backup and Recovery
This chapter explains the purpose of Oracle Database backup and recovery and
summarizes the Oracle solutions. This chapter includes 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 datafiles, 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 datafile.
Media Failures
A media failure is a physical problem with a disk that causes a failure of a read or
write of a disk file 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 SMITH 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)
This tool integrates with sessions running on an 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.
Both of the preceding solutions are supported by Oracle and are fully documented, but
RMAN is the preferred solution for database backup and recovery. RMAN performs
the same types of backup and recovery available through user-managed techniques
more easily, provides a common interface for backup tasks across different host
See Also:
Chapter 8, "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 8-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
operating systems, and offers a number of 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." RMAN gives you access to several backup and
recovery techniques and features not available with 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 datafile media recovery. If you enable block
change tracking, then you can improve performance by avoiding full scans of
every input datafile. You use the BACKUP INCREMENTAL command to perform
incremental backups.
Block media recovery
You an repair a datafile with only a small number of corrupt data blocks without
taking it offline or restoring it from backup. You use the RECOVER command to
perform block media recovery.
Unused block compression
In unused block compression, RMAN can skip data blocks that have never been
used and, in some cases, used blocks that are currently unused.
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.
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 for the most part beyond the scope of the backup and recovery
documentation.
Table 11 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 flashback features 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. With the exception of 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,
datafiles, 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 period of time. 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 16-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 16-7 explains how to use this
feature.
A flashback data archive enables you to use some of the 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
datafiles have unwanted changes, then you can use the RMAN command FLASHBACK
DATABASE to revert the datafiles 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 datafiles 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 flash 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 flash recovery area.
Oracle Database also supports restore points in conjunction 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. Within the context of 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. In most cases, Data Recovery
Advisor presents both automated and manual repair options.
See Also:
Chapter 16, "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 16-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 datafile restore and
recovery, media recovery, Flashback Database, and so on. Before presenting an
automated repair option, Data Recovery Advisor validates it with respect to 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 14, "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 flash
recovery area, backup retention policy, and archived redo log deletion policy.
3. Read Chapter 8, "Backing Up the Database."
This chapter explains how to implement a basic backup strategy.
4. Read Chapter 10, "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 11, "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 14, "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 16, "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 27, "Making User-Managed Database Backups."
This chapter explains how to make backups with third-party tools.
2. Read Chapter 28, "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 29, "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 and 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 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 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 flash recovery area
A disk location in which the database can store and manage files related to backup
and recovery. You set the flash 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 interface 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 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 Database
The RMAN client is started by issuing the rman command at the command prompt of
your operating system. After being started, RMAN 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 when using 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
database through Oracle Net (note that AS SYSDBA is not specified because it is
implied). RMAN prompts for a password.
% rman
See Also: Chapter 3, "Recovery Manager Architecture" for a more
detailed overview of the RMAN environment
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
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;
The output lists the CONFIGURE commands to re-create this configuration.
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
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 flash recovery area is enabled, and if you do not specify the FORMAT
parameter (see Table 21), 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. As long as you have the archived
redo logs needed to recover the backup, open database backups are as effective a
means of 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;
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.
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 7, "RMAN Backup Concepts," to learn concepts relating
to RMAN backups
Chapter 8, "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
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
datafiles 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. The following table lists some typical backup options.
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
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 filenames.
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. Note that 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 8-2
Backing Up a Database
2-6 Backup and Recovery User's Guide
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, but 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
routine. Changes from level 1 backups roll forward an image copy level 0 incremental
backup, so that it includes all changes as of the SCN at which the level 1 incremental
backup was created. Recovery of the updated level 0 incremental backup is faster
because all changes from the level 1 incremental backup have already been applied.
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 7-13 for a more detailed
conceptual overview of incremental backups and "Making and
Updating Incremental Backups" on page 8-14
Backing Up a Database
Getting Started with RMAN 2-7
The BACKUP FOR RECOVER OF COPY command specifies that an incremental
backup should contain all changes since the SCN of a specified datafile copy (level 0
incremental backup) of your database. The following table 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.
To validate database files:
1. Start RMAN and connect to a target database.
2. Run the 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 individual data blocks, as shown in
the following example:
Table 2–2 FOR RECOVER OF COPY Options
BACKUP Option Description Example
FOR RECOVER OF
COPY WITH TAG
'tag_name'
Use the TAG parameter to identify the
level 0 incremental backup serving as
the basis of the incremental backup. If
no level 0 datafile copy with the
specified tag exists in either the current
or parent database incarnation, then
RMAN creates a level 0 datafile 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'
Identifies the datafile copies to use as
the basis for this incremental backup.
BACKUP INCREMENTAL LEVEL 1
FOR RECOVER OF COPY
DATAFILECOPY FORMAT
'/disk2/df1.cpy'
DATABASE;
See Also: "Incrementally Updating Backups" on page 8-17
Reporting on RMAN Operations
2-8 Backup and Recovery User's Guide
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
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 datafile copies listed in the repository. For backups, you can control the
format of LIST output with the options in the following tables.
See Also: Chapter 15, "Validating Database Files and Backups"
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 runtime
Reporting on RMAN Operations
Getting Started with RMAN 2-9
For both backups and copies you have the following additional options.
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;
Reporting on Database Files and Backups
The REPORT command performs more complex analysis than LIST. Some of the main
options are shown in the following table.
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. By default, the output
is VERBOSE.
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 datafile backups or copies that have status
AVAILABLE in the RMAN repository and that can be
restored and recovered.
See Also: "Listing Backups and Recovery-Related Objects" on
page 10-3 to learn more about the LIST command
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.
Maintaining RMAN Backups
2-10 Backup and Recovery User's Guide
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 datafiles and tempfiles 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.
Crosschecking 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
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
SCHEMA REPORT SCHEMA Reports the tablespaces and datafiles in the database
at the current time (default) or a different time.
UNRECOVERABLE REPORT
UNRECOVERABLE
Lists all datafiles for which an unrecoverable
operation has been performed against an object in
the datafile since the last backup of the datafile.
See Also: "Reporting on Backups and Database Schema" on
page 10-10 to learn how to use the REPORT command for RMAN
reporting
See Also: "Crosschecking the RMAN Repository" on page 11-12 to
learn how to crosscheck RMAN backups
Table 2–5 (Cont.) REPORT Options
Option Example Explanation
Diagnosing and Repairing Failures with Data Recovery Advisor
Getting Started with RMAN 2-11
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 datafile 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 datafiles. 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 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
See Also: "Deleting RMAN Backups and Archived Redo Logs" on
page 11-19 to learn how to use the DELETE command
See Also: "Overview of Data Recovery Advisor" on page 14-1
Diagnosing and Repairing Failures with Data Recovery Advisor
2-12 Backup and Recovery User's Guide
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 will be performed and whether data
will be lost by performing the repair.
In Example 2–1, the output indicates the filename 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.
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.
See Also: "Listing Failures" on page 14-6 and "Determining Repair
Options" on page 14-10
See Also: "Repairing Failures" on page 14-12
Restoring and Recovering Database Files
Getting Started with RMAN 2-13
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 datafiles 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 "Configuring Oracle Flashback Database and Restore Points" on page 5-27.
Flashback Database works by rewinding changes to the datafiles that exist at the
moment that you run the command. You cannot use the command to repair media
failures or missing datafiles.
The database must be mounted when you issue FLASHBACK DATABASE. Note that 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 TIME
"TO_DATE('06/20/07','MM/DD/YY')";
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 datafiles is retrieving them from backups as needed
for a recovery operation. Media recovery is the application of changes from redo logs
See Also: "Rewinding a Database with Flashback Database" on
page 16-11
Restoring and Recovering Database Files
2-14 Backup and Recovery User's Guide
and incremental backups to a restored datafile to bring the datafile forward to a
desired SCN or point in time.
Preparing to Restore and Recover Database Files
If you need to 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 datafiles, 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
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 datafiles to their original locations. If the
See Also: Chapter 17, "Performing Complete Database Recovery"
Restoring and Recovering Database Files
Getting Started with RMAN 2-15
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, must take the tablespace that
needs recovery offline, restore and then recover the tablespace, and bring the
recovered tablespace online.
If you cannot restore a datafile to a new location, then use the RMAN SET NEWNAME
command within a RUN command to specify the new filename. Afterward, use a
SWITCH DATAFILE ALL command, which is equivalent to using the SQL statement
ALTER DATABASE RENAME FILE, to update the control file to reflect the new names
for all datafiles 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 datafile in the users tablespace:
RUN
Restoring and Recovering Database Files
2-16 Backup and Recovery User's Guide
{
SET NEWNAME FOR DATAFILE '/disk1/oradata/prod/users01.dbf'
TO '/disk2/users01.dbf';
RESTORE TABLESPACE users;
SWITCH DATAFILE ALL; # update control file with new filenames
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
datafile level.
Recovering Individual Data Blocks
RMAN can recover individual corrupted datafile 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 already 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.
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:
"Performing Complete Recovery of a Tablespace" on page 17-13
"Online Backups and Backup Mode" on page 7-2
See Also: Chapter 18, "Performing Block Media Recovery"
Part II
Part II Starting and Configuring RMAN
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"
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
Flash 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 of the 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 could 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 graphic
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. A recovery catalog is required when you use RMAN
in a Data Guard environment.
Note: A logical standby database is treated as a separate database by RMAN
because it has 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.
flash 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 and RMAN manage the files in the flash 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
writes it to the output device. See "Basic Concepts of RMAN Performance Tuning" on
page 21-1 for a low-level description of how channels work.
See Also: Oracle Database Net Services Administrator's Guide to learn
about Oracle Net
Recovery
Catalog
Duplicate
or
Standby
Database
Target
Database
Control
File
Tape Drive
Recovery
Catalog
Schema
RMAN
Executable
Auxiliary
Instance
Media
Management
Subsystem
Tape Drive
Media
Management
Subsystem
Flash
Recovery
Area
Enterprise
Manager
RMAN Channels
3-4 Backup and Recovery User's Guide
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 datafile. 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 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
commands, RMAN allocates all necessary channels for the device types required to
execute the command. RMAN determines the names for automatic channels.
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
You also have the option of manually allocating 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 will read from or write to this device in parallel while
carrying out the command. In parallelism, the backup of the files is performed by
more than one channel. Each channel may back up more than one file, 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 a 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 datafile 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-12
Media Management
3-6 Backup and Recovery User's Guide
Media Management
Oracle's 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 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 use with the media manager, which will be applied for
all backup and recovery tasks that use the media manager where you do not explicitly
allocate 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 needs to 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 datafiles and the backup devices. Such products may
use technologies such as high-speed connections between storage and media
subsystems to reduce 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 11, "Maintaining RMAN Backups and
Repository Records" and Chapter 12, "Managing a Recovery
Catalog"
See Also: "Configuring SBT Channels for Use with a Media
Manager" on page 5-12
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 Partner Program, 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, you can 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 Web site at:
http://www.oracle.com/technology/deploy/availability
Note that 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.
Flash Recovery Area
The component that creates 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 flash recovery area
(also simply called the recovery area), which automates management of
backup-related files.
A flash 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 flash 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 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 needs to
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 means of the DB_
UNIQUE_NAME parameter in the initialization parameter file. The DB_UNIQUE_NAME
must be unique across all the databases with the same DBID for RMAN to work
correctly in a Data Guard environment.
RMAN Configuration in a Data Guard Environment
To simplify ongoing use of RMAN for backup and recovery, you can set a number of
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 Flash Recovery Area" on page 5-13 to
learn about the flash 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 filenames for all database files in a Data Guard
environment. The catalog also records where the online redo log files, standby redo log
files, tempfiles, 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 behave 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 filenames 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 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 it is 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 SITE_KEY
See Also: "Configuring RMAN in a Data Guard Environment" on
page 5-35
Note: Backups of logical standby databases are not usable at the
primary database.
RMAN in a Data Guard Environment
Recovery Manager Architecture 3-9
column. By default, RMAN associates files whose SITE_KEY is null with the
database to which it is 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 datafile 1 on prod to
/prmhost/disk1/df1.dbf on the production host and also to tape. RMAN backs
up datafile 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 FTP a backup from a standby host to a primary host or
vice versa, connect as TARGET to the database on this host, and then
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 11-2
Chapter 12, "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
Setting Globalization Support Environment Variables for RMAN
Entering RMAN Commands
Making Database Connections with RMAN
Using the RMAN Pipe Interface
Starting and Exiting RMAN
The RMAN executable is automatically installed with the database and is typically
located in the same directory as the other database executables. For example, the
RMAN client on Linux is located in $ORACLE_HOME/bin. You have the following
basic options for starting RMAN:
Start the RMAN executable at the operating system command line without
specifying any connection options, as in the following example:
% rman
Start the RMAN executable at the operating system command line while
connecting to a target database and, possibly, a recovery catalog, as in the
following examples:
% rman TARGET / # operating system authentication
% rman TARGET SYS@prod NOCATALOG # RMAN prompts for SYS password
% rman TARGET / CATALOG rco@catdb # RMAN prompts for rco password
To quit RMAN and terminate the program, enter EXIT or QUIT at the RMAN prompt:
RMAN> EXIT
Note: Most RMAN commands require that RMAN connect to at least
a target database to perform useful work. See "Making Database
Connections with RMAN" on page 4-7 for more details on connecting
RMAN to different types of databases.