ORACLE_RMAN_delete archivelog in the primary database
About RMAN-08137, please refer to :
1. Case 1
Check that the standby database is uptodate - if not, restartmanaged recovery and resolve the gap first then query the Primaryv$archived_log view again for any log sequences that still have applied='NO'.
If you still have logs with applied='NO' and you are certain that these logshas been applied at standby and there is no 'gap', you need to remove theentries from the rman repository:
a. check that the physical files still exist on disk and if they do, usean OS command to delete them
b. run crosschek followed by delete expired to remove them from the rmanrepository
RMAN>crosscheckarchivelog all;
RMAN>delete expired archivelog all;
Once the problematic log(s) have been removed from the rman repositoryyou can resume normal use of 'delete input' option on the backup command.
2. Case 2
RMAN is used to backup archivelogs fromPrimary site using the syntax:
backup archivelog ...... delete input;
All logs are backed up successfully but not deleted; for each log the
following error is returned:
RMAN-8137: WARNING: archive log not deleted as it is still needed
archive log filename=<log> thread=<thrd> sequence=<seq>
The archivelogs have definitely been shipped and applied to standby site
which runs in maximum availability mode.
No logs are being deleted from Primary site after backup leaving the database
at risk of going down if the archivelog directory fills.
Logs have to be deleted manually.
WORKAROUND:
-----------
Donot use DELETE INPUT option when backing up logs in a Data Guard environment.
Use instead (for example):
backup ARCHIVELOG UNTIL TIME '<date>' not backed up 1 times to devicetype
sbt;
delete archivelog until time '<date>' backed up 1 times to device typesbt;
Just a case:
delete noprompt archivelog until time'sysdate -1' backed up 1 times to device type sbt;
Or
run{
ALLOCATE CHANNEL FOR MAINTENANCE TYPEDISK;
crosscheck archivelog all;
delete noprompt archivelog until time 'sysdate -1' backed up1 times to device type sbt;
delete noprompt archivelog until time 'sysdate -1' backed up1 times to device type disk;
release channel;
}