zoukankan      html  css  js  c++  java
  • fast recovery area

    First of all, the version of my enviroment is Oracle 11.0.2.3.  

    The fast recovery area used to be called flashback recovery area. When you want to enable flashback database feature, your database must have this area. So I always confused about these two concept.

    Let`s review how to enable flashback recovery area quickly.

    1. Make sure the log mode is archive

    select log_mode from v$database;

    2. Set the fast recovery area / flashback recovery area

    SQL> alter system set db_recovery_file_dest='/flash_recovery_area';
    SQL> alter system set db_recovery_file_dest_size=8G;

    3. set the flashback retention target

    This is controlled by the DB_FLASHBACK_RETENTION_TARGET instance parameter, which is in minutes, and the default is one day. The flashback log space is reused in a circular fashion, older data being overwritten by newer data. This parameter instructs Oracle to keep flashback data for a certain number of minutes before overwriting it:
    SQL> alter system set db_flashback_retention_target=240;
    It is only a target (four hours in the preceding example) and if the flash recovery area is undersized, Oracle may not be able to keep to it. But in principle, you should be able to flash back to any time within this target.

    4. Enable flashback on 

    SQL> shutdown immediate;
    SQL> startup mount;
    SQL> alter database flashback on;
    SQL> alter database open;

    The purpose of this review is to tell you one of funcitons of the fast/flashback recovery area. Then why oracle changed the name of this area from flashback area to fast recovery area? It is because this area have more functions than flashback. Called flashback recovery area may mislead people that this area is used for flashback database only. Actually there are more files can be and should be placed in this area.

    From now on we will call it Fast recovery area. The fast recovery area is a default location for all recovery-related files. The fast recovery area can be located in either a file system directory (Oracle will create its own subdirectories within this) or an ASM disk group. The flash recovery area can only be a disk destination. The flash recovery area is not enabled by default, unless the database is created with the Database Configuration Assistant (DBCA).

    Files can be stored in the fast recovery area are either permanent or transient. Permanent files are :

    • control file mulitplexed copies
    • online redo log file mulitplexed copies

    If the fast recovery area is defiened during the db creation time. And the control_files parameter , db_create_file_dest parameter not set, then control file copy will be created automatically in the flashback recovery area.  Simailarly, if the db_create_online_log_dest_n are not set and you didnt specify where to create the online redo log. The online redo will be created here.

    The transient occupants of the flash recovery area are:

    • archived redo log files
    • rman backups
    • rman copies
    • control file auto-backups
    • flashback log files( in 10g this area is mainly for flashback log files. So we call this area flashback recovery area)

    The transient occupants can be deleted automatically by the RMAN Recovery Manager if the flash recovery area is full, if space is needed for more recent transient files, and if the policies in effect permit this.

    In previeous 11g release.  If none of the LOG_ARCHIVE_DEST_n parameters have been set, then transitioning the database to archivelog mode will internally set LOG_ARCHIVE_DEST_10 to the flash recovery area, if it has been configured.  But we know that log_archive_dest and log_archive_dest_n is incompatible. So if you configured the fast recovery area you can not set the log_archive_dest. Or you will hit the error below.

    SQL> alter system set log_archive_dest='/oracle_asm/OrclArchiveLog' scope=both;
    alter system set log_archive_dest='/oracle_asm/OrclArchiveLog' scope=both
    *
    ERROR at line 1:
    ORA-02097: parameter cannot be modified because specified value is invalid
    ORA-16018: cannot use LOG_ARCHIVE_DEST with LOG_ARCHIVE_DEST_n or
    DB_RECOVERY_FILE_DEST

    In 11.0.2.3 the log_arechive_dest_10 will not be set as the db_recovery_file_dest. But you still can not set the log_arch_dest and db_recovery_file_dest at the same time.

    If you want to know what kind of files are stored in the fast recovery area you can check the view v$flash_recovery_area_usage. 

    SQL> select * from v$flash_recovery_area_usage;
    
    FILE_TYPE            PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
    -------------------- ------------------ ------------------------- ---------------
    CONTROL FILE                          0                         0               0
    REDO LOG                              0                         0               0
    ARCHIVED LOG                       2.78                         0               8
    BACKUP PIECE                          0                         0               0
    IMAGE COPY                            0                         0               0
    FLASHBACK LOG                         0                         0               0
    FOREIGN ARCHIVED LOG                  0                         0               0

    2.78 here means 2.78%.

  • 相关阅读:
    Singleton patterns 单件(创建型模式)
    JS的运算问题……
    Java 新手学习日记一
    pycharm远程调试配置
    MATLAB2010安装方法
    人生三境界
    SAS数据步与过程步,数据步语句
    Google Chrome浏览器调试功能介绍
    认识Java标识符
    java多态和继承
  • 原文地址:https://www.cnblogs.com/kramer/p/3319596.html
Copyright © 2011-2022 走看看