Oracle® Database Recovery Manager Reference 10g Release 1 (10.1) Part Number B10770-01 |
|
|
View PDF |
createScript::=
Text description of createScript
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:
PRINT SCRIPT
command is used to view the contents of a stored script.REPLACE SCRIPT
command is used to update the contents of a stored script.EXECUTE SCRIPT
command is used to execute the commands in the stored script.SCRIPT
command line arguments for RMAN (described in "cmdLine"
) runs a stored script automatically when starting RMAN.LIST SCRIPT NAMES
command is used to find out what stored scripts are defined for the current target database and recovery catalog.DELETE SCRIPT
command is used to delete a stored script from the recovery catalog.
See Also:
Oracle Database Backup and Recovery Advanced User's Guide to learn how to use stored scripts |
Note the following restrictions:
CREATE
SCRIPT
only at the RMAN prompt, not within a RUN block.CREATE
SCRIPT
once to create a local script, and then use this same script on multiple target databases. If you want to create a global script, you must connect to some target database (as well as a recovery catalog) and then use CREATE GLOBAL SCRIPT
instead of CREATE SCRIPT
.RUN
command within a stored script.@
and @@
commands do not work within CREATE
SCRIPT
.RMAN-20401: script already exists
if you try to create a local script when another local script already exists for the same target database with the same name. The same error is returned if you try to create a global script and a global script already exists with the same name in the recovery catalog. If the script already exists, you must use REPLACE SCRIPT
to update its contents.Syntax Element | Description |
---|---|
|
Identifies the script being created as global. If omitted, RMAN creates a local stored script |
|
The name of the script to create. |
|
Associates an explanatory comment with the stored script in the catalog. |
|
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 ' |
|
Commands valid in a stored script. The statements allowable within the brackets of the |
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; }
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; }