Oracle® Database Backup and Recovery Reference 10g Release 2 (10.2) Part Number B14194-03 |
|
|
View PDF |
Syntax
set::=
setRunOption::=
Purpose
You can use the SET
command either at the RMAN prompt or within a RUN block.
When used outside a RUN
block, attributes changed by SET
remain in effect until you exit the RMAN client.
Outside of a RUN
block, the SET
command supports the attributes shown in "setRmanOption". Use this form of the SET
command to:
Cause RMAN to echo any commands executed in the message log
Specify the location to search for control file autobackups during RESTORE
operations
Specify the database identifier (DBID) of a database, when restoring a control file or server parameter file from autobackup
Specify a command ID for an RMAN command, so that rows in V$SESSION
corresponding to sessions related to that command have V$SESSION.CLIENT_INFO
set to this ID
Specify settings related to encryption and decryption of backup sets for the duration of an RMAN session
Specify the location to use for auxiliary instance datafiles, when performing TSPITR or creating transportable tablespaces sets from backup
Within a RUN
block, the SET
command supports the attributes shown in "setRunOption". Changes made with SET
within a RUN
block persist until the end of the RUN
block, or the next SET
command that changes the value of the same attribute.
Use SET
specified within a RUN block to:
Specify new filenames for restored datafiles
Specify the filenames for the auxiliary database during TSPITR or database duplication.
Specify a limit for the number of permissible block corruptions.
Override default archived redo log destinations.
Set an end time, SCN, or log sequence number for recovery.
Specify that backup sets should be duplexed, that is, multiple copies should be created of each backup piece in the backup set.
Determine which server session corresponds to which channel.
Turn RMAN's automatic location feature on or off.
Override the default format for control file autobackups at the session level.
Restrictions and Usage Notes for SET Command Within RUN
The following restrictions apply to SET
when issued within a RUN command:
The SET
BACKUP
COPIES
command affects all backups in the RUN
block after issuing the command and is in effect until explicitly disabled or changed. The SET
BACKUP
COPIES
command does not affect previous backups.
SET
BACKUP
COPIES
does not apply to the BACKUP AS
COPY
command.
You must include the %F
substitution variable in the autobackup format.
You cannot use SET
NEWNAME
TO
NEW
when creating a duplicate or standby database or performing RMAN TSPITR.
Restrictions and Usage Notes for the SET DBID Command
You should only run the SET DBID command in the following specialized circumstances:
You are not connected to a recovery catalog and want to restore the control file or server parameter file.
You are connected to a recovery catalog and want to restore the control file, but the database name is not unique in the recovery catalog.
The server parameter file is lost and you want to restore it.
Keywords and Parameters
setRmanOption
Syntax Element | Description |
---|---|
AUXILIARY INSTANCE PARAMETER FILE TO ' filename ' |
For use in customizing TSPITR with an automatic auxiliary instance, or in online tablespace cloning with RMAN. Specifies the path (on the host running the RMAN client) to the parameter file to use in starting the instance.
Note: This is a client-side location, not a location on the database node. See Also: Oracle Database Reference for more on |
COMMAND ID TO ' string ' |
Enters the specified string into the V$SESSION.CLIENT_INFO column of all channels. Use this information to determine which database server sessions correspond to which RMAN channels. The SET COMMAND ID command applies only to channels that are already allocated.
The
The first form appears in the RMAN target database connection. The second form appears in all allocated channels. When the current job is complete, the See Also: Oracle Database Reference for more on |
CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE deviceSpecifier TO formatSpec |
Overrides the default filename format for the control file autobackup on the specified device type. The override occurs at the session level only. You can run this command either in RUN or at the RMAN prompt. The order of precedence is as follows:
Note that the %F substitution variable is required to be in the new See Also: "formatSpec" for the semantics of the |
DBID integer |
Specifies the DBID, which is a unique 32-bit identification number computed when the database is created. RMAN displays the DBID upon connection to the target database. You can obtain the DBID by querying the V$DATABASE view or the RC_DATABASE and RC_DATABASE_INCARNATION recovery catalog views.
See Also: "Restrictions and Usage Notes for the SET DBID Command" |
DECRYPTION IDENTIFIED BY password [, password... ] |
Specifies one or more decryption passwords to be used when reading dual-mode or password-encrypted backups. When RMAN reads encrypted backup pieces, it tries each password in the list until it finds the correct one to decrypt that backup piece. An error is signaled if none of the specified keys work.
See Also: "Encryption of Backup Sets" for more details on encryption of backup sets |
ECHO {ON | OFF} |
Controls whether RMAN commands are displayed in the message log. When reading commands from a command file, RMAN automatically echoes those commands to the message log. When reading commands from standard input, RMAN does not echo those commands to the message log. To force RMAN to echo the commands, run the SET ECHO ON command before running your command file.
The command is useful when % rman TARGET sys/pwd@prod1 CATALOG rman/rman@rcat < in_file > out_file By running |
ENCRYPTION |
Specifies encryption-related options that apply to BACKUP commands that create backup sets for the duration of the RMAN session.
See Also: "Encryption of Backup Sets" for more details on encryption of backup sets |
ALGORITHM
|
Specifies the algorithm used during this RMAN session. Overrides the configured default encryption algorithm. Possible values are listed in V$RMAN_ENCRYPTION_ALGORITHMS . |
IDENTIFIED BY
[ |
Specifies whether to use a user-specified password in encryption.
See "Encryption of Backup Sets" for details on the different encryption modes. Note: If the password provided is not surrounded by quotes, then it is translated internally into upper case. Thus, the following are all synonyms for
|
{ OFF | ON }
[ |
If SET ... ENCRYPTION ON or OFF is used without FOR ALL TABLESPACES , then this setting turns on or off encryption of backups for tablespaces where CONFIGURE ENCRYPTION FOR TABLESPACE tablespace_name ]ON or OFF has not been used to specify encryption behavior.
If If If |
setRunOption
Syntax Element | Description |
---|---|
NEWNAME FOR DATAFILE datafileSpec TO |
Sets the default name for all subsequent RESTORE or SWITCH commands that affect the specified datafile. If you do not issue this command before the datafile restore operation, then RMAN restores the file to its default location.
After you restore a datafile to a new location, then you can run SWITCH to rename the file in the control file to the Note: The See Also: "datafileSpec" |
NEWNAME FOR TEMPFILE tempfileSpec TO password | NEW |
Sets the new tempfile name for a subsequent SWITCH command that renames the specified tempfile to the specified name. If a filename is passed, that will be the new name of the tempfile after the database is recovered and opened. If NEW is passed the new name will be an OMF filename. The tempfile is created in DB_CREATE_FILE_DEST when the database is opened.
Note: The See Also: "tempfileSpec" |
' filename ' |
Specifies a user-defined filename or Automatic Storage Management disk group for the restored datafile. If you set the NEWNAME to a disk group and run a RESTORE , then RMAN restores the file to the disk group. |
NEW |
Creates an Oracle-managed file in the directory specified in DB_CREATE_FILE_DEST . If the original file is an Oracle Managed File or is on an Automatic Storage Management disk group, then RMAN attempts to delete the original file.
You cannot use this option when using the See Also: Oracle Database Administrator's Guide for information about Oracle Managed Files |
MAXCORRUPT FOR DATAFILE datafileSpec TO integer |
Sets a limit on the number of previously undetected block corruptions that the database will allow in a specified datafile or group of datafiles. If a BACKUP or CREATE CATALOG command detects more than the specified number of corruptions, then the command terminates. The default limit is zero, meaning that RMAN tolerates no corrupt blocks.
Note: If you specify See Also: "datafileSpec" |
ARCHIVELOG DESTINATION TO ' log_archive_dest ' |
Overrides the LOG_ARCHIVE_DEST_1 initialization parameter in the target database when forming names for restored archive logs during subsequent RESTORE and RECOVER commands. RMAN restores the logs to the destination specified in ' log_archive_dest ' . Use this parameter to restore archived redo logs that are not already on disk.
Use this command to stage many archived logs to different locations while a database restore is occurring. RMAN knows where to find the newly restored archive logs; it does not require them to be in the destination specified by |
untilClause |
Specifies an end time, SCN, or log sequence number for a subsequent RESTORE or RECOVER command.
See Also: "untilClause" |
BACKUP COPIES = integer |
Specifies the number of copies of each backup piece that the channels should create: 1, 2, 3, or 4. The SET BACKUP COPIES command, which affects only the BACKUP command, affects all channels allocated in the session. The order of precedence is as follows, with settings higher on the list overriding settings lower on the list:
The names of the backup pieces are dependent on the Note: Note: Control file autobackups on disk are a special case and are never duplexed: RMAN always writes one and only copy. |
COMMAND ID TO ' string ' |
Enters the specified string into the V$SESSION.CLIENT_INFO column of all channels. Use this information to determine which database server sessions correspond to which RMAN channels. The SET COMMAND ID command applies only to channels that are already allocated.
The
The first form appears in the RMAN target database connection. The second form appears in all allocated channels. When the current job is complete, the See Also: Oracle Database Reference for more on |
CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE deviceSpecifier TO formatSpec |
Overrides the default filename format for the control file autobackup on the specified device type. The override occurs at the session level only. You can run this command either in RUN or at the RMAN prompt. The order of precedence is as follows:
Note that the %F substitution variable is required to be in the new See Also: "formatSpec" for the semantics of the |
Examples
Restoring the Control File When Databases Share the Same Name: Example The following example uses the DBID to restore the control file because multiple target databases share the same DB_NAME
in the catalog. After you have restored the target control file, you can mount the database to restore the rest of the database:
rman TARGET / CATALOG rman/rman@catdb RMAN> STARTUP FORCE NOMOUNT; RMAN> SET DBID = 862893450; # needed to distinguish target from others with same DB_NAME RMAN> RESTORE CONTROLFILE; # assuming catalog has automatic channel allocation information RMAN> ALTER DATABASE MOUNT;
Setting the Command ID: Example This example sets the command ID, backs up the users
tablespace, then archives the online redo logs:
RUN { ALLOCATE CHANNEL t1 DEVICE TYPE DISK FORMAT '/disk1/%U'; ALLOCATE CHANNEL t2 DEVICE TYPE DISK FORMAT '/disk2/%U'; SET COMMAND ID TO 'rman'; BACKUP INCREMENTAL LEVEL 0 MAXSETSIZE 5M TABLESPACE users; SQL 'ALTER SYSTEM ARCHIVE LOG ALL';
}
Duplexing a Backup Set: Example Assume that you have used the CONFIGURE
command to set duplexing as follows:
CONFIGURE ARCHIVELOG COPIES FOR DEVICE TYPE sbt TO 4; CONFIGURE DATAFILE COPIES FOR DEVICE TYPE sbt TO 3;
The following example overrides these configurations and makes two copies of each datafile and archived log in the backup:
RUN { ALLOCATE CHANNEL dev1 DEVICE TYPE sbt; SET BACKUP COPIES = 2; BACKUP DATAFILE 1,2,3,4,5; BACKUP ARCHIVELOG ALL; }
Overriding the Autobackup Format During a Restore: Example This example sets the DBID, sets a boundary time for the restore, then restores a control file autobackup with a nondefault format. First start RMAN and then run:
CONNECT TARGET / NOCATALOG STARTUP FORCE NOMOUNT SET DBID 676549873; RUN { SET UNTIL TIME '10/10/2001 13:45:00'; SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '?/oradata/cf_%F.bak'; RESTORE CONTROLFILE FROM AUTOBACKUP MAXSEQ 100; } ALTER DATABASE MOUNT;
Restoring the Server Parameter File: Example This example restores a lost server parameter file:
CONNECT TARGET / CATALOG rman/rman@catdb SET DBID 676549873; # set dbid so rman knows the database name STARTUP FORCE NOMOUNT # rman starts database with a dummy server parameter file RESTORE SPFILE; STARTUP FORCE; # needed so that RMAN restarts database with restored server parameter file