Oracle8i Backup and Recovery Guide
Release 8.1.5

A67773-01

Library

Product

Contents

Index

Prev Prev Next


createScript

Syntax


Purpose

To create a script and store it in the recovery catalog for future reference. Stored scripts provide a common repository for frequently executed collections of RMAN commands: use any command legal within a run command in the script. The script is not executed immediately; use the execute script command (see "run") to run it.

Requirements

Note the following restrictions:

Keywords and Parameters

For descriptions of the individual commands that you can use in a stored script, see the appropriate entry, e.g., "backup". Note that the @@ command exhibits special behavior when you execute it within a script. For information on the execute script command, see "run".

script_name  

creates a stored script with the specified name. The statements allowable within the parentheses of the create script 'script_name' ( ... ) command are the same allowable within the run command. The statements within the braces constitute the job_command_list.

Note: To execute the stored script, use the execute script command within the braces of the run command.  

@filename  

executes a series of RMAN commands stored in an O/S file with the specified full pathname, e.g., @$ORACLE_HOME/dbs/cmd/cmd1.f. Do not use quotes around the string or leave whitespace between the @ and filename. RMAN processes the specified file as if its contents had appeared in place of the @ command.

Note: The file must contain only complete Recovery Manager commands. A syntax error will result if the file contains a partial command.  

@@filename  

specifies the relative filename of an O/S file containing a series of RMAN commands, e.g., cmd1.f. The command file specified by @@ is assumed to be in the same directory as the parent script. Do not use quotes around the string or leave whitespace between the @@ and filename. RMAN processes the specified file as if its contents had appeared in place of the @@ command.

Note: The file must contain only complete Recovery Manager commands. A syntax error will result if the file contains a partial command  

Examples

Creating a Script

This example creates a script called B_WHOLE_10 that backs up the database and archived redo logs, then executes it:

create script b_whole_l0 {
    allocate channel d1 type disk;
    allocate channel d2 type disk;
    allocate channel d3 type disk;
    backup
        incremental level 0
        tag b_whole_l0
        filesperset 6          
        database;
    sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
    backup
        filesperset 20
        archivelog all
        delete input;
}

RMAN-03022: compiling command: create script
RMAN-03023: executing command: create script
RMAN-08085: created script b_whole_10

run { execute script b_whole_10; }

Related Topics

"deleteScript"

"printScript"

"replaceScript"

"run"




Prev

Top

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index