Oracle® Database
Recovery Manager Reference
10g Release 1 (10.1)
Part No. B10770-02
June 2004
Oracle Database Recovery Manager Reference 10g Release 1 (10.1)
Part No. B10770-02
Copyright © 1996, 2004, Oracle. All rights reserved.
Primary Author: Antonio Romero
Contributing Author: Lance Ashdown
Contributors: Anand Beldalker, Tammy Bednar, Senad Dizdar, Muthu Olagappan, Francisco Sanchez,
Steve Wertheimer
Graphic Designer: Valarie Moore
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
ALLOCATE CHANNEL FOR MAINTENANCE........................................................................ 2-12
allocOperandList............................................................................................................................... 2-15
ALTER DATABASE.......................................................................................................................... 2-19
archivelogRecordSpecifier .............................................................................................................. 2-22
BACKUP............................................................................................................................................. 2-28
BLOCKRECOVER............................................................................................................................ 2-62
CATALOG .......................................................................................................................................... 2-67
CHANGE............................................................................................................................................ 2-71
cmdLine .............................................................................................................................................. 2-75
completedTimeSpec ......................................................................................................................... 2-80
CONFIGURE ..................................................................................................................................... 2-82
iv
CONNECT........................................................................................................................................ 2-100
connectStringSpec........................................................................................................................... 2-103
CONVERT........................................................................................................................................ 2-105
CREATE CATALOG ....................................................................................................................... 2-113
CREATE SCRIPT............................................................................................................................. 2-115
CROSSCHECK................................................................................................................................ 2-118
datafileSpec ...................................................................................................................................... 2-121
DELETE............................................................................................................................................. 2-123
DELETE SCRIPT............................................................................................................................. 2-127
deviceSpecifier................................................................................................................................. 2-129
DROP CATALOG ........................................................................................................................... 2-131
DROP DATABASE ......................................................................................................................... 2-133
DUPLICATE..................................................................................................................................... 2-135
EXECUTE SCRIPT.......................................................................................................................... 2-145
EXIT ................................................................................................................................................... 2-147
fileNameConversionSpec.............................................................................................................. 2-148
FLASHBACK ................................................................................................................................... 2-151
formatSpec........................................................................................................................................ 2-156
untilClause....................................................................................................................................... 2-282
UPGRADE CATALOG .................................................................................................................. 2-285
VALIDATE ....................................................................................................................................... 2-287
3 Recovery Catalog Views
Summary of RMAN Recovery Catalog Views .............................................................................. 3-2
RC_ARCHIVED_LOG....................................................................................................................... 3-4
RC_BACKUP_CONTROLFILE........................................................................................................ 3-6
RC_BACKUP_CORRUPTION......................................................................................................... 3-8
RC_BACKUP_DATAFILE............................................................................................................... 3-10
RC_BACKUP_FILES........................................................................................................................ 3-12
RC_BACKUP_PIECE ....................................................................................................................... 3-15
RC_BACKUP_REDOLOG .............................................................................................................. 3-17
RC_BACKUP_SET............................................................................................................................ 3-19
RC_BACKUP_SPFILE...................................................................................................................... 3-21
RC_CHECKPOINT........................................................................................................................... 3-22
RC_CONTROLFILE_COPY............................................................................................................ 3-23
RC_COPY_CORRUPTION............................................................................................................. 3-25
RC_DATABASE ................................................................................................................................ 3-26
RC_DATABASE_BLOCK_CORRUPTION ................................................................................. 3-27
RC_DATABASE_INCARNATION................................................................................................ 3-28
RC_DATAFILE .................................................................................................................................. 3-29
RC_DATAFILE_COPY..................................................................................................................... 3-31
vi
RC_LOG_HISTORY......................................................................................................................... 3-33
RC_OFFLINE_RANGE.................................................................................................................... 3-34
RC_PROXY_ARCHIVEDLOG....................................................................................................... 3-35
RC_PROXY_CONTROLFILE ......................................................................................................... 3-37
RC_PROXY_DATAFILE................................................................................................................... 3-39
RC_REDO_LOG................................................................................................................................ 3-41
RC_REDO_THREAD....................................................................................................................... 3-42
send comments to us in the following ways:
■
Electronic mail:
■
FAX: (650) 506-7227 Attn: Server Technologies Documentation Manager
■
Postal service:
Oracle Corporation
Server Technologies Documentation
500 Oracle Parkway, Mailstop 4op11
Redwood Shores, CA 94065
USA
If you would like a reply, please give your name, address, telephone number, and electronic mail
address (optional).
If you have problems with the software, please contact your local Oracle Support Services.
viii
ix
Preface
This preface contains these topics:
■
Audience
■
Organization
■
Related Documentation
■
Conventions
■
Documentation Accessibility
x
database, recovery catalog database, and recovery catalog schema.
xi
Related Documentation
For more information, see these Oracle resources:
■
Oracle Database Backup and Recovery Basics
■
Oracle Database Utilities
■
/>Many of the examples in this book use the sample schemas of the seed database,
which is installed by default when you install Oracle. Refer to Oracle Database
Sample Schemas for information on how these schemas were created and how you
can use them yourself.
Printed documentation is available for sale in the Oracle Store at
/>To download free release notes, installation documentation, white papers, or other
collateral, please visit the Oracle Technology Network (OTN). You must register
online before using OTN; registration is free and can be done at
/>If you already have a username and password for OTN, then you can go directly to
the documentation section of the OTN Web site at
/>Conventions
This section describes the conventions used in the text and code examples of this
documentation set. It describes:
■
Conventions in Text
■
Conventions in Code Examples
Conventions in Text
We use various conventions in text to help you more quickly identify special terms.
The following table describes those conventions and provides examples of their use.
xii
You can back up the database by using the
BACKUP command.
Query the TABLE_NAME column in the USER_
TABLES data dictionary view.
Use the DBMS_STATS.GENERATE_STATS
procedure.
lowercase
monospace
(fixed-width)
font
Lowercase monospace typeface indicates
executables, filenames, directory names,
and sample user-supplied elements. Such
elements include computer and database
names, net service names, and connect
identifiers, as well as user-supplied
database objects and structures, column
names, packages and classes, usernames
and roles, program units, and parameter
values.
Note: Some programmatic elements use a
mixture of UPPERCASE and lowercase.
Enter these elements as shown.
Enter sqlplus to open SQL*Plus.
The password is specified in the orapwd file.
Back up the datafiles and control files in the
/disk1/oracle/dbs directory.
The department_id, department_name,
and location_id columns are in the
hr.departments table.
A vertical bar represents a choice of two
or more options within brackets or braces.
Enter one of the options. Do not enter the
vertical bar.
{ENABLE | DISABLE}
[COMPRESS | NOCOMPRESS]
...
Horizontal ellipsis points indicate either:
■
That we have omitted parts of the
code that are not directly related to
the example
■
That you can repeat a portion of the
code
CREATE TABLE ... AS subquery;
SELECT col1, col2, ... , coln FROM
employees;
.
.
.
Vertical ellipsis points indicate that we
have omitted several lines of code not
directly related to the example.
SQL> SELECT NAME FROM V$DATAFILE;
NAME
------------------------------------
/fsl/dbs/tbs_01.dbf
/fs1/dbs/tbs_02.dbf
.
otherwise empty line; however, JAWS 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
UPPERCASE
Uppercase typeface indicates elements
supplied by the system. We show these
terms in uppercase in order to distinguish
them from terms you define. Unless terms
appear in brackets, enter them in the
order and with the spelling shown.
However, because these terms are not
case sensitive, you can enter them in
lowercase.
SELECT last_name, employee_id FROM
employees;
SELECT * FROM USER_TABLES;
DROP TABLE hr.employees;
lowercase
Lowercase typeface indicates
programmatic elements that you supply.
For example, lowercase indicates names
of tables, columns, or files.
Note: Some programmatic elements use a
mixture of UPPERCASE and lowercase.
Enter these elements as shown.
SELECT last_name, employee_id FROM
employees;
sqlplus hr/hr
■
lowercase monospace : Calls attention to variable text in RMAN examples.
■
italics : Calls attention to RMAN or SQL placeholders, that is, text that
should not be entered as-is but represents a value to be entered by the user.
RMAN Syntax Diagrams and Notation
This section describes the conventions for RMAN command syntax.
Syntax Diagrams
This reference uses syntax diagrams to show Recovery Manager commands. These
syntax diagrams use lines and arrows to show syntactic structure, as shown in
Figure 1–1.
Conventions Used in this Reference
About RMAN Commands 1-3
Figure 1–1 CATALOG Command
catalog::=
This section describes the components of syntax diagrams and gives examples of
how to write RMAN commands. Syntax diagrams are made up of these items:
■
Keywords
■
Placeholders
Keywords Keywords have special meanings in Recovery Manager syntax. In the
syntax diagrams, keywords appear in rectangular boxes and an uppercase font, like
the word CATALOG in Figure 1–1. When used in text and code examples, RMAN
keywords appear in uppercase, monospace font, for example, CATALOG
DATAFILECOPY. You must use keywords in RMAN statements exactly as they
appear in the syntax diagram, except that they can be either uppercase or lowercase.
The RMAN language is free-form. Keywords must be separated by at least one
white space character, but otherwise there are no restrictions. A command can span
multiple lines.
DUPLICATE TARGET DATABASE TO ’database_name’ command, use the name
of the duplicate database you want to create, such as dupdb, in place of the
database_name placeholder in the diagram.
Some placeholder values are enclosed in required or optional quotes. The syntax
diagrams show single quotes, though in all cases double quotes are also legal in
RMAN syntax. For example, you specify either 'filename' or "filename". For
the SQL command, it is recommended that you use double quotes because the SQL
statement itself may also contain a quote, and the most common type of quote in a
SQL statement is a single quote. Single and double quotes do not mean the same in
SQL as they do in RMAN.
The only system-independent, legal environment variables in RMAN quoted
strings are ? for the Oracle home and @ for the SID. However, you can use operating
system specific environment variables on the target system within quoted strings.
The environment variables are interpreted by the database server and not the
RMAN client.
The following table shows placeholders that appear in the syntax diagrams and
provides examples of the values you might substitute for them in your statements.
RMAN Reserved Words
This section describes the RMAN reserved words. If you use one of these words by
itself without surrounding it in quotes, then RMAN generates an error. These are
examples of correct and incorrect entries:
Placeholder Description Examples
Quoted strings such as
'filename',
'tablespace_name',
'channel_name',
'channel_parms'
A string of characters
contained in either single or
double quotes. A quoted
Word
ABORT CONSISTENT FORMAT MAXPIECESIZE PLSQL SETLIMIT
AFFINITY CONTROLFILE FROM MAXSEQ PLUS SETSIZE
AFTER CONTROLFILECOPY FULL MAXSETSIZE POLICY SHOW
ALL COPIES G MAXSIZE POOL SHUTDOWN
ALLOCATE COPY GET MISC PRINT SINCE
ALTER CORRUPTION GROUP MOUNT PROXY SIZE
AND CREATE HIGH MSGLOG PUT SKIP
APPEND CROSSCHECK HOST MSGNO QUIT SLAXDEBUG
ARCHIVELOG CUMULATIVE ID NAME RATE SNAPSHOT
AT CURRENT IDENTIFIER NEED RCVCAT SPFILE
ATALL DATABASE IMMEDIATE NEW RCVMAN SPOOL
AUTOBACKUP DATAFILE INACCESSIBLE NEW-LINE READONLY SQL
AUTOLOCATE DATAFILECOPY INCARNATION NEWNAME READRATE STANDBY
AUXILIARY DAYS INCLUDE NOCATALOG RECOVER STARTUP
AUXNAME DBA INCREMENTAL NOCFAU RECOVERABLE STEP
AVAILABLE DBID INPUT NOCHECKSUM RECOVERY SUMMARY
BACKED DEBUG IO NOEXCLUDE REDUNDANCY SWITCH
BACKUP DEFAULT JOB NOFILENAMECHECK REGISTER TABLESPACE
BACKUPPIECE DEFINE K NOFILEUPDATE RELEASE TAG
BACKUPSET DELETE KBYTES NOKEEP RELOAD TARGET
BEFORE DESTINATION KEEP NOLOGS REMOVE TEST
BETWEEN DEVICE LEVEL NOMOUNT RENORMALIZE THREAD
BLOCK DISK LIBNAME NONE REPLACE TIME
BLOCKRECOVER DISKRATIO LIBPARM NOPROMPT REPLICATE TIMEOUT
Conventions Used in this Reference
1-6 Recovery Manager Reference
RMAN Code Examples
This reference contains many examples of RMAN commands. These examples show
you how to use elements of RMAN. This example shows the use of a BACKUP
About RMAN Commands 1-7
RMAN Command Entries
The description of each command or subclause contains the following sections:
Note: Optional sections following the examples provide more information on how
and when to use the statement.
Table 1–1
Section Content
Syntax Shows the keywords and parameters that make up the
statement. Note: Not all keywords and parameters are
valid in all circumstances. Be sure to refer to the
"Keywords and Parameters" section of each statement to
learn about any restrictions on the syntax.
Purpose Describes the basic uses of the statement.
Restrictions and Usage
Notes
Lists requirements, restrictions, and guidelines for
proper use of the command.
Keywords and
Parameters
Describes the purpose of each keyword and parameter.
Restrictions and usage notes can also appear in this
section.
Examples Shows how to use various clauses and options of the
statement.
RMAN Command Entries
1-8 Recovery Manager Reference
RMAN Commands 2-1
2
RMAN Commands
This chapter describes, in alphabetical order, Recovery Manager commands and