295.Which statement about using RMAN stored scripts is true?
A. To create and execute an RMAN stored script, you must use a recovery catalog.
B. When executing a stored script and a command fails, the remainder of the script is executed, and a
message is written to the alert log file.
C. RMAN stored scripts can always be executed against any target database that is registered in the
recovery catalog.
D. When you execute a stored script, it always executes using the persistent channel settings previously
set with the CONFIGURE command.
Answer: AManaging Stored Scripts
As explained in "About Stored Scripts", you can store scripts in the recovery catalog. This section explains how to create and manage stored scripts.
About Stored Scripts
You can use a stored script as an alternative to a command file for managing frequently used sequences of RMAN commands. The script is stored in the recovery catalog rather than on the file system.
Stored scripts can be local or global. A local script is associated with the target database to which RMAN is connected when the script is created, and can only be executed when you are connected to that target database. A global stored script can be run against any database registered in the recovery catalog, if the RMAN client is connected to the recovery catalog and a target database.
The commands allowable within the brackets of the CREATE SCRIPT
command are the same commands supported within a RUN
block. Any command that is legal within a RUN
command is permitted in
the stored script. The following commands are not legal within stored scripts: RUN
, @
, and @@
.
When specifying a script name, RMAN permits but generally does not require that you use quotes around the name of a stored script. If the name begins with a digit or is an RMAN reserved word, however, then you must put quotes around the name to use it as a stored script name. Consider avoiding stored script names that begin with nonalphabetic characters or that are the same as RMAN reserved words.
Consider using a naming convention to avoid confusion between global and local stored scripts. For the EXECUTE SCRIPT
, DELETE SCRIPT
and PRINT SCRIPT
commands, if the script name passed as
an argument is not the name of a script defined for the connected target instance, then RMAN looks for a global script by the same name. For example, if the global script global_backup
is in the recovery catalog, but no local stored script global_backup
is
defined for the target database, then the following command deletes the global script:
To use commands related to stored scripts, even global scripts, you must be connected to both a recovery catalog and a target database instance.