RMAN "backup as copy" + until time (or COMPLETED BEFORE) Question

  • From: Chris Taylor <christopherdtaylor1994@xxxxxxxxx>
  • To: ORACLE-L <oracle-l@xxxxxxxxxxxxx>
  • Date: Sun, 28 Oct 2018 09:35:32 -0500

Does anyone know how to combine the "backup as copy" PLUS an until time?

Oracle 12.1.0.2

Long story short:
We are doing a process that generates a ton of archivelogs in DEST_ID=1 and
we have to save these archivelogs.  (Multiple days)

I need to run a periodic RMAN job to MOVE the archivelogs from DEST_ID=1 to
a backup destination WITHOUT backing them up - only MOVE them.

So, enter "BACKUP AS COPY" like this:
backup as copy archivelog like '/dpdump/archivelog/%' format
'/HP-MSA-MIA/orabackup/archivelog/%U' delete input;

(The secondary location (HP-MSA) is too slow to use for the primary
destination but works fine as a dumping ground)

However, this script wants to backup ALL the archivelogs instead of just
the ones completed before the UNTIL TIME:

/* This is a handful of logs as a test case */
run
{
  set until time "sysdate-1";
  backup as copy archivelog like '/dpdump/archivelog/%' format
'/HP-MSA-MIA/orabackup/archivelog/%U' delete input;
}

Basically, what I WANT to do is this but I can't combine the 'COMPLETED
BEFORE' with the COPY command:

{rman command that does NOT work}

backup as copy archivelog like '/dpdump/archivelog/%' format
'/HP-MSA-MIA/orabackup/archivelog/%U' COMPLETED BEFORE 'SYSDATE-1' delete
input;

*RMAN-01009: syntax error: found "completed": expecting one of:
"archivelog  *

Same with:
backup as copy archivelog like '/dpdump/archivelog/%'  COMPLETED BEFORE
'sysdate-1'  format '/HP-MSA-MIA/orabackup/archivelog/%U' delete input

I  would have thought the 'SET UNTIL TIME' would give me what I want but it
doesn't.

Any thoughts/suggestions on how to combine the two?

Thanks,
Chris

Other related posts: