Storing a Script
To store a script you need to connect to both the catalog and the target. You need to connect to the catalog so that RMAN knows where to store the scripts, and you need to connect to the target so that RMAN knows which target database the stored script is associated with.
Once a connection to the target and catalog is established, you can store a script using either the create script or replace script commands. The replace script command creates a new script or replaces a previously stored script by the name under which you store the script. The following example creates a script to do a full backup of a database:
$rman target / catalog rman_901/rman_901_pwd@rman_catalogRecovery Manager: Release 9.0.1.0.0 - Production connected to target database: BRDSTN (DBID=664610428) connected to recovery catalog database RMAN>replace script full_back{2>allocate channel d1 type disk;3>backup full format4>'/d0102/backup/rman_%d_%U.bus' database;5>}replaced script full_back
This stores the script, which is named full_back, in the catalog. This does not execute the script. To run the commands that you’ve just stored, you need to execute the script.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access