Oracle 10g 添加、刪除日誌組

來源:互聯網
上載者:User

Oracle 10g 添加、刪除日誌組

做日常巡檢的時候發現alert日誌中有這個錯誤

Thread 1 cannot allocate new log, sequence 319708

Checkpoint not complete

這個實際上是個比較常見的錯誤。通常來說是因為在日誌被寫滿時會切換日誌組,這個時候會觸發一次checkpoint,DBWR會把記憶體中的髒塊往資料檔案中寫,只要沒寫結束就不會釋放這個日誌組。如果歸檔模式被開啟的話,還會伴隨著ARCH寫歸檔的過程。如果redo log產生的過快,當CPK或歸檔還沒完成,LGWR已經把其餘的日誌組寫滿,又要往當前的日誌組裡面寫redo log的時候,這個時候就會發生衝突,資料庫就會被掛起。並且一直會往alert.log中寫類似上面的錯誤資訊。

Oracle給出的建議是:

Add additional log group

Increase size of redo logs

#########################################################

select * from v$log;

select bytes/1024/1024 from v$log;

select * from v$logfile;

#通過以上命令查看日誌組、記錄檔的狀態

#添加3個新的日誌組

alter database add logfile group 4 '/u01/app/oradata/destdb/destdb/redo04.log' size 300m;

alter database add logfile group 5 '/u01/app/oradata/destdb/destdb/redo05.log' size 300m;

alter database add logfile group 6 '/u01/app/oradata/destdb/destdb/redo06.log' size 300m;

#通過執行下面的命令,將新添加的日誌組的狀態切換為“非unused”,將需要刪除的日誌組切換為“unused”

alter system switch logfile;

#刪除老的日誌組,線上增加日誌組的時候,刪除日誌組的時候只能刪除日誌組狀態為 INACTIVE 的日誌組。

alter database drop logfile group 1;

alter database drop logfile group 2;

alter database drop logfile group 3;

#最後去os上刪除老的日誌組的物理檔案

刪除/u01/app/oradata/destdb/destdb/redo01、02、03.log

--------------------------------------分割線 --------------------------------------

在CentOS 6.4下安裝Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虛擬機器中安裝步驟

Debian 下 安裝 Oracle 11g XE R2

--------------------------------------分割線 --------------------------------------

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.