How is the space pressure managed in the Flash Recovery Area - An Example. (文档 ID 315098.1)

来源:互联网 发布:音乐喷泉制作软件 编辑:程序博客网 时间:2024/05/16 01:30

In this Document

 Purpose Scope Details 
How is the space pressure managed in the Flash Recovery Area - Example. References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 9.0.1.0 to 11.2.0.3 [Release 9.0.1 to 11.2]
Information in this document applies to any platform.
**Checked for relevance on 26-Mar-2012***


PURPOSE

This article explains the handling of space pressure in Flash Recovery Area 
by way of an example.

SCOPE

Oracle DBA's

DETAILS


How is the space pressure managed in the Flash Recovery Area - Example.

Space in the fast recovery area is balanced among backups and archived logs that must be kept 
according to the retention policy, and other files that may be subject to deletion. Oracle Database 
does not delete eligible files from the fast recovery area until the space must be reclaimed for 
some other purpose. Files recently moved to tape are often still available on disk for use in recovery. 
The recovery area can thus serve as a cache for tape. When the fast recovery area is full, 
Oracle Database automatically deletes eligible files to reclaim space in the recovery area as needed.


This note/example below describes actions which can be done if for any reason FRA runs out of space
because automatic deletion of files is not possible, due to retention policy or other reason etc.. 

 

 
This testcase has been done with the following configuration:

RMAN> show all;using target database controlfile instead of recovery catalogRMAN configuration parameters are:CONFIGURE RETENTION POLICY TO REDUNDANCY 3;CONFIGURE BACKUP OPTIMIZATION OFF; # defaultCONFIGURE DEFAULT DEVICE TYPE TO DISK;CONFIGURE CONTROLFILE AUTOBACKUP OFF;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # defaultCONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # defaultCONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # defaultCONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # defaultCONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # defaultCONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # defaultCONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS  'SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/tmp/)';CONFIGURE MAXSETSIZE TO UNLIMITED; # defaultCONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # defaultCONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/product/1010/dbs/snapcf_db10g.f'; # default


When the space used in the Flash Recovery Area goes above 85% the we will get 
the following warning in the alert log:

Wed Jun 15 21:51:19 2005  Errors in file /opt/oracle/product/1010/admin/db10g/udump/db10g_ora_13900.trc:  ORA-19815: WARNING: db_recovery_file_dest_size of 1073741824 bytes is 86.07% used,   and has 149591552 remaining bytes available.  ************************************************************************  You have following choices to free up space from flash recovery area:  1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,     then consider changing RMAN ARCHIVELOG DELETION POLICY.  2. Back up files to tertiary device such as tape using RMAN     BACKUP RECOVERY AREA command.  3. Add disk space and increase db_recovery_file_dest_size parameter to     reflect the new space.  4. Delete unnecessary files using RMAN DELETE command. If an operating     system command was used to delete files, then use RMAN CROSSCHECK and     DELETE EXPIRED commands.  ************************************************************************

When the Flash Recovery Area is completely full then we get a error message as follow:

RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03009: failure of backup command on ORA_DISK_1 channel at 06/15/2005 22:39:22ORA-19809: limit exceeded for recovery filesORA-19804: cannot reclaim 52428800 bytes disk space from 1073741824 limit

To make space reclaimable we have the following options:

1) The space occupied by archivelogs created in the Flash Recovery Area 
     would become reclaimable in 2 circumstances:

A) If the free space becomes less then 15% in the Flash Recovery Area then all 
     the archivelogs in the Flash Recovery Area which are not needed for recovery 
     by the current backups in the FRA will become obsolete and the space occupied 
     will be shown in the SPACE RECLAIMABLE column of V$RECOVERY_FILE_DEST.

Output BEFORE free space less than 15%:

SQL> SELECT * FROM V$RECOVERY_FILE_DEST;NAME-------------------------------------------------------------------------SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES----------- ---------- ----------------- ---------------/opt/oracle/product/1010/dbs/ora_flash_area 1073741824  913181184                 0              11


Output AFTER free space less then 15%:(SPACE_RECLAIMABLE column it is now not zero)

SQL> SELECT * FROM V$RECOVERY_FILE_DEST;NAME--------------------------------------------------------------------------------SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES----------- ---------- ----------------- ---------------/opt/oracle/product/1010/dbs/ora_flash_area 1073741824  913181184           2124288              11RMAN> report obsolete;RMAN retention policy will be applied to the commandRMAN retention policy is set to redundancy 3Report of obsolete backups and copiesType                 Key    Completion Time    Filename/Handle-------------------- ------ ------------------ --------------------Archive Log          51     15-JUN-05          /opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_110_1c0mj1b2_.arcArchive Log          52     15-JUN-05          /opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_111_1c0mj8co_.arcArchive Log          53     15-JUN-05          /opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_112_1c0mj9tp_.arcArchive Log          54     15-JUN-05          /opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_113_1c0mjh6j_.arcArchive Log          55     15-JUN-05          /opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_114_1c0mjn90_.arc

