Linux

Oracle - Archivelog 文件,我們可以刪除它們嗎?

  • August 17, 2018

我們有安裝了 Oracle 的 RHEL 7.2 機器。最近這台機器空間不足,我們發現大部分空間都進入“/home/oracle/ORA12C/fast_recovery_area//archivelog”

在這個文件夾中,我們有多個 datewise 文件夾,每個文件夾都包含 .arc 文件 可以直接刪除一年前的文件夾嗎?

聽起來您沒有通過執行歸檔日誌的 rman 備份並使用 BACKUP ARCHIVELOG 命令的 DELETE INPUT 選項來進行正常的內務管理。如果這真的是一台測試機器,我將首先使用正確的作業系統命令手動刪除檔案。這將在物理上釋放磁碟空間。然後您需要將這一事實告知 Oracle:

rman target /

rman> crosscheck archivelog all; -- this will detect that the logs have gone missing and mark their records in the control file as 'expired'

rman> delete noprompt expired archivelog all; -- this will remove the record of the archivelogs from the control file and adjust the FRA usage accordingly

rman> backup database plus archivelog all delete all input;

許多人錯過的一個重要概念是,FRA 僅僅是一種記賬機制。它不在磁碟上物理保留空間,也不保證指定的空間實際可用。至於archlogs,當創建一個時,它的記錄被寫入控製文件。如果手動刪除日誌,FRA 簿記機制不知道並認為該文件仍然存在消耗空間。

如果您處於 archlog 模式,則需要進行定期備份,包括使用 DELETE INPUT 選項備份 archlogs。

引用自:https://dba.stackexchange.com/questions/215102