Databases Reference
In-Depth Information
Updating Stored Scripts
Problem
You want to update a stored script, one that you've stored in a recovery catalog, with new code.
Solution
There is no concept of a line-by-line update to a stored script. You have to replace the entire stored script with a new
code. To update a script, issue the replace script command followed by new code that you want for the script, as
shown here:
RMAN> replace script full_disk_db
2> {
3> allocate channel c1 type disk
4> format 'c:\backup\rman_%U.rman';
5> backup
6> database
7> include current controlfile;
8> release channel c1;
9> }
replaced script full_disk_db
The script is now replaced by the new code. Remember, you have to replace the entire script.
How It Works
The replace script action essentially re-creates the same script. Therefore, the same restrictions applicable to
creating a script apply here, too. Check the “How It Works” section of Recipe 9-7 to learn about those restrictions.
The replace script command replaces the script in the catalog without leaving behind a copy in some manner.
This may not be acceptable to you. You may want to get a copy of the script, and edit that, while the older version of
the copy serves as a backup. See Recipe 9-16 on how to accomplish that.
Commenting on Stored Scripts
Problem
You want to save a comment along with a stored script so you have something to help you remember what that script
does when you return to it potentially months later.
Solution
To associate a comment with a script, use the optional comment clause in the command to create (or to replace) that
script. Enclose your comment within single quotes, as shown here:
RMAN> create script full_disk_db
2> comment 'Full Backup as Backupset to Disk'
3> {
4> allocate channel c1 type disk
 
Search WWH ::




Custom Search