Database Reference
In-Depth Information
Printing Stored Scripts
The PRINT SCRIPT command will print your script to the standard output device, allowing
you to cut and paste its contents. Here is an example of the PRINT SCRIPT command:
RMAN> Print script db_delete_obsolete;
printing stored script: db_delete_obsolete
{ delete obsolete;}
Using Script Substitution Variables
Oracle Database 12 c provides for the use of substitution variables in RMAN scripts or
command files. You define the substitution variables using the ampersand (&) character
followed by a number, as shown in this example:
Restore database from tag &1;
The RMAN executable includes the USING command-line parameter that allows you to
define the value of the substitution variable. For example, if the previous RESTORE command
were in a file called restore.cmd and you wanted to restore a backup with the tag MINE ,
you would call RMAN in this manner:
Rman target=/ @restore.cmd using MINE
You can also use substitution variables with stored scripts. For example, you can create a
script to back up your database and use a tag, as shown here:
RMAN> create script db_backup_script
2> { backup database tag '&1' plus archivelog delete input;}
Enter value for 1: test
created script db_backup_script
You can then execute the script, setting the variable with the USING command, as
shown here:
RMAN> Run {execute script db_backup_script using 'TEST';}
Maintaining the Recovery Catalog
If you are running the recovery catalog, you will need to know how to synchronize it with
the control file of the database. Additionally, you will need to back up the recovery catalog.
We briefly cover these two topics next.
Search WWH ::




Custom Search