The continuously transferred redo transaction is archived at the standby database before or after being applied, depending on the configuration. At the end, we're faced with lots of files filling the log destination either on the filesystem or ASM disk group. We need to build an automatic structure on the standby site, where applied archived logs are deleted automatically based on a specific logic.
There are several methods for archived log deletion. It's possible to delete archived logs with the rm
command of the operation system or ASM. However, if we use rm
, the control file will not be updated about the deletion of archived logfiles. Thus, in order to update the control file with the deletion operation, we must run crosscheck
and delete expired RMAN
commands as follows:
RMAN> crosscheck archivelog all; RMAN> delete expired archivelog all;
Another option is scheduling an RMAN
job that deletes applied archived logs on the standby database. The RMAN
command's delete archivelog
command updates the control file related to the delete
operation. This method is easier than using the rm
command; however, for both methods we have a job-maintenance issue. If the scheduled job doesn't run for some reason, the log destination will fill up and manual operation will be required.
The recommended method to keep deleting the archived logfiles on standby databases is simply leaving this task to Oracle. We use the fast recovery area for this purpose.