Oracle9i Recovery Manager Reference Release 1 (9.0.1) Part Number A90136-02 |
|
RMAN Commands , 51 of 60
set_rman_option::=
set_run_option::=
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 specify the SET
command either at the RMAN prompt or within a RUN
block. When you issue
SET
within a RUN
block, the command sets attributes for a
RUN
command that persist until the end of the job. The specified attributes affect all statements within
RUN
that follow the
SET
command.
Use the SET
specified at the RMAN prompt 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
AUTOLOCATE
ON
only in an Oracle Real Application Clusters configuration and only when the media manager from one node cannot access or update data created on a different node.
SET
AUTOLOCATE
ON
before
RESTORE
and
RECOVER
commands.
%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 specialized circumstances. Table 2-22 describes the general requirements for running the SET
DBID
command.
Table 2-23 and Table 2-24 describe the requirements for running the SET
DBID
command when you are restoring a control file.
Connected to Catalog? | Database Started NOMOUNT | Database Mounted or Open |
---|---|---|
Yes |
Run |
|
No |
Run |
|
Connected to Catalog? | Database Started NOMOUNT | Database Mounted or Open |
---|---|---|
Yes |
Run |
|
No |
N/A |
|
|
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 unless the
The command is useful only when % rman TARGET sys/sys_pwd@prod1 CATALOG rman/rman@rcat < input_file > output_file
By specifying |
|
|
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" |
|
|
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
See the |
|
Sets the default name for all subsequent
After you restore a datafile to a new location, then you can run See Also: "datafileSpec" |
||
|
|
Specifies a user-defined filename for the restored datafile. |
|
|
Creates an Oracle-managed file in the directory specified in See Also: Oracle9i Database Administrator's Guide for information about Oracle Managed Files |
Sets a limit on the number of previously undetected physical block corruptions that Oracle 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: Control file autobackups made within |
|
|
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: Oracle9i Database Reference for more information on |
|
|
Forces RMAN to automatically discover which nodes of an Oracle Real Application Clusters configuration contain the backups that you want to restore. Set to
This option forces RMAN to hunt for backups on all allocated channels and to restore backups only from those channels that locate the backups on tape or on a file system. For example, assume that nodes A, B, and C are in an Oracle Real Application Clusters configuration. If node A backs up a datafile to a tape drive or local file system, you must tell RMAN not to attempt to restore from nodes B or C. The
Issue the |
This example uses the DBID to restore the control file because multiple target databases registered in the recovery catalog share the same DB_NAME
. After you have restored the target control file, you can mount the database to restore the rest of the database. This example assumes that the database is started but not mounted.
% rman CATALOG cat_owner/pwd@rcatdb RMAN> SET DBID = 862893450; RMAN> CONNECT TARGET / # uses operating system authentication RMAN> RESTORE CONTROLFILE; # assuming you have enabled automatic channel allocation RMAN> ALTER DATABASE MOUNT;
This example sets the command ID, backs up the data_1
tablespace by using manually allocated disk channels, hosts out to the operating system, 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 FILESPERSET 5 TABLESPACE data_1;
HOST;
SQL 'ALTER SYSTEM ARCHIVE LOG ALL';
}
This example makes a nonduplexed backup of datafiles 1-5, then duplexes all archived logs and the current control file:
RUN { ALLOCATE CHANNEL dev1 DEVICE TYPE sbt; BACKUP FILESPERSET 1 DATAFILE 1,2,3,4,5; SET BACKUP COPIES = 2; BACKUP FILESPERSET 10 ARCHIVELOG ALL; BACKUP CURRENT CONTROLFILE; }
This example sets the DBID, sets a boundary time for the restore, then restores a control file autobackup by using a nondefault format:
% sqlplus SYS/sys_pwd@prod1 SQL> STARTUP NOMOUNT SQL> EXIT % rman SET DBID 676549873; CONNECT TARGET / RUN { SET UNTIL TIME '10/10/1999 13:45:00'; SET CONTROLFILE AUTOBACKUP FORMAT TO '/oracle/backups/%F.bck'; ALLOCATE CHANNEL channel_1 DEVICE TYPE DISK; RESTORE CONTROLFILE FROM AUTOBACKUP MAXSEQ 100; }
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|