1. 程式人生 > 其它 >oracle 歸檔空間滿的解決辦法

oracle 歸檔空間滿的解決辦法

轉至:https://www.cnblogs.com/benbenduo/p/7437333.html

問題現象:

          通過命令提示符登陸資料庫,一般提示“ora-03113:通訊通道的檔案結尾”錯誤,檢視trace日誌,可以看到詳細資訊。部分摘錄如下(橙色部分給出了建議方案):

 
Errors in file g:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_1368.trc:
ORA-19815: 警告: db_recovery_file_dest_size 位元組 (共 4102029312 位元組) 已使用 100.00%, 尚有 0 位元組可用。
************************************************************************
You have following choices to free up space from recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
   then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
   BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
   reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
   system command was used to delete files, then use RMAN CROSSCHECK and
   DELETE EXPIRED commands.
************************************************************************ Errors in file g:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_1368.trc: ORA-19809: 超出了恢復檔案數的限制 ORA-19804: 無法回收 17847808 位元組磁碟空間 (從 4102029312 限制中) ARCH: Error 19809 Creating archive log file to 'G:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_08_26\O1_MF_1_561_%U_.ARC' Errors in file g:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_1368.trc: ORA-16038: 日誌 3 sequence# 561 無法歸檔 ORA-19809: 超出了恢復檔案數的限制 ORA-00312: 聯機日誌 3 執行緒 1: 'G:\ORADATA\ORCL\REDO03.LOG' USER (ospid: 1368): terminating the instance due to error 16038 ARC1: Archival started Errors in file g:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_arc0_4836.trc: ORA-01092: ORACLE instance terminated. Disconnection forced
 

解決方法(兩種):

  • 增加歸檔空間,設定db_recovery_file_dest引數

 

sqlplus / as sysdba
shutdown abort -- 關閉程序
startup mount -- 啟動資料庫到mount模式
alter system set db_recovery_file_dest=10G; -- 設定歸檔空間大小
shutdown immediate -- 關閉資料庫
startup -- 啟動資料庫

 

  • 刪除多餘歸檔,只保留需要的(根據業務保留恢復資料庫所需要的最近歸檔),這種辦法同樣有兩種方式,一種直接rman方式刪除歸檔,一種在作業系統層次刪除,但是因為每個歸檔在資料庫中都有記錄,仍需再進入rman刪除失效歸檔檔案,否則報錯。

   第一種方式:

rman target /    -- 進入rman模式
list archivelog all;    --列出全部歸檔檔案
delete archivelog all complited before 'SYSDATA-7';  --刪除7天前的所有歸檔

      ps:SYSDATA-7,表明當前的系統時間7天前,before關鍵字表示在7天前的歸檔日誌

        第二種方式:

如果不小心在作業系統層次提前刪除了歸檔日誌,需進入rman清楚過期歸檔日誌資訊。執行如下操作:
rman target /
crosscheck archivelog all;    -- 檢查歸檔資訊
delete expired archivelog all;    -- 刪除過期歸檔
list archivelog all;

        執行完畢後,退出rman,重啟資料庫。

附(部分rman命令):

  • backup database    對資料庫做全備
  • delete obsolete    根據備份策略刪除陳舊備份
  • delete expired backup     刪除失效備份
  • delete expired copy     刪除失效備份副本
  • delete backup    刪除所有備份,慎用。如需使用,建議使用後立即備份一次

 

傳送門:關於rman完整的備份策略請參考: http://www.cnblogs.com/benbenduo/p/4939738.html

 

 

 

問題現象

通過命令提示符登陸資料庫,一般提示“ora-03113:通訊通道的檔案結尾 ”錯誤,檢視trace日誌,可以看到詳細資訊。部分摘錄如下(粗體給出了建議方案):

Errors in file g:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_1368.trc:

ORA-19815: 警告: db_recovery_file_dest_size 位元組 (共 4102029312 位元組) 已使用 100.00%, 尚有 0 位元組可用。

************************************************************************

You have following choices to free up space from recovery area:

1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,

   then consider changing RMAN ARCHIVELOG DELETION POLICY.

2. Back up files to tertiary device such as tape using RMAN

   BACKUP RECOVERY AREA command.

3. Add disk space and increase db_recovery_file_dest_size parameter to

   reflect the new space.

4. Delete unnecessary files using RMAN DELETE command. If an operating

   system command was used to delete files, then use RMAN CROSSCHECK and

   DELETE EXPIRED commands.

************************************************************************

Errors in file g:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_1368.trc:

ORA-19809: 超出了恢復檔案數的限制

ORA-19804: 無法回收 17847808 位元組磁碟空間 (從 4102029312 限制中)

ARCH: Error 19809 Creating archive log file to 'G:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_08_26\O1_MF_1_561_%U_.ARC'

Errors in file g:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_1368.trc:

ORA-16038: 日誌 3 sequence# 561 無法歸檔

ORA-19809: 超出了恢復檔案數的限制

ORA-00312: 聯機日誌 3 執行緒 1: 'G:\ORADATA\ORCL\REDO03.LOG'

USER (ospid: 1368): terminating the instance due to error 16038

ARC1: Archival started

Errors in file g:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_arc0_4836.trc:

ORA-01092: ORACLE instance terminated. Disconnection forced

解決方法

l  增加歸檔空間,設定db_recovery_file_dest引數。

  1. Sqlplus / as sysdba

刪除多餘歸檔,只保留需要的(根據業務保留恢復資料庫所需要的最近歸檔)。

搜尋

複製