B) If the archivelogs have been backed up (either to the Flash Recovery Area itself 
    or to another destination) and the archivelog not deleted. Then the space occupied 
    by that archivelog will be marked as reclaimable.

RMAN> backup archivelog all;Starting backup at 15-JUN-05current log archivedusing channel ORA_DISK_1channel ORA_DISK_1: starting archive log backupsetchannel ORA_DISK_1: specifying archive log(s) in backup setinput archive log thread=1 sequence=110 recid=51 stamp=561071961input archive log thread=1 sequence=111 recid=52 stamp=561071968input archive log thread=1 sequence=112 recid=53 stamp=561071969input archive log thread=1 sequence=113 recid=54 stamp=561071975input archive log thread=1 sequence=114 recid=55 stamp=561071980input archive log thread=1 sequence=115 recid=56 stamp=561074872channel ORA_DISK_1: starting piece 1 at 15-JUN-05channel ORA_DISK_1: finished piece 1 at 15-JUN-05piece handle=/opt/oracle/product/1010/dbs/ora_flash_area/DB10G/backupset/2005_06_15/o1_mf_annnn_TAG20050615T220755_1c0pc73n_.bkp comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:09Finished backup at 15-JUN-05RMAN> report obsolete;RMAN retention policy will be applied to the commandRMAN retention policy is set to redundancy 3Report of obsolete backups and copiesType                 Key    Completion Time    Filename/Handle-------------------- ------ ------------------ --------------------Archive Log          51     15-JUN-05          /opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_110_1c0mj1b2_.arcArchive Log          52     15-JUN-05          /opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_111_1c0mj8co_.arcArchive Log          53     15-JUN-05          /opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_112_1c0mj9tp_.arcArchive Log          54     15-JUN-05          /opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_113_1c0mjh6j_.arcArchive Log          55     15-JUN-05          /opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_114_1c0mjn90_.arcSQL> SELECT * FROM V$RECOVERY_FILE_DEST;NAME---------------------------------------------------------------------SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES----------- ---------- ----------------- ---------------/opt/oracle/product/1010/dbs/ora_flash_area 1073741824  934593024          11767296              13


Here we see that 6 archivelogs have been backed up. Out of the 6 archivelogs 
5 are not needed for recovery and are hence obsolete. But 1 of the archivelogs
is needed for recovery and hence is not shown in the report obsolete. But still 
the space occupied by that archivelog will be added to the reclaimable space.


2) When the Flash Recovery Area is full and there is no space available to 
    create archivelogs in the Flash Recovery Area. We will get the following error
    in the alert log:

Wed Jun 15 23:01:09 2005Errors in file /opt/oracle/product/1010/admin/db10g/udump/db10g_ora_13754.trc:ORA-19809: limit exceeded for recovery filesORA-19804: cannot reclaim 1032704 bytes disk space from 1073741824 limitARCH: Error 19809 Creating archive log file to '/opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_116_0_.arc'ARCH: All standby destinations failed; successful archival assumedARCH: Failed to archive thread 1 sequence 116 (19809)Wed Jun 15 23:01:27 2005ARC1: Evaluating archive thread 1 sequence 116ARC1: Archiving not possible: No primary destinationsARC1: Failed to archive thread 1 sequence 116 (4)ARCH: Archival stopped, error occurred. Will continue retryingWed Jun 15 23:01:27 2005ORACLE Instance db10g - Archival ErrorARCH: Connecting to console port...Wed Jun 15 23:01:27 2005ORA-16014: log 2 sequence# 116 not archived, no available destinationsORA-00312: online log 2 thread 1: '/opt/oracle/product/1010/oradata/db10g/redo02.log'ARCH: Connecting to console port...ARCH:Wed Jun 15 23:01:27 2005ORA-16014: log 2 sequence# 116 not archived, no available destinationsORA-00312: online log 2 thread 1: '/opt/oracle/product/1010/oradata/db10g/redo02.log'


3) To free space in the FRA we could do take a backup of the Flash Recovery Area 
    using the command BACKUP RECOVERY AREA.
    This command will take the backup of al the files in the FRA to tape only. 
    After this the space occupied by the files in the FRA will be marked as reclaimable.

Make sure that you have configured channels for backups to tape for this command to succeed.

RMAN> backup recovery area;Starting backup at 15-JUN-05released channel: ORA_DISK_1using channel ORA_SBT_TAPE_1specification does not match any datafilecopy in the repositorychannel ORA_SBT_TAPE_1: starting archive log backupsetchannel ORA_SBT_TAPE_1: specifying archive log(s) in backup setinput archive log thread=1 sequence=116 recid=57 stamp=561079349channel ORA_SBT_TAPE_1: starting piece 1 at 15-JUN-05channel ORA_SBT_TAPE_1: finished piece 1 at 15-JUN-05piece handle=28gn2p4a_1_1 comment=API Version 2.0,MMS Version 8.1.3.0channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:02input backupset count=58 stamp=561073729 creation_time=15-JUN-05channel ORA_SBT_TAPE_1: starting piece 1 at 15-JUN-05piece handle=1qgn2ji1_1_2 comment=API Version 2.0,MMS Version 8.1.3.0channel ORA_SBT_TAPE_1: finished piece 1 at 15-JUN-05channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25input backupset count=60 stamp=561073791 creation_time=15-JUN-05channel ORA_SBT_TAPE_1: starting piece 1 at 15-JUN-05piece handle=1sgn2jjv_1_2 comment=API Version 2.0,MMS Version 8.1.3.0....input backupset count=66 stamp=561076762 creation_time=15-JUN-05channel ORA_SBT_TAPE_1: starting piece 1 at 15-JUN-05piece handle=22gn2mgq_1_2 comment=API Version 2.0,MMS Version 8.1.3.0channel ORA_SBT_TAPE_1: finished piece 1 at 15-JUN-05channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:01Finished backup at 15-JUN-05

