| Oracle® Database Recovery Manager Reference 10g Release 1 (10.1) Part Number B10770-01 |
|
|
View PDF |
set::=
Text description of setRmanOption
setRunOption::=
Text description of setRunOption
To configure settings that apply only to the current RMAN session. The SET command contrasts with the CONFIGURE command, which configures persistent settings that apply to all RMAN sessions.
You can use the SET command either at the RMAN prompt or within a RUN block. Within a RUN block, the SET command sets attributes that persist until the end of the RUN block. The specified attributes affect all statements within RUN that follow the SET command. When you use SET outside of a RUN block the attributes you set persist until you exit the RMAN client.
Use the SET command outside a RUN block to:
Use SET specified within a RUN block to:
The following restrictions apply to SET when issued within a RUN command:
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.%F substitution variable in the autobackup format.SET NEWNAME TO NEW when creating a duplicate or standby database or performing RMAN TSPITR.You should only run the SET DBID command in the following specialized circumstances:
| See Also:
Table 2-27 for |
| Syntax Element | Description |
|---|---|
|
|
For use in customizing TSPITR with an automatic auxiliary instance. Specifies the path (on the host running the RMAN client) to the client-side parameter file to use in starting the instance. See Also: Oracle Database Reference for more on |
|
|
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 on |
|
|
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
Note that the %F substitution variable is required to be in the new See Also: "formatSpec" for the semantics of 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 See Also: "Restrictions and Usage Notes for the SET DBID Command" |
|
|
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 The command is useful when % rman TARGET sys/pwd@prod1 CATALOG rman/rman@rcat < in_file > out_file By running |
| Syntax Element | Description |
|---|---|
|
|
Sets the default name for all subsequent After you restore a datafile to a new location, then you can run Note: The See Also: "datafileSpec" |
|
Specifies a user-defined filename or Automatic Storage Management disk group for the restored datafile. If you set the 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 so that it will not be orphaned. | |
|
Creates an Oracle-managed file in the directory specified in You cannot use this option when using the See Also: Oracle Database Administrator's Guide for information about Oracle Managed Files | |
|
|
Sets a limit on the number of previously undetected physical block corruptions that the database will allow in a specified datafile or list of datafiles. If a Note: If you specify See Also: "datafileSpec" |
|
|
Overrides the 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 |
|
Specifies an end time, SCN, or log sequence number for a subsequent See Also: "untilClause" | |
|
|
Specifies the number of copies of each backup piece that the channels should create: 1, 2, 3, or 4. 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. |
|
|
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 on |
|
|
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
Note that the %F substitution variable is required to be in the new See Also: "formatSpec" for the semantics of the |
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;
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';
}
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; }
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;
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