link rel="Copyright" href="../../dcommon/html/cpyr.htm" title="Copyright" type="text/html">
| Oracle® Database Recovery Manager Quick Start Guide 10 g Release 1 (10.1) Part Number B10769-01 |
|
| View PDF |
Recovery Manager Quick Start Guide
< p>10g Release 1 (1 0.1)December 2003
Par t No. B10769-01
Recovery Manager Quick Start Guide has three purposes:
This document is organized into the following sections:
The following table shows the syntax co nvention used in this manual.
Besides this quick start guide, there are three volumes in the backup and recovery documentation set.
Installed with the database, Recovery Manager (RMAN) is an Oracle database client which performs backup and recovery tasks on your databases and automates administration of your backup strategies. It greatly simplifies backing up, restoring, and recovering da tabase 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:
Some environments will also use these optional components:
The target database is the database that you are backing up, restoring, or recovering with RMAN.
RMAN is a command-line-oriented database client, much like SQL*Plus, with its own co mmand syntax. From the RMAN client you can issue RMAN commands and SQL statements to perform and report on backup and recovery operat ions.
RMAN can take interactive input or read input from plain text files (called command files). RMAN then communicates with one or more server processes on the target database server which actu ally perform the work. You can also access RMAN through the Enterprise Manager; for details see Oracle Enterprise Manager Administrator's Guide.
The RMAN executable is typically installed in the same d
irectory as the other database executables. On Unix systems, for example, the RMAN executable is located in $ORACLE_HOME/bin.
RMAN maintains metadata about the target database and its backup and recovery operations in the LIST, REPORT, and
RMAN repository data is always s
tored in the control file of the target database. The CONTROL_FILE_RECORD_KEEP_TIME initialization parameter controls ho
w long backup records are kept in the control file before those records are re-used to hold information about more recent backups. Th
e repository can also be kept in a recovery catalog, a separate database that keeps historical data on
backup activities much longer than the control file and preserves backup information if the control file is lost.
The Automatic Disk-Based Backup and Recovery feature simplifies managing disk space and files related to backup and recov
ery, by managing all backup and recovery related files in a flash recovery area. You set the flash reco
very area size and location, using the DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE initialization
parameters. You also specify a retention policy that dictates when backups may be discarded. RMAN then manages your backup storage, d
eleting obsolete backups and backups already copied to tape when space is needed, but keeping as many backups on disk as space permit
s. This minimizes restores from tape during data recovery operations to shorten restore and recovery times.
In addition to RMAN repository records, the recovery catalog can also hold RMAN stored scripts, sequ ences of RMAN commands for common backup tasks. Centralized storage of scripts in the recovery catalog can be more convenient than wo rking with command files.
Except for stored scripts, all of RMAN's features work equally wel l with or without a recovery catalog. For more information on the recovery catalog see Oracle Database Backup and Recovery Advanced User's Guide.
To access sequential media devices like tape libraries, RMAN uses third-pa rty media management software. A media manager controls these devices during backup and recovery, manag ing the loading, labeling and unloading of media, among other functions. Oracle Corporation's Backup Solutions Program (BSP) works wi th vendors to help them produce media management software for their devices. For enterprises that already use media management softwa re in their enterprise, many of those software products can be directly integrated with RMAN. Contact your media management software vendor for details about whether they participate in the BSP and have an RMAN-compatible media management layer.
The RMAN client is started by issuing the rman command at the command prompt of your operating system.
RMAN must connect to a target database (with SYSDBA privileges) to perform backup and recovery tasks.
RMAN can also connect to a recovery catalog database if you are using one. Specify target and recovery catalog databases using comman
d line options or using the CONNECT command.
This command connects RMAN to a ta rget database and a recovery catalog:
% rman TARGET / CATALOG cat_usr/pwd @cat_str
Connect to a target database without using a rec overy catalog:
% rman TARGET SYS/pwd@target_str pre>Starting RMAN without connecting to a database
% rmanOnce started, RMAN displays an "
RMAN>"prompt for your commands.Synta x of Common RMAN Command-line Options
RMAN [ TARGET [=] connec tStringSpec | { CATALOG [=] connectStringSpec } | LOG [=] ['] filename ['] [ APPEND ] . . . ]... < /a>connectStringSpec::= ['] [userid] [/ [password]] [@net_service_name] [']This example appends the output from an RMAN session to a text file at
$ORACLE_HOME/dbs/log/msglo g.log% rman TARGET / LOG $ORACLE_HOME/dbs/log/msglog.log APPENDTo quit the RMAN client, type
EXITat the RMAN prompt:RMAN> EXITConfiguring Persistent Settings for the RMAN Environment
You can configure persistent settings in the RMAN environment, which apply to all subsequent operations, even if you exit and restart RMAN.
Configuring Disk Devices and Channels
RMAN channels are connections to server sessions on the target database, which are used to perform all backup, restore and recovery operations. By default, RMAN alloc ates one disk channel for all operations. You can configure dditional channels for use with disks and with other media.
By default, RMAN sends all backups to disk. If a flash recovery area is configured, it is the default des tination; otherwise the default directory is platform-dependent. If, as recommended, you use the flash recovery area as the destinati on for all disk backups, you would set up a flash recovery area and use the following
CONFIGUREcommand:RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT CLEAR;a>The following command configures RMAN to write disk backups to the
/tmpdirectory:RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/tmp/%U';The format specifier
%Uis replaced with unique filenames for the files when you take backups. Refer to Oracle Database Backup and Recovery Advanced User 's Guide. for more details on configuring destinations for your disk backups.
Configuring Tape Devices and Channels After c onfiguring your media management software, you can make the media manager the default destination for RMAN backups:
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO sbt;Some media managers require a
PARMSstring to configure device settings:R MAN> CONFIGURE CHANNEL DEVICE TYPE sbt PARMS='ENV=mml_env_settings';Multiple channels can be configured to run backups in parallel. This command configures two
sbt channels for use in RMAN jobs:RMAN> CONFIGURE DEVICE TYPE sbt PARALLELISM 2;Configuring a Retention Policy
Retention policy governs how long backup files are retained. Retention policy can be set in terms of a r ecovery window (how far into the past you need to be able to recover your database), or a redundancy value (how many backups of each file must be retained).
This command ensures that RMAN retains all backups needed to recover the database to any point in time in the last 7 days:
RMAN> CONFIGURE RETENTION POLICY T O RECOVERY WINDOW OF 7 DAYS;This command ensures that RMAN retains three backups of each datafile:
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 3;Use
DELETEOBSOLETEto immediately delete backu ps no longer required by the retention policy. (For backups stored in a flash recovery area, you do not need to perform this step. Th e database automatically deletes obsolete files and files already backed up to tape when space is needed.) You can use theKEEPoption of theBACKUPandCHANGEcommands to override the configured retention policy for individual backups-- for example, to force the retention of a specific backup.Configuring Control File Autobackups
This command configures RM AN to back up the control file after each backup or copy:
RMAN> CONFIGURE CONTROLFILE AUT OBACKUP ON;By default, RMAN automatically names control file autob ackups and stores them in the flash recovery area. The following command configures RMAN to write control file autobackups to the
/mybackupdir directory: RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/mybackupdir/cf%F';The %F element of the format string combines the DBID, day, month, year, and sequence number to generate a unique filename. %F is r equired for control file autobackups.
Restoring Default Values for Configured Settings
Reset any
CONFIGUREsetting to i ts default by running the command with theCLEARoption, as shown here:RMAN> ; CONFIGURE CHANNEL DEVICE TYPE sbt CLEAR; RMAN> CONFIGURE RETENTION POLICY CLEAR; RMAN& gt; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;Viewing Current Settings
This command shows all configur able settings:
RMAN> SHOW ALL;The output lists the
CONFIGUREcommands to recreate this configuration.Backing Up Database Files
Use the
BACKUPcommand to back up files. You will usually configure default devices and channels in advance;BACKUPback s up your data to the configured default device and channels for the type of backup requested.If you specify
BACKUPASCOPY, then RMAN copies the files as i mage copies, bit-for-bit copies of database files that can only be created on disk.This command creates image copy backups of all datafiles in the database:
RMAN> BACKUP A S COPY DATABASE;If you specify
BACKUPASBACKUPSET, then RMAN stores its backups in backup sets. A backup set consists of one or more backup pieces, physical files containing the data. A backup set usually contains on ly one backup piece. Only RMAN can create and restore backup sets. The following command creates a backup of the database and archive d logs on tape, in backup set format, using the configured channels:RMAN> BACKUP DEVICE TYPE sbt DATABASE PLUS ARCHIVELOG;Backing Up Individual Files
You can back up individual tablespaces, database files, server par ameter files, and backup sets with various options, as in these examples:
RMAN> BACKUP AR CHIVELOG COMPLETION TIME BETWEEN 'SYSDATE-31' AND 'SYSDATE-7'; RMAN> BACKUP TAB LESPACE system, users, tools; RMAN> BACKUP AS BACKUPSET DATAFILE 'ORACLE_HOME/oradata/trgt/users01.dbf', 'ORACLE_HOME/oradata/trgt/too ls01.dbf'; RMAN> BACKUP CURRENT CONTROLFILE TO '/backup/curr_cf.copy'; RMAN> BACKUP S PFILE; RMAN> BACKUP BACKUPSET ALL;Note tha t in the above examples you should enter the path to your Oracle home in place of "ORACLE_HOME".
Backup Options
Here are some often-used
BACKUPcommand options:
| Example | Explanation | |
|---|---|---|
|
|
|
<
/a>
Specifies a location and name for backup pieces and copies. You must use substitution variables to generate unique filenames. |
|
< code>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. |
The following BACKUP commands illustrate these options:
RMAN> BACKUP FO RMAT='AL_%d/%t/%s/%p' ARCHIVELOG LIKE '%arc_dest%'; RMAN> BACKUP TAG 'weekly_full_db_bkup' DATABASE MAXSETSIZ E 10M; RMAN> BACKUP COPIES 2 DEVICE TYPE sbt BACKUPSET ALL;
If you specify BACK
UP INCREMENTAL, RMAN will create incremental backups of your database. Incremental
backups capture on a block-by-block basis changes in your database since a previous incremental backup. The starting point for an inc
remental backup strategy is a level 0 incremental backup, which backs up all blocks in the database. Level 1 incremental backups, taken at regular intervals, contain only changed blocks since a previous inc
remental backup. These can be cumulative (including all blocks changed since the most recent level 0 ba
ckup) or differential (including only blocks changed since the most recent incremental backup, whether
it is level 0 or level 1).
Incremental backups are generally smaller and faster to create th an full database backups. Recovery from an incremental backup is faster than recovery using redo logs alone. During a restore from in cremental backup, the level 0 backup is used as the starting point, then changed blocks are updated based on level 1 backups where po ssible to avoid re-applying changes from redo one at a time. Recovering with incremental backups requires no additional effort on you r part. If incremental backups are available, RMAN will use them during recovery.
RMAN's
See Oracle Database Backup and Recovery Basics for more details and examples for incremental backups and incrementally updated backups.
You can run a test RMAN backup that does not generate any output. Validation confirms that a backup could be run, by confirming that all database files exist, are in their co rrect location, and are free of physical and logical corruption. For example:
RMAN> BACKU P VALIDATE DATABASE ARCHIVELOG ALL;
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. Recovery is the application of changes from redo logs and incremental backups to a restored datafile, to bring
the datafile to a desired SCN or point in time.
Use the RESTORE DATABASE an
d RECOVER DATABASE commands on the whole database. For example:
RM AN> STARTUP FORCE MOUNT; RMAN> RESTORE DATABASE; RMAN> RECOVER DATABASE; RMAN> ALTER DATABASE OPEN;
Note that the database mu st not be open when restoring or recovering the entire database.
Use the RESTORE T
ABLESPACE and RECOVER TABLESPACE commands on individual tablespaces when the database is open. Take
the tablespace that needs recovery offline, restore and then recover the tablespace, and bring the recovered tablespace online. The f
ollowing steps recover the users tablespace:
RMAN> SQL 'ALTER TABLESPACE use rs OFFLINE'; RMAN> RESTORE TABLESPACE users; RMAN> RECOVER TABLESPACE users; RMAN> SQL 'ALTER TABLESPACE users ONLINE';
Use the RESTORE DATAFI
LE and RECOVER DATAFILE commands on individual current datafiles when the database is open. Take the
datafile that needs recovery offline, restore and recover the datafile, and bring the datafile online. For example, to restore and r
ecover datafile 7:
RMAN> SQL 'ALTER DATABASE DATAFILE 7 OFFLINE'; RMAN> RESTORE DATAFILE 7; RMAN> RECOVER DATAFILE 7; RMAN> SQL ' ALTER DATABASE DATAFILE 7 ONLINE';
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. Co
rruption is usually reported in alert logs, trace files or results of SQL queries. Use BLOCKRECOVER to repair all corrup
ted blocks:
RMAN> BLOCKRECOVER CORRUPTION LIST;
You can also recover individual blocks, as shown in this example:
R MAN> BLOCKRECOVER DATAFILE 7 BLOCK 233, 235 DATAFILE 4 BLOCK 101;
You can run a RESTORE... VALIDATE<
/code> operation to confirm that a restore operation can be performed successfully. RMAN decides which backup sets, datafile copies,
and archived logs are needed for the operation, and scans them to verify that they are usable. For example:
RMAN> RESTORE DATABASE VALIDATE;
The RMAN LIST and REPORT commands, generate reports on backup activities based on the RMAN repository. Use SHOW ALL to display th
e current RMAN configuration. You can also query the views described in "Backup and Recovery Views".
Run the LIST BACKUP and LIST COPY comm
ands to display information about backups and datafile copies listed in the repository. You can display specific objects, as in the f
ollowing examples:
RMAN> LIST BACKUP OF DATABASE; RMAN> LIST COPY OF DATAFILE 1, 2, 3; RMAN> LIST BACKUP OF ARCHIVELOG FROM SEQUENCE 1437; RMAN> LIST CONTROLFILECOPY "/tmp/cf.cpy"; RMAN> LIST BACKUPSET OF DATAFILE 1;
For backups, you can control the format of LIST output with these options:
For both backups and copies you have the following additional options:
The REPORT command performs more complex analysis than LIST. Some of the mai
n options are:
Status information for jobs in progress and completed jobs is stored
in V$RMAN_STATUS. V$RMAN_OUTPUT contains the text ouptut of all RMAN jobs.
To see status information on jobs in V$RMAN_STATUS use the following query:
SELECT OPERATION, STATUS, MBYTES_PROCESSED, START_TIME, END_TIME from V$RMAN_STATUS;
To correlate a channel with a process, run the following query in SQL*Plus while the RM AN job is executing:
SQL> COLUMN CLIENT_INFO FORMAT a30 SQL> COLU MN SID FORMAT 999 SQL> COLUMN SPID FORMAT 9999 SQL> SELECT s.SI D, p.SPID, s.CLIENT_INFO FROM V$PROCESS p, V$SESSION s WHERE p.ADDR = s.PADDR < a name="766764"> AND CLIENT_INFO LIKE 'rman%';
To calculat e the progress of an RMAN job, run the following query in SQL*Plus while the RMAN job is executing:
SQL> SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK, ROUND(SOFAR/TOTALWORK*100,2) "% COMPLETE" FROM V$SESSION_LONGOPS WHERE OPNAME LIKE 'RMAN%' AND OPNAME NOT LIKE '%aggr egate%' AND TOTALWORK != 0 AND SOFAR <> TOTALWORK;
RMAN repositor y metadata is always stored in the control file of the target database. You can also create a recovery catalog in a separate database , and RMAN will record its metadata there as well.
If you do not use a recovery catalog, then eventu ally RMAN control file records are overwritten. Set this initialization parameter in the parameter file of the target database to det ermine how long records are kept:
CONTROL_FILE_RECORD_KEEP_TIME = number_ of_days_to_keep
The CROSSCHECK command checks whether RMAN backups and copies in the rep
ository can still be accessed. Assuming that you have configured automatic channels, you can run these commands:
RMAN> CROSSCHECK BACKUP; # checks RMAN backups on configured devices RMAN> CROSSCHECK COPY; # checks RMAN image copies on configured devices
If backups
are stored with a media manager and sbt channels are not configured, then you must allocate a maintenance channel before
CROSSCHECK and DELETE commands on sbt objects:
RMAN& gt; ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE sbt;
The DELETE command removes RMAN ba
ckups and copies from DISK and sbt devices, marks the objects as DELETED in the control file,
and removes the records from the recovery catalog (if you use a catalog). For example:
RMAN& gt; DELETE BACKUPSET 101, 102, 103; RMAN> DELETE CONTROLFILECOPY '/tmp/cf.cpy'; RMAN> DELETE NOPROMPT ARCHIVELOG UNTIL SEQUENCE = 7300; RMAN> DELETE BACKUP OF SPFILE TABLESPACE users DEVICE TYPE sbt; RMAN> DELETE BACKUP OF DATABASE LIKE '/tmp%'; # pattern match RMAN> DELETE ARCH IVELOG ALL BACKED UP 2 TIMES TO DEVICE TYPE sbt;
The following opti
ons of the DELETE command are also useful:
The CATALOG command lets you register informati
on about backups in the RMAN repository, so RMAN can use it in a restore and recovery operation. A backup will not be listed in the r
epository if it was created by an operating-system level file copy, or if it is older than the CONTROL_FILE_RECORD_KEEP_TIME and is no longer listed in the RMAN repository. For example:
RMAN> CATALOG DATAFILEC OPY '/backup/users01.bak'; # catalogs datafile copy made at OS level RMAN> CATALOG LIKE '/backup' # catalogs all files in directory
The CHANGE ... CHANGE...UNCATALOG updates the repository to reflect that change. For example:
RMAN> CHANGE CONTROLFILECOPY '/tmp/cf.cpy' UNCATALOG; RMAN> CHANGE BACKUPSET 121,122,127,203,300 UNCATALOG;
While the use of configured channels and other sett ings reduces many common RMAN operations to a single command, your backup routine may include frequently-used multi-step processes. R MAN supports the use of stored scripts (discussed in Oracle Database Backup and Recovery Advanced User's Guide) and command files to help manage these recurring tasks. The RMAN RUN command provides a degree of flow-of-control in your scripts.
A command file is a client-side text file containing RMAN commands, exactly as yo
u enter them at the RMAN prompt. Execute the contents of a command file using the RMAN @ command:
RMAN> @/my_dir/my_command_file.txt # runs specified command file
Any file extension may be used. You can also launch RMAN with a command file to run, as shown here:
% rman @/my_dir/my_command_file.txt
The RUN command lets you issue a series of RMAN commands to be executed as a group. If one command
fails, the remaining commands in the block will not be executed. Note, however, that RMAN will still try to execute as many tasks rel
ated to a failed command as possible.
Here is an example of a RUN command:
RUN { BACKUP ARCHIVELOG ALL DELETE ALL INPUT; BACKUP INCREMENTAL LEVEL 0 TAG mon_bkup DATABASE; }
If backup of one or more of the archived logs fails, RMAN will still back up all archived logs that can be backed up, because t
hose tasks are all caused by the one BACKUP command. However, the BACKUP INCREMENTAL command following the
BACKUP ARCHIVELOG command is not executed.
The SET, SWITCH D
ATAFILE, and ALLOCATE CHANNEL commands, used within a RUN block, override channel configurations and other backup
parameters set with the CONFIGURE command for the duration of the RUN block. See Oracle
Database Recovery Manager Reference for details.
Use RUN blocks in command files to st op execution if one command fails.
This section gives an overview of the most common RMAN commands and t heir most commonly used options. Commands documented here include:
The following subclauses are used in the parameters to several commands:
archivelogRecordSpecifierdatafileSpecdeviceSpecifi
ermaintQualifieruntilClauseSyntax descriptions use vertical ellipses to indicate less-frequently-used parameters and options. Refer to the Oracle Database Recovery Manager Reference for complete documentation of syntax and semantics of RMAN commands.
Reads in a command file; executes each command in it in order.
@filename
This subclause specifies a range of archived redo logs .
ARCHIVELOG { ALL | LIKE 'string_pattern' | archlogRange [LIKE 'string_pattern' [THREAD [=] integer]] } { { { UNTIL TIME | FROM TIME } [=] 'date_string' | { TIME BETWEEN 'date_string' AND | FROM TIME [=] 'date_string' UNTIL TIME [=] } 'date_string' | UNTIL SCN [=] integer | SCN BETWEEN integer AND integer | FROM SCN [=] integer [UNTIL SCN [=] integer] } [THREAD [=] integer] | { UNTIL S EQUENCE [=] integer | FROM SEQUENCE [=] integer [UNTIL SEQUENCE [=] integer] | SEQUENC E [BETWEEN integer AND] integer } [THREAD [=] integer] }< a name="767000">
Backs up database files, archived logs, backups, and copies.
BACKUP [ ( (FULL | INCREMENTAL LEVEL [=] integer) | [ (FULL | INCREMENTAL LEVEL [=] integer) ] AS (COPY | BACKUPSET) | AS (COPY | BACKUPSET) (FULL | INCRE MENTAL LEVEL [=] integer) ) ] [backupOperand [backupOperand]...] ba ckupSpec [backupSpec]... [PLUS ARCHIVELOG [backupSpecOperand [backupSpecOperand]...]]; < a name="768157"> backupOperand::= { FORMAT [=] 'format_string' [, 'format_string']... | CHANNEL ['] channel_id ['] | CUMULATIVE | MAXSETSIZE [=] integer [ K | M | G ] | TAG [=] ['] tag_name ['] | keepOption | SKIP { OFFLINE | READONLY | INACCESSIBLE } | VALIDATE | NOT BACKED UP [SINCE TIME [=] 'date_string'] | COPIES [=] integer | DEVICE TYPE deviceSpecifier . . < a name="767024">. } backupSpec::= [(] { BACKUPSET { {ALL | completedTimeSpec } | primary_key) [, primary_ke y]... } | COPY OF { DATABASE | TABLESPACE ['] tablespace_ name ['] [, ['] tablespace_name [']]... | DATAFILE datafileSpec [, datafileSpec]... } | DATAFILE datafileSpec [, datafileSpec]... | DATAFILECOPY 'filename' [, ' filename']... | DATAFILECOPY FROM TAG [=] ['] tag_name ['] [, ['] tag_name [']]... | DA TAFILECOPY { ALL | LIKE 'string_pattern' } | TABLESPACE ['] tablespace_name ['] [, ['] tablespace_name [']]... | DATABASE | archivelogRecordSpecifier | CURRENT CONTROLFILE [FOR STA NDBY] | CONTROLFILECOPY 'filename' | SPFILE } [b ackupSpecOperand [backupSpecOperand]...] backupSpecOperand::= { FORM AT [=] 'format_string' [, 'format_string']... | CHANNEL ['] channel_id ['] | CUMULATIVE | MAXSETSIZE [=] integer [ K | M | G ] | TAG [=] ['] tag_name ['] | keep Option | SKIP { OFFLINE | READONLY | INACCESSIBLE } | NOT BACKED UP [ SINCE TIME [=] 'date_ string' | integer TIMES ] | DELETE [ ALL] INPUT . . . }
Updates status of a backup or copy in the RMAN repository.
CHANGE { { BACKUP | COPY } [OF listObjList] [ maintQualifier [maintQualifier]...] | archivelogRecordSpecifier | recordSp ec [DEVICE TYPE deviceSpecifier [, deviceSpecifier]...] } { AVAILABLE | UNAVAILABLE | UNCAT ALOG | keepOption } [DEVICE TYPE deviceSpecifier [, deviceSpecifier]...];
COMPLETED { AFTER [=] | BETWEEN 'date_string' AND | BEFORE [=] } 'date_string'CONFIGURE
Change persistent RMAN configuration settings.
CONFIGURE { d eviceConf | backupConf | { AUXNAME FOR DATAFILE datafileSpec | SN APSHOT CONTROLFILE NAME } { TO 'filename' | CLEAR } | cfauConf }; deviceCon::= { DEFAULT DEVICE TYPE { TO deviceSp ecifier | CLEAR } | DEVICE TYPE deviceSpecifier { PARALLELISM integer | CLEAR } | [AUXILIAR Y] CHANNEL [integer] DEVICE TYPE deviceSpecifier { allocOperandList | CLEAR } } allocOperandList::= { PARMS [=] 'channel_parms' | FORMAT [=] 'format_string' [, 'format_string']... | { MAXPIECESIZE [=] integer | RATE [=] integer } [ K | M | G ] . . . }... connectStringSpec::= ['] [userid] [/ [password]] [@net_service_name] ['] backupConf::= { RETENTION POLICY { TO { RECOVERY WINDOW OF integer DAYS | REDUND ANCY [=] integer | NONE } | CLEAR } | MAXSETSIZE { TO { integer [ K | M | G ] | UNLIMITED } | CLEAR } | { ARCHIVELOG | DATAFILE } BACKUP COPIES FOR DEVICE TYPE deviceSpecifier { TO integer | CLEAR } | BACKUP OPTIMIZATION { ON | OFF | CLEAR } | EXCLUDE FOR TABLESPACE tablespace_name [CLEAR] } cfauConf::== CONTROLFILE AUTOBACKUP { ON | OFF | CLEAR | FORMAT FOR DEVICE TYPE deviceSpecifier { TO 'format string' | CLEAR } }CROSSCHECK
Checks whether backup pieces, proxy copies, and disk copies still exist.
CROSSCHECK { { BACKUP [OF listObjList] | COPY [OF listObjLis t] | archivelogRecordSpecifier } [maintQualifier [maintQualifier]...] | recordSpec [DEVICE TYPE deviceSpecifier [, deviceSpecifier]...] }; listObjList::= [ DATAFILE datafileSpec [, datafileSpec]... | TABLESPACE ['] tablesp ace_name ['] [, ['] tablespace_name [']]... | archivelogRecordSpecifier | DATABASE [SKIP TABLESPACE ['] tablespace_name ['] [, ['] tablespace_ name [']]...] | CONTROLFILE | SPFILE ]... recordSpec::= { { BACKUPPIECE | PROXY } < a name="769180"> { 'media_handle' [, 'media_handle']... | primary_key [, primary_key]... | TAG [=] ['] tag_name ['] } | BACKUPSET primary_key [, primary_key]... | { CONTROLFILECOPY | DATAFILECOPY } { { primary_key [, primary_key]... | 'filename' [, 'filename']... } | TAG [=] ['] tag_name ['] [, ['] tag_name [']]... } | ARCHIVELOG { primary_key [, primary_key]... | 'filename' [, 'filename']... } }< font face="Arial, Helvetica, sans-serif">datafileSpec
datafileSpec::= { 'filename'| integer }DELETE< /h5>
Deletes backups and copies from disk or tape media, and updates the RMAN repository accordi ngly.
DELETE [FORCE] [NOPROMPT] { [EXPIRED] { { BACKUP [OF listObjList] | COPY [OF listObjList] | ar chivelogRecordSpecifier } [maintQualifier [maintQualifier]...] | recordSpec [DEVICE T YPE deviceSpecifier [, deviceSpecifier]...] } | OBSOLETE [obsOperandList] [DEVICE TYPE (deviceSpecifier [, deviceSpecifier]...] }; obs OperandList::= [ REDUNDANCY [=] integer | RECOVERY WINDOW OF integer DAYS | ORPHAN ]...deviceSpecifier
devi ceSpecifier::= { DISK | ['] media_device ['] }LIST
Lists the backups and copies recorded in the repository.
LIST { INCARNATION [OF DATABASE [['] database_name [']]] | [EXPIRED] { listObjectSpec [ maintQualifier | RECOVERABLE [untilClause] ]... | recordSpec } }; a>listObjectSpec::= { BACKUP [OF listObjList] [listBackupOption] | COPY [OF listObjList] | archivelogRecordSpecifier } listObjectList::= [ DATAFILE datafileSpec [, datafileSpec]... | TABLESPACE ['] tablespace_name ['] [, ['] tabl espace_name [']]... | archivelogRecordSpecifier | DATABASE [SKIP TABLESPACE ['] tablespac e_name ['] [, ['] tablespace_name [']]...] | CONTROLFILE | SPFILE ]... listBackupOption::= [ [BY BACKUP] [VERBOSE] | SUMMARY | BY { BACKUP SUMMARY | FILE } ]< /a>maintQualifier
{ TAG [ =] ['] tag_name ['] | completedTimeSpec | LIKE 'string_pattern' | DEVI CE TYPE deviceSpecifier [, deviceSpecifier]... | BACKED UP integer TIMES TO DEVICE TYPE deviceSpecifier }RECOVER
Performs media recovery from RMAN backups and copies.
RECOVER [DE VICE TYPE deviceSpecifier [, deviceSpecifier]...] recoverObject [recoverOptionList]; recoverObject::= { DATABASE [ untilClause | [unt ilClause] SKIP [FOREVER] TABLESPACE ['] tablespace_name ['] [, ['] tablespace_name [']]... ] | TABLESPACE ['] tablespace_name ['] [, ['] tablespace_name [']]... | DATAFILE dat afileSpec [, datafileSpec]... } recoverOptionList::= { DELETE ARCHIVELOG [MAXSIZE {integer [K | M | G]}] | CHECK READONLY | NOREDO | { FROM TAG | ARCHIVELOG TAG } [=] ['] tag_name ['] . . a>. }...REPORT h5>
Reports backup status of your database: which files are in the database, which files need ba ckups, and which backups are obsolete or unrecoverable.
REPORT { { NEE D BACKUP [ { INCREMENTAL | DAYS } [=] integer | REDUNDANCY [=] integer | RECOVERY WINDOW OF integer DAYS) ] | UNRECOVERABLE } reportObject | SCHEMA [atClause] | OBSO LETE [obsOperandList] } [ DEVICE TYPE deviceSpecifier [,deviceSpecifier]... ] reportObject::= [ DATAFILE datafileSpec [, datafileSpec]... | TABLESPACE ['] tablespace_name ['] [, ['] tablespace_name [']]... | DATABASE [SKIP TABLESPACE ['] tablespace _name ['] [, ['] tablespace_ name [']]...] ] atClause::= { AT TIME [=] 'date_string' | AT SCN [=] integer | AT SEQUENCE [=] integer THREAD [=] integer } obsOperandList::= [ REDUNDANCY [= ] integer | RECOVERY WINDOW OF integer DAYS | ORPHAN ]...RESTORE
Restores RMAN backups and copies.
RESTORE [(] restoreObject [(restoreSpecOperand [restoreSpecOperand]...] [)]... [ CHANNEL ['] channel_id ['] | PARMS [=] 'channel_parms' | FROM { BACKUPSET | DATAFILECO PY } | untilClause | FROM TAG [=] ['] tag_name ['] | VALIDATE | DEVICE TYPE deviceSpecifier [, deviceSpecifier]... . . . ]...; restoreObject::= { CONTROLFILE [TO 'filename'] | DATABASE [SKIP [FOREVER] TABLESPACE ['] tablespac e_name ['] [, ['] tablespace_name [']]... ] | DATAFILE datafileSpec [, datafileSpec]... < a name="769242">| TABLESPACE ['] tablespace_name ['] [, ['] tablespace_name [']]... | archivelogRecordSpecif ier | SPFILE [TO [PFILE] 'filename'] } restoreSp ecOperand::= { CHANNEL ['] channel_id ['] | FROM TAG [=] ['] tag_name ['] | PARMS [=] 'channel_parms' | FROM { AUTOBACKUP [{ MAXSEQ | MAXDAYS } [=] integer)]... | 'media_handle' } }RUN
Some RM AN commands are only valid inside a RUN block.
RUN { ... }SET
Creates settings that apply only to the current RMAN session.
SET { set_ rman_option [;] | set_run_option; } set_rman_option::= { ECHO { ON | OFF } | DBID [=] integer | CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE deviceSpecifier TO 'frmt_string' set_run_option::= { NEWNAME FOR DATAFILE datafileSpec TO { 'filename' | NEW } | ARCHIVELOG DESTINATION TO 'log_archive_dest' | untilClause | COMMAND ID TO 'string' | CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE deviceSpecifier TO 'fr mt_string' . . . }SHOW
Displays the currentl y enabled
CONFIGUREcommands.SHOW { RETENTION POLICY | [DEFAULT] DEVICE TYPE | [AUXILIARY] CHANNEL [FOR DEVICE TYPE deviceSpecifier] | MAXSETSIZE | { DATAFILE | ARCHIVELOG } BACKUP COPIES | BACKUP OPTIMIZATION < a name="769260">| SNAPSHOT CONTROLFILE NAME | AUXNAME | EXCLUDE | CONTROLFILE AUTOBACKUP [FORMAT] | ALL };< font face="Arial, Helvetica, sans-serif">untilClause
{ UNTIL TIME [=] 'date_string' | UNTIL SCN [=] integer | UNTIL SEQUENCE [=] integer THREAD [=] integer a>}Backup and Recovery Views
Refer to the Or acle Database Recovery Manager Reference for details on recovery catalog views and Oracle Database Reference for details on
V$views.
| < font face="Arial, Helvetica, sans-serif">Recovery Catalog View | Corresponding V$ View | |
|---|---|---|
|
|
|
Archived and unarchived redo logs |
|
|
|
Control files in backup sets |
|
|
|
Corrupt block ranges in datafile backups |
|
|
|
Datafiles in backup sets |
tr>
|
|
|
RMAN backups and copies in the repository. |
|
|
|
Backup pie ces |
|
|
|
Archived logs in backups |
|
|
|
Backup sets |
|
|
|
Server parameter files in backup sets |
|
|
|
Control file copies on disk |
|
|
|
Control file copies on disk |
|
|
|
Databases registered in the recovery catalog ( |
|
|
|
Database blocks marked as corrupt in the most recent RMAN backup or copy |
|
|
|
All database incarnations registe red in the catalog |
|
|
|
|
|
|
<
/a>
Datafile image copies | |
|
|
|
Historical information about online redo logs |
|
|
|
Offline ranges for datafiles |
|
|
|
Archi ved log backups created by proxy copy |
|
|
|
Control file backups created by proxy copy< /p> |
|
|
|
Datafile backups created by proxy copy |
|
|
|
Online redo logs for all incarnations of the database since the last catalog resynchronization |
|
|
|
All redo threads for all incarnations of the database since the last catalog resynchronization |
|
|
n/a |
Recovery catalog resynchronizations |
|
|
|
RMAN persistent configuration settings |
tr>
|
|
|
All tablespaces registered in the recovery catalog, all dropped tablespaces, and tablespaces that belo ng to old incarnations |
Our goal is to make Oracle products, services, and supp orting documentation accessible, with good usability, to the disabled community. To that end, our documentation includes features tha t 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. Standards will continue to evolve over time, and Oracle Corporation is actively engaged with other market-leading technology vendors to address technical obstacles so that our documentation can be accessible to all of ou r customers. For additional information, visit the Oracle Accessibility Program Web site at
http://www.oracle.com/accessibility/
JAWS, a Windows screen reader, may not always correctly read the code examples in this document. The conventions for writing c ode require that closing braces should appear on an otherwise empty line; however, JAWS may not always read a line of text that consi sts solely of a bracket or brace.
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 represe ntations regarding the accessibility of these Web sites.
Oracle is a registered t rademark, and SQL*Plus is a trademark or registered trademark of Oracle Corporation. Other names may be trademarks of their respectiv e owners.
Copyright © 2003 Oracle Corporation.
All Rights Reserved.