Databases Reference
In-Depth Information
2.
The command file shown here will back up the database using two substitution variables
(&1 and &2 ), one for the backup tag and the other for the string value in the format
specification.
3.
Create the shell script to run the backup command file you created in step 1:
#!/bin/ksh
# script name: nightly_backup.sh
set tag=$argv[1]
set format=$argv[2]
rman @backup.cmd using $tag $format
4.
Now that you have created a dynamic shell script, you can specify the arguments for
the tag and format variables on the command line, thus being able to modify them for
different jobs. Here's an example:
$ nightly_backup.sh longterm_backup back0420
The example shows how to execute the shell script nightly_backup.sh with two dynamic parameters, longterm_
backup ( tag ) and back0420 ( format string).
How It Works
The ability to use substitution variables in RMAN scripts is new in Oracle Database 11 g . The use of substitution
variables in RMAN scripts is similar to the way you specify substitution variables in operating system and SQL*Plus
scripts. Specifying substitution variables lets you use the same command file by modifying it appropriately for
different backup tasks, thus making the command file dynamic.
Connecting to an Auxiliary Database
Problem
You need to connect to an auxiliary database to duplicate a database or to perform a tablespace point-in-time
recovery.
Solution
You can connect to an auxiliary instance either from the operating system command line or from the RMAN prompt.
To connect to an auxiliary database instance from the operating system command line, simply replace the usual
keyword target with the keyword auxiliary , as shown here:
$ rman auxiliary sys/<sys_password>@aux
You can also start the RMAN client first and then connect to the auxiliary instance from the RMAN prompt, as
shown in this example:
$ rman
RMAN> connect auxiliary sys/<sys_password>@aux
 
Search WWH ::




Custom Search