Skip Headers
Oracle® Database Backup and Recovery Reference
10g Release 2 (10.2)

Part Number B14194-02
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
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

REPLACE SCRIPT

Syntax

replaceScript::=

Description of replacescript.gif follows
Description of the illustration replacescript.gif

Purpose

To replace an existing script stored in the recovery catalog. If the script does not exist, then REPLACE SCRIPT creates it.

A stored script is a sequence of RMAN commands, given a name and stored in the recovery catalog for later execution. A stored script may be local (that is, associated with one target database) or global (available for use with any database registered in the recovery catalog).

For more information about stored scripts and commands used to create, update, delete and execute stored scripts, see "CREATE SCRIPT".

Restrictions and Usage Notes

Keywords and Parameters

Syntax Element Description
GLOBAL Restricts RMAN to replacing or creating a global stored script, instead of a local one.

If omitted, RMAN looks for a local stored script script_name defined on the current target database. If one is found, RMAN updates the local script with the new script contents. If no local script is found, RMAN looks for a global stored script script_name. If a global script script_name is found, RMAN updates it with the new script contents.

'script_name' Identifies the local or global script being replaced.
COMMENT ='comment' An explanatory comment, used in the output of LIST SCRIPT NAMES..
FROM FILE 'filename' The new contents of the script are to be read from this file. The first line of the file must begin with a "{", the last line must contain a "}" and the commands must be valid within a RUN block.
{ backupCommands

| maintenanceCommands

| miscellaneousCommands

| restoreCommands

}

Commands valid in a stored script. These are the same commands supported within a RUN block. See "RUN" for more details about backupCommands, restoreCommands, maintenanceCommands, and miscellaneousCommands.

Example

Replacing a Recovery Catalog Script: Example This example updates a stored script called backup_full:

REPLACE SCRIPT backup_full 
COMMENT 'Run this to back up the database'
{
   # uses configured channel for default device type
   BACKUP DATABASE;
}

If there is a local script backup_full, it is updated. If there is no local script backup_full but there is a global script backup_full, the global script is updated.