3.14 SET
Purpose
Use the SET
command to control RMAN behavior within a job or session. Use CONFIGURE
to configure options that persist across sessions.
Prerequisites
You can use the SET
command either at the RMAN prompt or within a RUN
block. When used at the RMAN prompt, changes made by SET
persist until you exit the RMAN client (see setRmanOption). When used inside of a RUN
block, changes made by SET
persist until the end of the RUN
block or the next SET
command that changes the value of the same attribute (see setRunOption).
Syntax
set::=
(setRmanOption::=, setRunOption::=)
(deviceSpecifier::=, formatSpec::=)
(deviceSpecifier::=, formatSpec::=, datafileSpec::=, tempfileSpec::=, untilClause::=)
Semantics
setRmanOption
This subclause specifies SET
options that are usable outside of a RUN
block.
Syntax Element | Description |
---|---|
|
Specifies the visibility of backups in a Data Guard environment. By default, disk backups are visible only to the database with which the backups are associated. The association is determined by the |
|
Specifies the device type for which visibility of backups must be modified. |
|
Makes disk backups created on the primary database or standby database available only to the database that created these backups. |
|
Makes backups created on the primary database or standby database accessible to databases whose |
COMPRESSION ALGORITHM ' ' |
Specifies the compression algorithm for backup sets. This command overrides the current You can configure the basic compression level, which does not require the Advanced Compression Option, by specifying If you have enabled the Advanced Compression Option, you can choose from the following compression levels:
Note: The compression ratio generally increases from Because the performance of the various compression levels depends on the nature of the data in the database, network configuration, system resources and the type of computer system and its capabilities, universally applicable performance statistics are not available. When deciding which level is best, you must consider how balanced your system is regarding bandwidth into the CPU and the actual speed of the CPU. Oracle recommends that you run tests with the different compression levels on the data in your environment. Choose a compression level based on your environment, network traffic characteristics (workload), and data set. This is the only way to ensure that the backup set compression level can satisfy your organization's performance requirements and any applicable service level agreements. Note: See Also: Oracle Database Reference entry for |
OPTIMIZE FOR LOAD {TRUE|FALSE} |
Specifies whether Oracle performs pre-compression block processing when compressed backups have been requested. See Also: Oracle Database Backup and Recovery User's Guide to learn more about this option. |
AS OF RELEASE 'version number' |
Specifies the release version. The version number uses the release number format and may use as many as 5 numbers to fully qualify the release. For example, 10.2.0.3.0 and 11.2 are acceptable values. This option ensures compression algorithm stability across future releases. |
DECRYPTION IDENTIFIED BY password |
Specifies one or more decryption passwords to be used when reading dual-mode or password-encrypted backups. Password-encrypted backups require the correct password to be entered before they can be restored. When RMAN reads an encrypted backup piece, it tries each password in the list until it finds the correct one to decrypt this backup piece. RMAN signals an error if no specified keys work. Note: If restoring from a group of backups created with different passwords, then specify all of the required passwords on the See Also: "Encryption of Backup Sets" |
|
Specifies the password that must be used to open the password-based software keystore. Keystores are used while encrypting backup sets using transparent mode encryption. If the database or tablespace uses Transparent Data Encryption (TDE) and you have a password-based software keystore, then you must use the When restoring backups that were created by using transparent encryption with a password-based software keystore, you must specify the password that is used to open the keystore. When duplicating a database that is configured to use transparent encryption with a password-based software keystore, the password that is required to open the keystore must be provided to the auxiliary instance by using this command. The password specified is valid for the session in which the |
|
Controls whether RMAN commands appear in the message log. When reading commands from a command file, RMAN automatically echoes them to the message log. When reading commands from standard input, by default RMAN does not echo these commands to the message log. To force RMAN to echo the commands, run the The command is useful when % rman TARGET / < in_file > out_file By including |
|
Specifies encryption-related options that apply to See Also: "Encryption of Backup Sets" |
ALGORITHM ' algorithm_name ' |
Specifies the algorithm used during this RMAN session. Overrides the configured default encryption algorithm specified by |
IDENTIFIED BY password [ONLY] |
Specifies whether to employ a user-specified password in backup encryption according to the following rules:
Create a password that is secure. See Oracle Database Security Guide for more information. If the password is not surrounded by quotes, then it is translated internally into upper case. Thus, the following clauses are all synonyms for
Caution: Keystore-based encryption is more secure than password-based encryption because no passwords are involved. Use password-based encryption only when absolutely necessary because your backups must be transportable. See Also: "Encryption of Backup Sets" for details on the different encryption modes |
|
Specifies whether to encrypt backup sets. If This option overrides settings made with the If |
|
Controls encryption for all tablespaces, overriding any |
|
Deletes the passphrase that was set during backup or restore operations involving TDE-encrypted tablespaces from the memory. It is recommended that you set the passphrase off after you perform a backup or restore of TDE-encrypted tablespaces. |
|
Specifies the passphrase used to wrap the master key when creating or restoring backups of TDE-encrypted tablespaces. |
|
Sets the container for RMAN operations that use preplugin backups to Use the |
setRunOption
This subclause specifies SET
options that are usable within a RUN
block.
Syntax Element | Description |
---|---|
ARCHIVELOG DESTINATION TO ' log_archive_dest ' |
Overrides the You can use this command to stage archived redo log files to different locations while restoring a database. RMAN knows where to find the newly restored archived redo log files; it does not require them to be in the destination specified by Use this parameter to restore archived redo log files that are not on disk. RMAN always looks for logs on disk first before restoring them from backups. |
Specifies the number of copies of each backup piece that the channels create: RMAN can duplex backups to either disk or tape but cannot duplex backups to tape and disk simultaneously. When backing up to tape, ensure that the number of copies does not exceed the number of available tape devices. Also, if The The 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. |
|
MAXCORRUPT FOR DATAFILE datafileSpec TO integer |
Sets a limit on the number of previously undetected block corruptions that the database permits in a specified data file or group of data files. The default limit is zero, meaning that RMAN tolerates no corrupt blocks. The Whether or not the Note: If you specify See Also: |
NEWNAME FOR DATABASE |
Sets new default names for all data files and temp files in the specified database that have not been named with the This command enables you to change the names for multiple files in the database and provides a quick alternative to naming each file individually (see Example 2-87). This command does not set names for temp files. When issuing The new names are used for all subsequent You do not have to issue the SET NEWNAME FOR DATABASE TO '/oradata1/%b'; SET NEWNAME FOR TABLESPACE users TO '/oradata2/%U'; SET NEWNAME FOR DATAFILE 1 TO '+data'; The preceding series of commands is equivalent to the following differently ordered series of commands: SET NEWNAME FOR DATAFILE 1 TO '+data; SET NEWNAME FOR DATABASE TO '/oradata1/%b'; SET NEWNAME FOR TABLESPACE users TO '/oradata2/%U'; Note: The See Also: |
|
In a CDB, sets new default names for data files and temp files only in the root. Connect to the root as described in "Connecting to CDBs and PDBs". |
|
In a CDB, sets new default names for data files and temp files only in the specified PDBs. Connect to the root as described in "Connecting to CDBs and PDBs". |
NEWNAME FOR DATAFILE datafileSpec |
Sets the default name for the specified data file. This command enables you to specify the names of each data file individually (see Example 2-88). The new names are used for all subsequent If you run Note: The See Also: |
NEWNAME FOR TABLESPACE tablespace_name |
Sets new default names for all the files in the specified tablespace that have not been named with the This command enables you to change the names for multiple files in the duplicate tablespace and provides an alternative to naming each file of the tablespace individually (see Example 2-88). When issuing The new names are used for all subsequent Note: The See Also: |
|
The name of the tablespace in a CDB. Multiple databases can have tablespaces with the same name. A qualifier before the name uniquely identifies the tablespace. |
NEWNAME FOR TEMPFILE tempfileSpec |
Sets the new temp file name for a subsequent Note: The See Also: |
|
Specifies a user-defined file name or ASM disk group for the restored data file or temp file. When issuing
Note: Use of other substitution variables defined in formatSpec is undefined: some yield an error, while others result in zero values and are not supported. If you set the |
|
Creates an Oracle-managed file in the directory specified by the For example, If the original file is an Oracle-managed file or is on an ASM disk group, then RMAN attempts to delete the original file. If you specify See Also: Oracle Database Administrator’s Guide for information about Oracle-managed files |
TO RESTORE POINT restore_point_name |
Specifies a restore point for a subsequent Note: You can only use |
Specifies an end time, SCN, or log sequence number for a subsequent See Also: |
setRmanOrRunOption
This subclause specifies SET
options that are usable inside or outside of a RUN
block.
Syntax Element | Description |
---|---|
AUXILIARY INSTANCE PARAMETER FILE TO ' filename ' |
Specifies the path to the parameter file to use in starting the instance. You can use this parameter when customizing TSPITR with an automatic auxiliary instance or when cloning RMAN tablespaces with RMAN. Note: The |
Enters the specified string into the 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 information about |
|
CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE deviceSpecifier TO formatSpec |
Overrides the default file name format for the control file autobackup on the specified device type. You can use this command either in
The %F substitution variable is required to be in the new See Also: |
|
Specifies the name of the database to copy (source database) when duplicating without a connection to the target database. Alternatively, you can use the |
|
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 Run the
|
Specifies an orphan incarnation when duplicating without a target connection under the following conditions:
|
|
|
Sets the number of characters displayed for LONG columns. The maximum is 4000, the default is 80. |
|
Sets the number of characters displayed for NUMBER columns. The default is 10. |
Examples
Example 3-57 Setting the Command ID
This example sets the command ID to rman
, backs up the database, and then archives the online redo logs. You can use the command ID to query V$SESSION
with WHERE CLIENT_INFO LIKE '%rman%'
for job status information.
RUN { ALLOCATE CHANNEL d1 DEVICE TYPE DISK FORMAT '/disk1/%U'; ALLOCATE CHANNEL d2 DEVICE TYPE DISK FORMAT '/disk2/%U'; SET COMMAND ID TO 'rman'; BACKUP INCREMENTAL LEVEL 0 DATABASE; ALTER SYSTEM ARCHIVE LOG CURRENT; }
Example 3-58 Duplexing a Backup Set
Assume that the current duplexing configuration is as follows:
CONFIGURE ARCHIVELOG COPIES FOR DEVICE TYPE sbt TO 3; CONFIGURE DATAFILE COPIES FOR DEVICE TYPE sbt TO 3;
A tape drives goes bad, leaving only two available. The guideline for tape backups is that the number of devices equals the number of copies multiplied by the number of channels. The following example overrides the persistent duplexing configuration with SET BACKUP COPIES
and writes two copies of a database backup to the two functioning tape drives:
RUN { ALLOCATE CHANNEL dev1 DEVICE TYPE sbt PARMS 'ENV=(OB_DEVICE_1=stape1,OB_DEVICE_2=stape2)'; SET BACKUP COPIES 2; BACKUP DATABASE PLUS ARCHIVELOG; }
Example 3-59 Setting the Control File Autobackup Format During a Restore
Assume that the disk containing the control file fails. You edit the CONTROL_FILES
parameter in the initialization parameter file to point to a new location.
In this example, you do not have access to a recovery catalog. The example starts the instance, sets the DBID, and then restores a control file autobackup. After the database is mounted, you can recover the database.
CONNECT TARGET / STARTUP FORCE NOMOUNT SET DBID 28014364; RUN { SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/disk2/cf_%F.bak'; RESTORE CONTROLFILE FROM AUTOBACKUP MAXSEQ 100; } ALTER DATABASE MOUNT; RECOVER DATABASE; ALTER DATABASE OPEN RESETLOGS;
Example 3-60 Restoring the Server Parameter File
Assume that the database is shut down while maintenance is being performed on the database host. During this time, the server parameter file is accidentally deleted. You start the RMAN client, CONNECT
as TARGET
to the database, and connect to the recovery catalog. The following example restores a server parameter file from an autobackup on tape and then restarts the instance.
SET DBID 3257174182; # set dbid so RMAN can identify the database STARTUP FORCE NOMOUNT # RMAN starts database with a dummy server parameter file RUN { ALLOCATE CHANNEL t1 DEVICE TYPE sbt; RESTORE SPFILE FROM AUTOBACKUP; } STARTUP FORCE; # RMAN restarts database with restored server parameter file
Example 3-61 Setting NEWNAME and Duplicating Without a Connection to Target Database
Assume that you want to duplicate a database without a connection to the target database and that you want to duplicate to an incarnation that is not in the current incarnation path (451
). The following example uses the various SET NEWNAME
commands, sets the DBID
and duplicates the database to NEWDB
:
SET DATABASE PROD SET DBID 22398754 SET INCARNATION 451 RUN { SET NEWNAME FOR TABLESPACE system TO '/test/oradata/system/%d_%f'; SET NEWNAME FOR TABLESPACE users to '/test/oradata/users/%b'; SET NEWNAME FOR DATAFILE 35 to '/test/oradata/special/%N_%b_%f'; SET NEWNAME FOR DATAFILE 50 to '/test/oradata/special/%N_%b_%f'; SET NEWNAME FOR DATABASE to NEW; DUPLICATE DATABASE TO newdb SKIP READONLY LOGFILE GROUP 1 ('/test/onlinelogs/redo01_1.f', '?/test/onlinelogs/redo01_2.f') SIZE 4M, GROUP 2 ('?/test/onlinelongs/redo02_1.f', '?/test/onlinelongs/redo02_2.f') SIZE 4M, GROUP 3 ('?/test/onlinelogs/redo03_1.f', '?/test/onlinelogs/redo03_2.f') SIZE 4M REUSE; }
Example 3-62 Setting a Compression Level for a Backup
This example assumes that you have a license for Advanced Compression Option (ACO) of the database.
To use the LOW
compression algorithm for a backup of tablespace users
that has high volatility:
SET COMPRESSION ALGORITHM 'LOW' OPTIMIZE FOR LOAD FALSE; BACKUP AS COMPRESSED BACKUPSET TABLESPACE USERS;