Databases Reference
In-Depth Information
executing script: del_arc_spec
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=36 device type=DISK
List of Archived Log Copies for database with db_unique_name IDB1
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
316 1 37 A 06-AUG-12
Name: +FRA/idb1/archivelog/2012_08_06/thread_1_seq_37.375.790644523
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archived log
archived log file name=+FRA/idb1/archivelog/2012_08_06/thread_1_seq_37.375.790644523 RECID=28
STAMP=790644522
Deleted 1 objects
Recovery Manager complete.
How It Works
The parameterized stored scripts work with positional parameters the same way SQL*Plus does. The parameters are
named &1 , &2 , and so on, relating to their relative positions.
If you need to pass a character value to a parameter, you should use single quotes around the value passed. Here
is how you can create a script that expects a character argument:
RMAN> replace script delete_archive_log { delete &2 archivelog sequence &1 ; }
Enter value for 2: noprompt
Enter value for 1: 1
replaced script delete_archive_log
Now you can call this stored script as follows:
RMAN> run {execute script delete_archive_log using 36 'noprompt'; }
executing script: delete_archive_log
... 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
name from the value passed. For instance, if you want to delete archived redo logs matching a pattern, you can create
the script as follows:
RMAN> create script del_arc_log_pattern {
2> delete archivelog like '%&1.%'; }
 
Search WWH ::




Custom Search