Databases Reference
In-Depth Information
... output truncated ...
connected to target database: IDB1 (DBID=420374953)
RMAN> { delete archivelog sequence 36 ; }
2>
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
deleted archived log
archived log file name=+FRA/idb1/archivelog/2012_08_06/thread_1_seq_36.376.790643975 RECID=27
STAMP=790643975
Deleted 1 objects
Recovery Manager complete.
How It Works
The parameters in the script are positional, which is similar to the parameters in a Unix shell script or a SQL*Plus
script. You name the parameters &1 , &2 , and so on, and pass the values to these parameters in the same order. For
instance, here is an example of a script file that accepts two parameters:
run { delete &2 archivelog sequence &1 ; }
Name the script file delete_arc_logs.rman. Now call the script with the second parameter as noprompt , which is a
character string. You can pass the characters by enclosing them in single quotes:
C:\tools>rman target=/ @c:\tools\delete_arc_logs.rman using 36 'noprompt'
... output truncated ...
connected to target database: MOBDB11 (DBID=406156306)
RMAN> { delete noprompt archivelog sequence 36 ; }
2>
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=127 device type=DISK
... and so on ...
If you need to replace the part of a string with the value of the parameter, you can use a period to separate the
string from the value passed. For instance, if you want to delete archived redo logs matching a pattern, you can create
the script file with the contents, as shown here:
run { delete archivelog like '%&1%' ; }
Note how the pattern has been specified as %&1.% . The second % character is separated from the &1 by a period.
Name this file del_arc_logs_pattern.rman. Now you can call this script file to delete the archived redo logs matching
the pattern %2012_08_08% :
C:\tools>rman target=/ @c:\tools\del_arc_logs_pattern.rman using '2012_08_08'
 
Search WWH ::




Custom Search