Oracle9i Recovery Manager Reference
Release 1 (9.0.1)

Part Number A90136-02
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

RMAN Commands , 51 of 60


SET

Syntax


Text description of set.gif follows
Text description of the illustration set.gif

set_rman_option::=


Text description of set_rman.gif follows
Text description of the illustration set_rman.gif

set_run_option::=


Text description of set_run_.gif follows
Text description of the illustration set_run_.gif

Purpose

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:

Restrictions and Usage Notes for SET Command Within RUN

The following restrictions apply to SET when issued within a RUN command:

Restrictions and Usage Notes for the SET DBID Command

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-22 SET DBID Requirements: General
Connected to Target?  Database Started NOMOUNT  Database Mounted or Open 

Yes 

SET DBID fails with RMAN-06188 

SET DBID fails with RMAN-06188 

No 

You can run SET DBID 

SET DBID value must match DBID of target database 

Table 2-23 and Table 2-24 describe the requirements for running the SET DBID command when you are restoring a control file.

Table 2-23 SET DBID and RESTORE CONTROLFILE FROM AUTOBACKUP
Connected to Catalog?  Database Started NOMOUNT  Database Mounted or Open 

Yes 

Run SET DBID only if RMAN issues RMAN-20005 

SET DBID not necessary 

No 

Run SET DBID 

SET DBID not necessary 

Table 2-24 SET DBID Requirements for RESTORE CONTROLFILE
Connected to Catalog?  Database Started NOMOUNT  Database Mounted or Open 

Yes 

Run SET DBID only if RMAN issues RMAN-20005 

SET DBID not necessary 

No 

N/A 

SET DBID not necessary 

Keywords and Parameters

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 unless the SET ECHO ON command is used.

The command is useful only when stdin and stdout have been redirected. For example, in UNIX you can redirect RMAN's input and output in this manner:

% rman TARGET sys/sys_pwd@prod1 CATALOG rman/rman@rcat < input_file > output_file

By specifying SET ECHO ON, you enable the commands contained in input_file to be visible in output_file

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" 

CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE deviceSpecifier TO 'format_string' 

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:

  1. SET CONTROLFILE AUTOBACKUP executed within a RUN block

  2. SET CONTROLFILE AUTOBACKUP executed at the RMAN prompt

  3. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT

See the CONFIGURE command for an explanation of the autobackup format. 

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 NEWNAME. If you do not run SWITCH, then the restored file functions as a datafile copy and is recorded as such in the repository.

See Also: "datafileSpec" 

 

'filename' 

Specifies a user-defined filename for the restored datafile. 

 

NEW 

Creates an Oracle-managed file in the directory specified in DB_CREATE_FILE_DEST. You cannot use this option when using the DUPLICATE command or performing RMAN TSPITR.

See Also: Oracle9i 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 physical block corruptions that Oracle will allow in a specified datafile or list of datafiles. If a BACKUP or COPY command detects more than the specified number of corruptions, the command aborts. The default limit is zero, meaning that RMAN tolerates no corrupt blocks.

Note: If you specify CHECK LOGICAL, then the MAXCORRUPT limit applies to logical corruptions as well.

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 LOG_ARCHIVE_DEST_1. For example, if you specify a different destination from the one in the parameter file and restore archived redo log backups, subsequent restore and recovery operations will detect this new location. RMAN always looks for archived redo logs on disk first before restoring them from backup sets. 

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:

  • BACKUP COPIES

  • SET BACKUP COPIES

  • CONFIGURE ... BACKUP COPIES

The names of the backup pieces are dependent on the FORMAT clause in the BACKUP command. You can specify up to four FORMAT strings. RMAN uses the second, third, and fourth values only when BACKUP COPIES, SET BACKUP COPIES, or CONFIGURE ... BACKUP COPIES is in effect. When choosing which format to use for each backup piece, RMAN uses the first format value for copy 1, the second format value for copy 2, and so on. If the number of format values exceeds the number of copies, then the extra formats are not used. If the number of format values is less than the number of copies, RMAN reuses the format values, starting with the first one.

Note: Control file autobackups made within RUN are also duplexed. 

COMMAND ID TO 'string' 

Enters the specified string into the V$SESSION.CLIENT_INFO column of all channels. Use this information to determine which Oracle server sessions correspond to which RMAN channels. The SET COMMAND ID command applies only to channels that are already allocated.

The V$SESSION.CLIENT_INFO column contains information for each RMAN server session. The data appears in one of the following formats:

  • id=string

  • id=string, ch=channel_id

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 V$SESSION.CLIENT_INFO column will be cleared.

See Also: Oracle9i Database Reference for more information on V$SESSION.CLIENT_INFO 

AUTOLOCATE 

Forces RMAN to automatically discover which nodes of an Oracle Real Application Clusters configuration contain the backups that you want to restore. Set to ON or OFF (default).

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 SET AUTOLOCATE command performs this function.

Issue the SET AUTOLOCATE ON command only if:

  • The command precedes RESTORE or RECOVER commands.

  • Channels are allocated on different nodes of an Oracle Real Application Clusters configuration.

  • The media management servers do not already offer cluster-wide service.

  • It is necessary (the command incurs system overhead).

Restoring the Control File: Example

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; 

Setting the Command ID: Example

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';

}

Duplexing a Backup Set: Example

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;
}

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 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;
}

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback