Oracle Redo Log Buffer的大小設定

來源:互聯網
上載者:User

Redo Log Buffer的大小由初始化參數LOG_BUFFER定義,該參數的預設值為Max(512KB,128KB*CPU_COUNT)。通常這一預設值是足夠的,我們知道,Redo Log Buffer的寫出操作是相當頻繁的,所以過大的Log Buffer設定通常是沒有必要的;如果預設值不能滿足要求,一般來說3MB是一個較為合理的調整開端。

log_buffer參數的設定是否需要調整,可以從資料庫的等待事件來判斷:

sys@ORCL>  select event#,name from v$event_name where name='log buffer space';

    EVENT# NAME

---------- --------------------------------------------------

       109 log buffer space

當Log Buffer Space等待事件出現並且較為顯著時,可以考慮增大Log Buffer以縮減競爭。

從Oracle 10g開始,LOG_BUFFER的分配演算法有所改變,由於Granule的引入,LOG_BUFFER的分配也需要以Granule為基礎,預設的SGA中的Fixed SGA Size將和LOG_BUFFER共用整數倍的Granule:

sys@ORCL> select * from v$version where rownum<2;

BANNER

----------------------------------------------------------------

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

sys@ORCL> show parameter log_buffer

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

log_buffer                           integer     14238720

sys@ORCL> select * from v$sgainfo  where name in ('Fixed SGA Size','Redo Buffers','Granule Size');

NAME                                                    BYTES RES

-------------------------------------------------- ---------- ---

Fixed SGA Size                                        2091144 No

Redo Buffers                                         14684160 No

Granule Size                                         16777216 No

sys@ORCL> select (2091144+14238720)/16777216 from dual;

(2091144+14238720)/16777216

---------------------------

                 .973335743

如果不是有明顯的效能問題,一般預設的設定是足夠的。

相關文章

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.