Oracle8i Backup and Recovery Guide Release 8.1.5 A67773-01 |
|
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.
Note the following restrictions:
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., 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., Note: The file must contain only complete Recovery Manager commands. A syntax error will result if the file contains a partial command |
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; }