Professional Documents
Culture Documents
# Arch_Extract.rcv
#
# DESCRIPTION
# This script may be used to extract the Archive log files from the backup
piece.
#
# CREATED
# 05/23/04 - Mark Mendonca
#
# MODIFIED (MM/DD/YY)
run{
allocate clone channel c1 type disk;
allocate clone channel c2 type disk;
set newname for datafile 17
to '/recover/scratch/RMAN1A/CLONE1A/oradata/si2_RMAN1A_01.dbf';
recover tablespace users
until time "to_date('March-26-2004:15:20:00','Month-DD-YYYY:HH24:MI:SS')";}
Though it is more likely that you will use TSPITR to recover to a date and time,
you can use the syntax below to recover to a specific log sequence number.
run{
allocate clone channel c1 type disk;
allocate clone channel c2 type disk;
set newname for datafile 17
to '/recover/scratch/RMAN1A/CLONE1A/oradata/si2_RMAN1A_01.dbf';
recover tablespace SI1
until logseq 13 thread 1;}
DECLARE
v_dev varchar2(50); -- device type allocated for restore
v_done boolean:=false; -- has the log been fully extracted yet
type t_fileTable is table of varchar2(255) index by binary_integer;
v_fileTable t_fileTable; -- Stores the backuppiece names
v_maxPieces number:=1; -- Number of backuppieces in backupset
BEGIN
v_fileTable(1):='al_s20_p1';
v_fileTable(2):='al_s20_p2';
v_maxPieces:=2;
v_dev:=sys.dbms_backup_restore.deviceAllocate(type=>'sbt_tape',
ident=>'t1');
sys.dbms_backup_restore.restoreSetArchivedLog(destination=>'/support2/OFA_V804/app/
oracle/admin/arch/arch_');
sys.dbms_backup_restore.restoreArchivedLog(thread=>1,
sequence=>100);
<<all_done>>
-- Deallocate the device
sys.dbms_backup_restore.deviceDeallocate;
END;
/