今天AP人員告訴我在執行一段程式時發生了ORA-04031的錯誤:
ORA-04031: "unable to allocate 6488 bytes of shared memory ("shared pool" …

為了讓程式可以正常執行,只好更改shared pool的大小。
但是直接加大shared pool會產生下列的錯誤
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-04033: Insufficient memory to grow pool

資料庫的版本是9iR2,可能動態更改shared pool的大小,
但是因為整個SGA大小是固定的,只好先縮小DB Cache的大小才能再加大shared pool

下面可以查詢目前設定的大小
select * from v$parameter where name like 'share_pool_size' ;
select * from v$parameter where name like 'db_cache_size' ;
select * from v$parameter where name like 'sga_max_size' ;

原本DB Cache 為4500MB,先縮小它
alter system set db_cache_size =4000M;

原本的shard pool為800M,現在暫時加大它
ALTER SYSTEM SET shared_pool_size =1300M;

因為我沒有指定寫入spfile,所以下次重開機後,就會恢復原設定值。
arrow
arrow
    全站熱搜

    keven 發表在 痞客邦 留言(0) 人氣()