problem:
12.2 dg customer environment prepared by the library environment, regularly clean up the archive script does not properly clean up the archive log files.
Observe the log information can be found as follows
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process .
Under normal circumstances, if the standby database environment or the main library environment, to clean up after you configure archiving measure, DG environment is not archived applications will not be deleted.
The investigation and clean-up RMAN default archive policy and can not delete archive logs DG in view v $ archived_log applied as YES
MOS match
RMAN-08137 while Deleting Archived Logs from Standby (文档 ID 2169282.1)
CAUSE
log_archive_dest_2 on standby which points to primary database was deferred :
log_archive_dest_2 <SERVICE_NAME> ASYNC NOAFFIRM valid_for=(online_logfile,primary_role) db_unique_name=<SERVICE_NAME>
log_archive_dest_state_2= DEFER
This is functionality change in Oracle12c with fix of <bug 16082541>: RMAN DELETES ARCHIVELOGS WHICH HAVE NOT BEEN APPLIED TO A DEFERRED STANDBY
SOLUTION
1. Enable the destination:
SQL>alter system set log_archive_dest_state_2 = ENABLE;
Once destination 2 is enabled , then Please run the archivelog deletion command on standby from RMAN .
2. If the destination should not be considered, unset the destination rather setting it's state to DEFER.
Actual discovery, DG configure the remote archiving parameters, pointing to the main library, archive and remote thread state to DEFER, according to documents prompted, modified after ENABLE, performed manually archive cleanup script properly.