Oracle9i Recovery Manager Reference Release 2 (9.2) Part Number A96565-01 |
|
RMAN Commands , 43 of 59
See Also:
The syntax diagrams for "RUN" to determine which commands are included in the |
To replace an existing script stored in the recovery catalog. If the script does not exist, then REPLACE
SCRIPT
creates it.
The stored script feature is provided primarily to 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 to run it.
See Also:
|
REPLACE
SCRIPT
only at the RMAN prompt.CATALOG
command-line option or the CONNECT
CATALOG
command, and the catalog database must be open.REPLACE
SCRIPT
once to create a script and then use this same script on multiple target databases. You must connect to a specific target database and then run REPLACE
SCRIPT
to create a script for this specific target. Each script is associated with one and only one target database.@
and @@
commands do not work within REPLACE
SCRIPT
.For descriptions of the individual commands that you can use in a stored script, refer to the appropriate entry, for example, "BACKUP".
Syntax Element | Description |
---|---|
|
Replaces the specified stored script with the new commands. The statements allowable within the parentheses of the To obtain a listing of all stored scripts, use SQL*Plus to connect to the recovery catalog database as the catalog owner and issue the following query: SELECT * FROM RC_STORED_SCRIPT; Note: To run the script, issue See Also: "RC_STORED_SCRIPT" for more information about |
This example creates two distinct recovery catalog scripts called backup_full
. Each script has different content and is associated with a different target database:
#!/usr/bin/tcsh rman TARGET SYS/oracle@prod1 CATALOG rman/rman@catdb << SCRIPT1 # Create a script called backup_full that you can use to back up target # database prod1. If a script already exists with the name backup_full, # then this command overwrites it. REPLACE SCRIPT backup_full { # uses configured channel for default device type BACKUP DATABASE; } EXIT SCRIPT1 rman TARGET SYS/oracle2@prod2 CATALOG rman/rman@catdb <<SCRIPT2 # Creates a new script backup_full on database prod2. Even though it has the same name, # this script is different from the backup_full script created on prod1 in the preceding # example. Each catalog script is associated with one and only one target database. REPLACE SCRIPT backup_full { # uses configured sbt channel BACKUP DEVICE TYPE sbt DATABASE PLUS ARCHIVELOG; } # runs the backup_full script RUN { EXECUTE SCRIPT backup_full; } EXIT SCRIPT2
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|