Skip Headers
Oracle® Database Backup and Recovery Reference
11g Release 2 (11.2)

Part Number E10643-06
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

RUN

Purpose

Use the RUN command to group a series RMAN commands into a block to be executed sequentially. On reading the closing brace of the RUN block, RMAN compiles the list of job commands into one or more job steps and then executes the steps immediately.

Prerequisites

Execute this command only at the RMAN prompt. You must precede the list of job commands with an opening brace ({) and terminate it with a closing brace (}).

Usage Notes

You can use RUN to create a scope within which a script can override default configurations. For example, you can override configured channels with the ALLOCATE CHANNEL and RELEASE CHANNEL commands and other parameters with the SET command (as shown in Example 3-38). After executing the commands listed in the RUN block, the channels allocated within the RUN block are released and settings returned to their values.

As shown in Example 3-39, you must use the EXECUTE SCRIPT command within a RUN block.

Syntax

run::=

Description of run.gif follows
Description of the illustration run.gif

(backupCommands::=, maintenanceCommands::=, miscellaneousCommands::=, restoreCommands::=)

backupCommands::=

Description of backupcommands.gif follows
Description of the illustration backupcommands.gif

maintenanceCommands::=

Description of maintenancecommands.gif follows
Description of the illustration maintenancecommands.gif

miscellaneousCommands::=

Description of miscellaneouscommands.gif follows
Description of the illustration miscellaneouscommands.gif

restoreCommands::=

Description of restorecommands.gif follows
Description of the illustration restorecommands.gif

Semantics

Refer to individual command entries for information about commands that you can run from the RMAN prompt.

Examples

Example 3-38 Overriding Configured Settings

Assume that your configured device configuration is as follows:

RMAN> SHOW DEVICE TYPE;

RMAN configuration parameters for database with db_unique_name PROD1 are:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default

You want to make a backup to a nondefault directory. Instead of changing the configuration, you can override it in the job as follows:

RUN
{
  ALLOCATE CHANNEL c1 DEVICE TYPE DISK FORMAT "/disk2/%U";
  BACKUP DATABASE PLUS ARCHIVELOG;
}

Example 3-39 Executing an RMAN Script

Assume that you use the CREATE SCRIPT command to create a backup script named backup_db. This example executes the stored script:

RUN { EXECUTE SCRIPT backup_db; }