ORA-38708與清除Recovery Area中的歸檔日誌

viadeazhu發表於2010-05-30

如何刪除flashback recovery area中的歸檔日誌?

簡單的在作業系統層面rm雖然釋放了硬碟空間,但是V$FLASH_RECOVERY_AREA_USAGE中並不知道。

於是,當你希望再次enable flashback database時,會遇到如下錯誤:


SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38708: not enough space for first flashback database log file

> oerr ora 38708
38708, 00000, "not enough space for first flashback database log file"
// *Cause: An ALTER DATABASE FLASHBACK ON command failed because there
//         was not enough space in the Recovery Area for the first
//         flashback database log file.
// *Action: Make more space in the Recovery Area.  For example, this
//          can be done by increasing the value of
//          DB_RECOVERY_FILE_DEST_SIZE.

很顯然,我們需要做的不是簡單地增大DB_RECOVERY_FILE_DEST_SIZE,因為透過透過如下知道歸檔日誌佔用99%的空間,沒被清除。

SQL> select file_type,percent_space_used from V$FLASH_RECOVERY_AREA_USAGE;

FILE_TYPE    PERCENT_SPACE_USED
------------ ------------------
CONTROLFILE                   0
ONLINELOG                     0
ARCHIVELOG                99.81
BACKUPPIECE                   0
IMAGECOPY                     0
FLASHBACKLOG                  0

我們需要做的就是這樣簡單的兩句rman commands:

crosscheck archivelog all;

delete expired archivelog all;

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

相關文章