Now the output of the query would look like this:

SQL> SELECT * FROM V$RECOVERY_FILE_DEST;NAME--------------------------------------------------------------------------------SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES----------- ---------- ----------------- ---------------/opt/oracle/product/1010/dbs/ora_flash_area 1073741824  623138304         623138304               7

Note that this command will not delete the files from the FRA. The files would be 
deleted whenever any space is required for any new operation.

4) If suppose the FRA is full and the reclaimable space is 0 or insufficient 
     and we cannot backup the Flash Recovery Area to tape. Then to free 
     space we may delete unwanted files which are not yet obsolete by the following method:

A) Use the RMAN DELETE command to delete some files from the FRA:

SQL> SELECT * FROM V$RECOVERY_FILE_DEST;NAME------------------------------------------------------------------SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES----------- ---------- ----------------- ---------------/opt/oracle/product/1010/dbs/ora_flash_area 1073741824  633155072         0               8RMAN> delete backupset 45;using channel ORA_DISK_1using channel ORA_SBT_TAPE_1List of Backup PiecesBP Key  BS Key  Pc# Cp# Status      Device Type Piece Name------- ------- --- --- ----------- ----------- ----------52      45      1   1   AVAILABLE   DISK        opt/oracle/product/1010/dbs/ora_flash_area/DB10G/backupset/2005_06_15/o1_mf_ncsnf_TAG20050615T215053_1c0odcbg_.bkpDo you really want to delete the above objects (enter YES or NO)? yesdeleted backup piecebackup piece handle=/opt/oracle/product/1010/dbs/ora_flash_area/DB10G/backupset/2005_06_15/o1_mf_ncsnf_TAG20050615T215053_1c0odcbg_.bkp recid=52 stamp=561073891Deleted 1 objectsSQL> SELECT * FROM V$RECOVERY_FILE_DEST;NAME-------------------------------------------------------------SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES----------- ---------- ----------------- ---------------/opt/oracle/product/1010/dbs/ora_flash_area 1073741824  630189568         0               7


B) You can delete the files from the OS using the OS command and then run 
     the RMAN CROSSCHECK command and DELETE EXPIRED command to free the space.

SQL> SELECT * FROM V$RECOVERY_FILE_DEST;NAME-------------------------------------------------------------SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES----------- ---------- ----------------- ---------------/opt/oracle/product/1010/dbs/ora_flash_area 1073741824  630189568         0               7[oracle@incq073ac 2005_06_15]$ ls -ltotal 1016-rw-r-----  1 oracle dba 1033216 Jun 15 23:22 o1_mf_1_116_1c0tpxb6_.arc[oracle@incq073ac 2005_06_15]$ rm *[oracle@incq073ac 2005_06_15]$RMAN> crosscheck archivelog all;released channel: ORA_DISK_1allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=142 devtype=DISKvalidation failed for archived logarchive log filename=/opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_116_1c0tpxb6_.arc recid=57 stamp=561079349validation succeeded for archived logarchive log filename=/opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_16/o1_mf_1_117_1c1ds0cf_.arc recid=58 stamp=561097849Crosschecked 2 objectsRMAN> delete expired archivelog all;released channel: ORA_DISK_1allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=142 devtype=DISKList of Archived Log CopiesKey     Thrd Seq     S Low Time  Name------- ---- ------- - --------- ----57      1    116     X 15-JUN-05 /opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_116_1c0tpxb6_.arcDo you really want to delete the above objects (enter YES or NO)? yesdeleted archive logarchive log filename=/opt/oracle/product/1010/dbs/ora_flash_area/DB10G/archivelog/2005_06_15/o1_mf_1_116_1c0tpxb6_.arc recid=57 stamp=561079349Deleted 1 EXPIRED objectsSQL> SELECT * FROM V$RECOVERY_FILE_DEST;NAME----------------------------------------------------------SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES----------- ---------- ----------------- ---------------/opt/oracle/product/1010/dbs/ora_flash_area 1073741824  629156864         0               6


Refer Note 829755.1 : Space issue in Flash Recovery Area( FRA ) 


  

相关内容

   
 

产品

   
  • Oracle Database Products > Oracle Database > Oracle Database > Oracle Database - Enterprise Edition > Recovery Manager