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

From: Chris Taylor <christopherdtaylor1994_at_gmail.com>
Date: Sun, 28 Oct 2018 09:54:31 -0500
Message-ID: <CAP79kiRgeM4DaadSk4yu63zUcW4f8dWB4O3cRhpN7B7AMVbbwg_at_mail.gmail.com>



Because I have archivelogs already in HP-MSA location - so if I don't use the "LIKE" clause, it will try to move the archivelogs already in HP-MSA to the same location (I think - I haven't tested it).

So right now:

Archivelog Locations:
/HP-MSA-MIA/orabackup/archivelog/ --- Contains lots of archivelogs as this was the first location I wanted to write to starting this weekend but proved too slow
/dpdump/archivelog - Flash storage and contains logs starting yesterday but is smaller storage area

If I don't do the "LIKE" I believe it will "move" the archivelogs already in /HP-MSA-MIA to a new name - if it does a "move" versus a "copy" that would be ok as it would be quick, but if it does a "copy and then delete" which I'm almost 100% certain it does, then that's no good.

Right now I'm working around it with this and completely manual moves:

# Sequence numbers here are in the dpdump location starting from earliest # Takes 17 minutes to copy each archivelog to the HP storage backup as copy archivelog from sequence 263685 until sequence 263700 thread 3 format '/HP-MSA-MIA/orabackup/archivelog/%U' delete input;

For the above, I have query the db to find the sequence #s and manually update the script and kick it off manually and was hoping to be able to use a SYSDATE-6/24 to keep a rolling window of logs moving to the HP storage.

Chris

On Sun, Oct 28, 2018 at 9:47 AM Hemant K Chitale <hemantkchitale_at_gmail.com> wrote:

>
> Why do you need the LIKE clause. SET UNTIL SEQUENCE or TIME or UNTIL
> TIME or COMPLETED BEFORE would identify the archivelogs required. My
> guess is that the LIKE clause does an override
>
> Hemant K Chitale
>
>
>
>
> On Sun, Oct 28, 2018 at 10:38 PM Chris Taylor <
> christopherdtaylor1994_at_gmail.com> wrote:
>
>> 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
>>
>>
>>

--
http://www.freelists.org/webpage/oracle-l
Received on Sun Oct 28 2018 - 15:54:31 CET

Original text of this message