Please enter search query.
Search <product_name> all support & community content...
Oracle policy does not delete the archive logs even though 'delete archive logs after one attempt' is selected in the policy
Article: 100033560
Last Published: 2017-01-30
Ratings: 2 0
Product(s): NetBackup & Alta Data Protection
Problem
When an Oracle backup is run, via script or Oracle Intelligent Policy (OIP), and it is specified that the archive logs should be deleted after two or three successful attempts, the archive logs are not being deleted. But if the policy is changed to delete after one backup, the archive logs will be successfully deleted.As an example, in the script below it is specified to delete archive logs after being backed up 2 times. After the second backup of the archive logs the logs should be deleted.
ALLOCATE CHANNEL ch00
TYPE 'SBT_TAPE'
PARMS 'SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64.1';
SEND 'NB_ORA_CLIENT=xxxx,NB_ORA_SID=xxx,NB_ORA_SERV=xxxxx,NB_ORA_POLICY=policy-xxx';
BACKUP
FORMAT 'arch_d%d_u%u_s%s_p%p_t%t'
ARCHIVELOG
ALL;
DELETE ARCHIVELOG ALL BACKED UP 2 TIMES to DEVICE TYPE sbt;
RELEASE CHANNEL ch00;
Error Message
The following may be seen in the dbclient debug log on the Oracle client:The second attempt of the job was successful, but the archive logs were not deleted.
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/archlogs/xxx/xxx_1_17775_893757869.dbf thread=1 sequence=17775
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/archlogs/xxx/xxx_1_17776_893757869.dbf thread=1 sequence=17776
RMAN-08138: WARNING: archived log not deleted - must create more backups
Even though two backups have been completed, RMAN keeps repeating the warning and does not delete the archive logs. This will result in archive logs using up a lot of disk space.
Cause
The Oracle setting Backup Optimization for the database was set to ON. When the Oracle Backup Optimization feature is turned ON this instructs RMAN that if during a backup it encounters a file that is identical to a file already backed up previously then it is skipped. Since Archive log files do not change after they are created, RMAN will back the file up the first time it is asked to, but will skip it on every other backup after that, because it is identical to a file RMAN already has backed up. This means the archive log file will only ever be backed up once by RMAN. If the Oracle backup running via a script or Oracle Intelligent Policy (OIP) is setup to delete archive logs after being backed up 2 times or more, then the deletion will never occur because the file will be backed up only once and not 2 or more times. Due to this the archive log file will only be deleted after one copy is backed up. In the script or OIP, if it is set to delete logs after 1 backup, RMAN will delete them. But if the value for the number of backups before deletion is increased to more than one, then with backup optimization turned ON this will not allow the deletion to occur.Solution
Contact Oracle support, and set backup optimization for database to OFF. After this, the archive logs will be deleted.If backup optimization cannot be set to OFF, then modify the script and select the value to delete archive logs after one backup.
More information can be found at:
http://docs.oracle.com/cd/B28359_01/backup.111/b28270/rcmconfb.htm#BRADV89428