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

CREATE SCRIPT

Syntax

createScript::=

Description of createscript.gif follows
Description of the illustration createscript.gif

Purpose

To create a stored script in the recovery catalog.

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).

Any command that is legal within a RUN command is permitted in the stored script.

Several other commands are used with stored scripts:

Restrictions and Usage Notes

Note the following restrictions:

Keywords and Parameters

Syntax Element Description
GLOBAL Identifies the script being created as global. If omitted, RMAN creates a local stored script script_name defined on the current target database. If no such script is defined on the target database, RMAN creates for a global stored script script_name.
'script_name' The name of the script to create.
COMMENT [=] 'comment' Associates an explanatory comment with the stored script in the catalog.
FROM FILE 'filename' Reads the sequence of commands to define the script from the specified file.

The file should look like the body of a valid stored script. The first line of the file must be a '{' and the last line must contain a '}'. The RMAN commands in the file must be valid in a stored script.

backupCommands

maintenanceCommands

miscellaneousCommands

restoreCommands

Commands valid in a stored script. The statements allowable within the brackets of the CREATE SCRIPT 'script_name' {...} command are the same commands supported within a RUN block. See "RUN" for more details.

Example

Creating a Local Stored Script: Example This example creates a stored script called backup_whole that backs up the database and archived redo logs:

# creates recovery catalog script to back up database and archived logs
CREATE SCRIPT backup_whole 
COMMENT "backup whole database and logs"
{
    BACKUP INCREMENTAL LEVEL 0 TAG b_whole_l0 
    DATABASE PLUS ARCHIVELOG;
}

Creating a Global Stored Script: Example This example creates a stored script called backup_whole that backs up the database and archived redo logs:

# creates recovery catalog script to back up database and archived logs
CREATE GLOBAL SCRIPT global_backup_db
COMMENT "backup any database from the recovery catalog, with logs"
{
    BACKUP DATABASE PLUS ARCHIVELOG;
}