cancel
Showing results for 
Search instead for 
Did you mean: 

Oracle agent archivelog question

David_McWilli1
Level 3
Is the NBU Agent for Oracle supposed to delete the archivelog files after a successful backup? If so, why isn't mine?.....

Any answers greatly appreciated.

David
3 REPLIES 3

David_McWilli1
Level 3
I think I'm just seeing old archivelog files from when a previous DBA was buggering about with it.

patrickkuah
Level 6
yes...provided that you added "ARCHIVELOG ALL DELETE INPUT;" in your RMAN script. Below is my example (Full Backup of the database) which generated using the Oracle template wizard in NBU.


RUN {
ALLOCATE CHANNEL ch00
TYPE 'SBT_TAPE';
SEND 'NB_ORA_CLIENT=ORADB1,NB_ORA_SERV=NBUSVR1';
BACKUP
INCREMENTAL LEVEL=0
FORMAT 'bk_u%u_s%s_p%p_t%t'
DATABASE;

RELEASE CHANNEL ch00;

# Backup Archived Logs
sql 'alter system archive log current';

ALLOCATE CHANNEL ch00
TYPE 'SBT_TAPE';
SEND 'NB_ORA_CLIENT=ORADB1,NB_ORA_SERV=NBUSVR1';
BACKUP
FORMAT 'arch-s%s-p%p-t%t'
ARCHIVELOG
ALL
DELETE INPUT;

RELEASE CHANNEL ch00;

# Control file backup

ALLOCATE CHANNEL ch00
TYPE 'SBT_TAPE';
SEND 'NB_ORA_CLIENT=ORADB1,NB_ORA_SERV=NBUSVR1';
BACKUP
FORMAT 'bk_u%u_s%s_p%p_t%t'
CURRENT CONTROLFILE;
RELEASE CHANNEL ch00;
}


Hope this helps....


cheeers!!!
patrick

Richard_Bannist
Level 5
mine are similar to previous poster (this is 9i) -

run {
allocate channel t1 type 'sbt_tape';
allocate channel t2 type 'sbt_tape';
allocate channel t3 type 'sbt_tape';

resync catalog;

# Backup the Database, control file, archivelogs, then deletes 1 copy of archive logs.
backup full database plus archivelog delete input;

release channel t1;
release channel t2;
release channel t3;
}


Now we have 2 concurrent archivelog destinations, so each time the archivelog delete is done it deletes a log from either location, then next time it runs it will delete the same archlog from other destination. I've been watching this since back in 8i and it's still not 100% accurate, ie it will always leave the odd straggler behind now and then. no big deal though.


in 8i we did this -

run {
allocate channel t1 type 'sbt_tape';
allocate channel t2 type 'sbt_tape';
allocate channel t3 type 'sbt_tape';

resync catalog;

change archivelog all crosscheck;

# Backup the Database
backup incremental level 0 database;

sql 'alter system archive log current';

# Backup Archive Logs
backup archivelog until time 'SYSDATE' delete input;

# Backup the control file.
backup current controlfile;

release channel t1;
release channel t2;
release channel t3;
}