Oracle 參數shared_pool_size

來源:互聯網
上載者:User

環境:

idle> select * from v$version; 
 
BANNER 
---------------------------------------------------------------- 
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod 
PL/SQL Release 10.2.0.1.0 - Production 
CORE    10.2.0.1.0      Production 
TNS for Linux: Version 10.2.0.1.0 - Production 
NLSRTL Version 10.2.0.1.0 - Production 

ASSM下
該參數的大小是shared pool的最小值,分配的值不能低於該值
如果超過這個值,Memory advisor會在sga_target的範圍內自動調整

idle> select component, current_size,min_size,max_size,user_specified_size from v$sga_dynamic_components where component='shared pool';

COMPONENT                CURRENT_SIZE  MIN_SIZE  MAX_SIZE USER_SPECIFIED_SIZE
------------------------- ------------ ---------- ---------- -------------------
shared pool                  192937984  192937984          0            96468992

idle> show parameter shared_pool_size

NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
shared_pool_size                    big integer 92M

idle> select 92*1024*1024 from dual;

92*1024*1024
------------
    96468992

但是,有些人建議,只要不是用來玩的庫,都建議使用手動管理

shared_pool隨著申請,一直盡量地長,長到占SGA的50%的時候,就不再長,然後由於片段而報ORA-04031錯誤

放養易失控,圈養不健康,Oracle提供的自動功能永遠不會是最佳化選擇

如果SGA採用ASSM,對於事務繁忙的系統,shared_pool會不斷長,到時候報ora-04031

案例1:

曾經一個電訊廠商的庫,sga_target 15G,不斷報ora-04031,此時共用池到7.5G+了。

改成手動管理後,1g shared_pool,幾年沒報過錯

案例2:

我手裡有一個系統 10g on Linux ,shared_pool 從 800m 調到 1G,拚命報4031

為了不放棄自動調整SGA這個特性

我把db_cache_size調大,硬是把 shared_pool可增長的空間給吃掉就好

確實,設定db_cache_size即可解決shared_pool佔用過多的問題

或者,您也可以:

設定這兩個參數也行

shared_pool_reserved_size

_shared_pool_reserved_min_alloc:最小改到4100,不能任意小

 

 

idle> select  a.ksppinm name,b.ksppstvl value,a.ksppdesc description
        from  x$ksppi a,x$ksppcv b
      where  a.indx = b.indx  and
              a.ksppinm like '%_shared_pool_reserved_min_alloc%';

NAME                            VALUE      DESCRIPTION
-------------------------------- ---------- --------------------------------------------------
_shared_pool_reserved_min_alloc  4400      minimum allocation size in bytes for reserved area
                                            of shared pool

 

附上OCP相關考題:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.