Database Reference
In-Depth Information
You could use the “backed up n times” policy instead to get more control over the deletion process. An archived
log will only be deleted if the specified n copies to the required medium-tape or disk.
The “applied to/shipped to standby” policies are very useful to manage space pressure. When selecting the
“applied on all standby” policy archived logs will be deleted only if the archived redo logs have actually been applied
on all standby databases. Conversely, the “shipped to all standby” policy will mark archived redo logs eligible for
deletion after they have been transferred to the remote destination.
Oracle's recommendation with regard to these policies has been defined in the Maximum Availability
Architecture as follows:
If you are backing up archived logs on the primary, consider setting the log archive deletion
policy to “none” or “backed up n times”, depending on your company's backup standards.
The same policies should be considered for a standby database if the standby is the source for
backups.
If not backing up on a particular standby database consider setting the log deletion policy to
“applied on all standby.”
The following example clarifies the point. The current space usage in the Fast Recovery Area can be queried from
within a database:
SQL> select * from v$flash_recovery_area_usage;
FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES CON_ID
----------------------- ------------------ ------------------------- --------------- ----------
CONTROL FILE .38 0 1 0
REDO LOG 71.44 0 7 0
ARCHIVED LOG 1.42 0 11 0
BACKUP PIECE .38 0 1 0
IMAGE COPY 0 0 0 0
FLASHBACK LOG 0 0 0 0
FOREIGN ARCHIVED LOG 0 0 0 0
AUXILIARY DATAFILE COPY 0 0 0 0
8 rows selected.
You can see that the FRA—which had its size artificially reduced—has significant space pressure. In the next
few minutes a few forced log switches on the primary increased this even further. But luckily the standby database is
applying the logs in Real Time Apply, so the logs do not need to stay on disk for long. And indeed, thanks to the log
deletion policy chosen—applied on all standby—the Oracle Managed Files are purged from the FRA as soon as they
are no longer needed. This is reflected in the alert.log of the standby database:
[oracle@server1 trace]$ grep "Deleted Oracle managed" alert_CDB1DCA.log
Deleted Oracle managed file +RECO/CDB1DCA/ARCHIVELOG/2013_09_16/thread_1_seq_6.257.826281897
Deleted Oracle managed file +RECO/CDB1DCA/ARCHIVELOG/2013_09_16/thread_1_seq_7.264.826281945
Deleted Oracle managed file +RECO/CDB1DCA/ARCHIVELOG/2013_09_16/thread_1_seq_8.269.826300853
Querying the space usage again you see that the space used by the archived logs as well as the number of
archived logs has changed.
SQL> select file_type,percent_space_used,percent_space_reclaimable,number_of_files
2 from V$RECOVERY_AREA_USAGE;
 
Search WWH ::




Custom Search