Re: 11g RMAN backup archive logs, delete options

  • From: LS Cheng <exriscer@xxxxxxxxx>
  • To: Edgar Chupit <chupit@xxxxxxxxx>
  • Date: Thu, 19 May 2011 14:03:58 +0200

sorry forgot to say you have to use here-document in unix

something like


RMAN_LOG="${BACKUP_PATH}/rman_maintenance_${DATABASE_NAME}_${BACKUP_DATE}.log"
RETENTION_ARCH=3

rman log=${RMAN_LOG} << !
connect target /
DELETE NOPROMPT ARCHIVELOG ALL BACKED UP 1 TIMES TO DISK COMPLETED BEFORE
'SYSDATE - ${RETENTION_ARCH}';
!




On Thu, May 19, 2011 at 12:34 PM, Edgar Chupit <chupit@xxxxxxxxx> wrote:

> I tried using environment variables in my rman scripts before and it never
> worked. I remember that I even found metalink note that environments
> variables are not supported from rman.
>
> is it really working on your side?
>
> $ export RETENTION_ARCH=7
> $ echo ${RETENTION_ARCH}
> 7
> $ rman target /
>
> Recovery Manager: Release 11.2.0.2.0 - Production on Thu May 19 12:33:20
> 2011
>
> Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights
> reserved.
>
> connected to target database: TEST (DBID=711092535)
>
> RMAN>  list ARCHIVELOG ALL BACKED UP 1 TIMES TO DISK COMPLETED BEFORE
> 'SYSDATE - ${RETENTION_ARCH}';
>
> using target database control file instead of recovery catalog
>
> DBGSQL:     TARGET> select SYSDATE - ${RETENTION_ARCH} from sys.dual
> DBGSQL:        sqlcode = 911
> RMAN-00571: ===========================================================
> RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
> RMAN-00571: ===========================================================
> RMAN-03002: failure of list command at 05/19/2011 12:33:24
> ORA-01858: a non-numeric character was found where a numeric was expected
>
>
> Best regards,
>  Edgar Chupit
>  callto://edgar.chupit
>
>
>
> On Wed, May 18, 2011 at 9:22 PM, LS Cheng <exriscer@xxxxxxxxx> wrote:
>
>> DELETE NOPROMPT ARCHIVELOG ALL BACKED UP 1 TIMES TO DISK COMPLETED BEFORE
>> 'SYSDATE - ${RETENTION_ARCH}';
>>
>>
>> On Wed, May 18, 2011 at 9:12 PM, CRISLER, JON A (ATTCORP) <JC1706@xxxxxxx
>> > wrote:
>>
>>>  I want to combine the functions of deleting archive logs based on date
>>> AND that they have been backed up already.  Is this possible ?
>>>
>>>
>>>
>>> For instance this will delete all the archive logs backed up (regulated
>>> by rman archive log deletion policy)
>>>
>>>
>>>
>>> Run {
>>>
>>> backup as compressed backupset
>>>
>>> archivelog all
>>>
>>> delete all input;
>>>
>>> }
>>>
>>>
>>>
>>> This would delete archive logs-
>>>
>>>
>>>
>>> delete archivelog all completed before 'sysdate -7';
>>>
>>>
>>>
>>> What I am looking for is deleting them based on date, and that they have
>>> been backed up.
>>>
>>
>>
>

Other related posts: