What is a flashback recovery zone?
Oracle 10g has a new feature called Automatic Disk-Based Backup and Recovery ). The basis for implementing this function is the Flash Recovery Area described in this article ). Flash recovery zone is a new feature in Oracle 10g. In short, the flash recovery area is a storage space used to store and restore related files. Allows users to centrally store all recovery-related files.
The Flash recovery zone can be stored in the following storage formats:
- Directory
- One File System
- Automatic Storage Management (ASM)) Disk group
In the RAC environment, this location must be a cluster file system, an ASM disk group, or a file sharing directory controlled by NFS. Note that, the locations of all instances must be consistent with the disk quota (disk quota) of the operating system.
The following files can be stored in the Flash recovery area:
- Control File
- Archived log files (Note: After the flash recovery area is set in the Oracle manual, the value of LOG_ARCHIVE_DEST_10 is automatically set to the location of the flash recovery area, this change is not observed during the test)
- Flash Back log
- Automatic Backup of control files and spfiles
- RMAN backup set
- Copy data files
Why flash back to the recovery zone?
As mentioned above, the flash recovery area provides a centralized storage area, which greatly reduces management overhead. This is the main advantage. It can be used with RMAN for quick recovery.
With the development of storage technology in recent years, the storage capacity of a single disk has been enhanced. This makes it possible to implement automatic disk-based backup and recovery technologies. The Flash recovery zone is the basis for disk-based backup and recovery. Flash back to recovery zone and OMFAnd ASMCombined use seems to be a perfect solution. Of course, it is undeniable that the automatic backup recovery technology is far from mature enough.
Set the flash recovery zone
If you use the database created by DBCA, you can set the location and size of the flash recovery zone during installation (click here to view the installation)-this is also one of the new features of Oracle 10g OUI. If the flash recovery area is not enabled at the beginning, you can set it as follows.
Adjust the following two dynamic initialization parameters (you do not need to restart the instance ):
SQL> ALTER SYSTEM SET db_recovery_file_dest_size=2g SCOPE=BOTH;System altered.SQL> SQL> ALTER SYSTEM SET db_recovery_file_dest= '/u01/app/oracle/flash_recovery_area' 2 SCOPE=BOTH;System altered.SQL> |
Then, check whether the modification has taken effect:
SQL> SHOW parameter db_recovery_file_destNAME TYPE VALUE----------------------- --------- ---------------------------------db_recovery_file_dest string /u01/app/oracle/flash_recovery_areadb_recovery_file_dest_size big integer 2GSQL> |
As shown above, we have set the flash recovery zone in/u01/app/oracle/flash_recovery_area. The maximum value is 2 GB. To cancel the flash recovery, clear the value of the initialization parameter DB_RECOVERY_FILE_DEST.
Note:: DB_RECOVERY_FILE_DEST_SIZE can be cleared only after DB_RECOVERY_FILE_DEST is cleared.
Note the following when setting the initialization parameter db_recovery_file_dest_size:
- The size of the file's 0th blocks and the size of the operating system's data blocks is not included.
- This parameter does not represent the actual occupied space. If the space is compressed, mirrored, or RAID, the value of this parameter is different.
Manage and monitor the flash recovery zone
First, let's look at the file shelf structure layers in the Flash recovery area.
SQL> host tree /u01/app/oracle/flash_recovery_area/u01/app/oracle/flash_recovery_area|-- DEMO| |-- archivelog| | |-- 2004_12_07| | | |-- o1_mf_1_10_0vbwz2fm_.arc| | | |-- o1_mf_1_11_0vc1yj14_.arc| | | |-- o1_mf_1_12_0vc6vvws_.arc| | | |-- o1_mf_1_13_0vcbv6cg_.arc| | | |-- o1_mf_1_14_0vchlxb3_.arc| | | |-- o1_mf_1_15_0vcnBbz_.arc| | | |-- o1_mf_1_5_0vbk8goo_.arc| | | |-- o1_mf_1_6_0vbkq6dk_.arc| | | |-- o1_mf_1_7_0vbktl5f_.arc| | | |-- o1_mf_1_8_0vbo97xp_.arc| | | `-- o1_mf_1_9_0vbrrlo6_.arc| | `-- 2004_12_08| | |-- o1_mf_1_16_0vcnyqvf_.arc| | |-- o1_mf_1_17_0vcp58bj_.arc| | |-- o1_mf_1_18_0vcv4qxb_.arc| | |-- o1_mf_1_19_0vczcsl0_.arc| | |-- o1_mf_1_20_0vd34svw_.arc| | |-- o1_mf_1_21_0vd7tg4h_.arc| | |-- o1_mf_1_22_0vddq7lc_.arc| | |-- o1_mf_1_23_0vdk0nbh_.arc| | |-- o1_mf_1_24_0vdojjky_.arc| | |-- o1_mf_1_25_0vdtg1rq_.arc| | |-- o1_mf_1_26_0vdz23B_.arc| | |-- o1_mf_1_27_0vf3nlnw_.arc| | |-- o1_mf_1_28_0vf6hon5_.arc| | |-- o1_mf_1_29_0vf867lt_.arc| | |-- o1_mf_1_30_0vf86pkg_.arc| | `-- o1_mf_1_31_0vfjphqm_.arc| `-- backupset| |-- 2004_12_07| | |-- o1_mf_ncsn1_TAG20041207T150715_0vboq7kv_.bkp| | `-- o1_mf_nnnd1_TAG20041207T150715_0vboo3t2_.bkp| `-- 2004_12_08| |-- o1_mf_ncsnf_TAG20041208T161219_0vffxv2n_.bkp| |-- o1_mf_ncsnf_TAG20041208T165456_0vfjcvgl_.bkp| `-- o1_mf_nnndf_TAG20041208T161219_0vffv40q_.bkp`-- tracking.dbf7 directories, 33 files |
Changes such as adding or deleting files in the Flash recovery area will be recorded in the database's alert Log. Oracle 10g also provides a new view for this new feature, DBA_OUTSTANDING_ALERTS, you can obtain related information through this view.
The existence of the DBA_OUTSTANDING_ALERTS view reflects the increasingly user-friendly aspect of Oracle. Let's take a look at the basic structure of the view, which will be used later.
SQL> DESC dba_outstanding_alerts Name Null? Type ------------------------------- ---------------------------- SEQUENCE_ID NUMBER REASON_ID NOT NULL NUMBER OWNER VARCHAR2(30) OBJECT_NAME VARCHAR2(513) SUBOBJECT_NAME VARCHAR2(30) OBJECT_TYPE VARCHAR2(64) REASON VARCHAR2(4000) TIME_SUGGESTED TIMESTAMP(6) WITH TIME ZONE CREATION_TIME TIMESTAMP(6) WITH TIME ZONE SUGGESTED_ACTION VARCHAR2(4000) ADVISOR_NAME VARCHAR2(30) METRIC_VALUE NUMBER MESSAGE_TYPE VARCHAR2(12) MESSAGE_GROUP VARCHAR2(64) MESSAGE_LEVEL NUMBER HOSTING_CLIENT_ID VARCHAR2(64) MODULE_ID VARCHAR2(64) PROCESS_ID VARCHAR2(128) HOST_ID VARCHAR2(256) HOST_NW_ADDR VARCHAR2(256) INSTANCE_NAME VARCHAR2(16) INSTANCE_NUMBER NUMBER USER_ID VARCHAR2(30) EXECUTION_CONTEXT_ID VARCHAR2(60) ERROR_INSTANCE_ID VARCHAR2(142)SQL> |
The new 10g view V $ RECOVERY_FILE_DEST contains information about the flash recovery zone:
SQL> desc V$RECOVERY_FILE_DEST Name Null? Type ------------------------------- ---------------------------- NAME VARCHAR2(513) SPACE_LIMIT NUMBER SPACE_USED NUMBER SPACE_RECLAIMABLE NUMBER NUMBER_OF_FILES NUMBERSQL> SELECT NAME, space_limit, space_used, space_reclaimable space_rec, 2 number_of_files file_num 3 FROM v$recovery_file_dest;NAME SPACE_LIMIT SPACE_USED SPACE_REC FILE_NUM--------------------------- ----------- ---------- ---------- ----------/u01/app/oracle/flash_recovery_area 2147483648 1106849280 602410496 30SQL> |
In some 10 Gb dynamic views (V $ CONTROLFILE, V $ LOGFILE, V $ ARCHIVED_LOG, V $ DATAFILE_COPY, etc.), the new column IS_RECOVERY_DEST_FILE, specifies whether the relevant files are in the recovery area.
SQL> SELECT recid, blocks, is_recovery_dest_file 2 FROM v$archived_log 3 WHERE recid < 5; RECID BLOCKS IS_RECOVERY_DEST_FILE---------- ---------- ----------------------------- 1 20072 YES 2 19566 YES 3 19566 YES 4 19566 YESSQL> |
File persistence policy in the Flash recovery area
- Persistent files will never be deleted.
- Files that have expired through the RMAN Configuration Policy will be deleted.
- Temporary files that have been copied to the tape will be deleted.
- In the Data Guard environment, when archived duplicate log files can be deleted from the flash recovery area, you can apply the archive deduplication policy to automatically delete logs (in the recovery manager, configure archivelog deletion policy ......)
When the space used in the Flash recovery area exceeds 85%, the database will write alarm information to the alert file. When the number exceeds 97%, a severe alarm is generated. When the flash recovery area is insufficient, Oracle will report the following similar errors:
ORA-19809: limit exceeded for recovery filesORA-19804: cannot reclaim 52428800 bytes disk space from 1258291200 limit |
Query dba_outstanding_alerts at this time:
SQL> select reason,object_type, suggested_action from dba_outstanding_alerts;REASON OBJECT_TYPE SUGGESTED_ACTION------------------------------ --------------- -------------------------------------db_recovery_file_dest_size of RECOVERY AREA Add disk space and increase db_recovery_1258291200 bytes is 88.20% use file_dest_size, backup files to tertiaryd and has 148509184 remaining device, delete files from recovery areabytes available. using RMAN, consider changing RMAN rete ntion policy or consider changing RMAN a rchivelog deletion policy.1 rows selected.SQL> |
Related causes and recommended operations are provided.
Notes
Automation always gives uncertainty. If you enable the flash recovery area in the test environment, pay attention to the use of the monitoring space. For use in the production database (if such a person exists), you must put the flash recovery zone on a separate disk.
(