設定Flash Recovery Area

tengrid發表於2009-05-19

注意點:
1, DB_RECOVERY_FILE_DEST_SIZE必須在DB_RECOVERY_FILE_DEST之前設定
2, 相關檢視V$RECOVERY_FILE_DEST,V$FLASH_RECOVERY_AREA_USAGE 
    相關引數db_recovery_file_dest, db_recovery_file_dest_size
3, 不能反設定size引數,可以反設定dest引數
   如果不使用FRA,最好修改pfile,重新生成spfile,壞處是需要重啟DB

#沒有設定db_recovery_file_dest_size時直接設定dest報錯
SQL> alter system set DB_RECOVERY_FILE_DEST='/data/oradata/fra' scope=both;
alter system set DB_RECOVERY_FILE_DEST='/data/oradata/fra' scope=both
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-19802: cannot use DB_RECOVERY_FILE_DEST without DB_RECOVERY_FILE_DEST_SIZE

#正常設定

SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=10g scope=both;

System altered.

SQL> alter system set DB_RECOVERY_FILE_DEST='/data/oradata/fra' scope=both;
System altered.

SQL> col name for a30
SQL> set linesize 1000
SQL>  select * from V$RECOVERY_FILE_DEST;
NAME                           SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES
------------------------------ ----------- ---------- ----------------- ---------------
/data/oradata/fra               1.0737E+10          0                 0               0

SQL> show parameter db_recovery

NAME                                 TYPE                             VALUE
------------------------------------ -------------------------------- ------------------------------
db_recovery_file_dest                string                           /data/oradata/fra
db_recovery_file_dest_size           big integer                      10G

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     145
Next log sequence to archive   147
Current log sequence           147

#反設定(將 dest設為''就可以了)

SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=0 scope=both;
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-19803: Parameter DB_RECOVERY_FILE_DEST_SIZE is out of range (1 - 18446744073709551614)

SQL>alter system set DB_RECOVERY_FILE_DEST='' scope=both;
System altered.

SQL> select * from V$RECOVERY_FILE_DEST;  ==>limit仍有值

NAME                           SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES
------------------------------ ----------- ---------- ----------------- ---------------
                                1.0737E+10          0                 0               0

SQL>  show parameter db_recovery     ===>show沒有顯示結果

SQL> alter system set DB_RECOVERY_FILE_DEST='/data/oradata/fra' scope=both;
System altered.


SQL>  select * from V$RECOVERY_FILE_DEST;
NAME                           SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES
------------------------------ ----------- ---------- ----------------- ---------------
/data/oradata/fra               1.0737E+10          0                 0               0

SQL> show parameter db_recovery

NAME                                 TYPE                             VALUE
------------------------------------ -------------------------------- ------------------------------
db_recovery_file_dest                string                           /data/oradata/fra
db_recovery_file_dest_size           big integer                      10G

注意,不能反設定size
SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=0 scope=both;
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-19803: Parameter DB_RECOVERY_FILE_DEST_SIZE is out of range (1 - 18446744073709551614)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/94384/viewspace-600386/,如需轉載,請註明出處,否則將追究法律責任。

相關文章