ORA-04030調整內存方法


ORA-04030: out of process memory when trying to allocate 1049100 bytes (KSFQ heap,KSFQ Buffers)

 

1. 官方的描述如下

ORA-04030 out of process memory when trying to allocate string bytes (string,string)

Cause: Operating system process private memory has been exhausted.

Action: See the database administrator or operating system administrator to increase process memory quota. There may be a bug in the application that causes excessive allocations of process memory space.

2. 網上搜的信息

現象:ORA-04030: 在嘗試分配...字節 (hash-join subh,kllcqas:kllsltba) 時進程內存不足。

ORA-04030:out of process memory when trying to allocate string bytes

ORA-04030的出現原因及解決方法:

ORA-04030出現的基本都是過多的使用memory造成的

Oracle process使用的內存數量是有一定限制的:

A. 對於32 BIT系統,有SGA 1.7G限制

B. 某些OS系統本身也有一些內存參數限制

--運行 ulimit 看看

C. OS系統本身物理內存+Swap的限制

現在我們應該檢查DB使用的SGA + PGA是否超過上面的限制。

SGA 包括 db_cache,shared_pool,large_pool,java_pool session的PGA包括sort_area_size/Hash_area_size/*_area_size 或者 pga_aggregate_target

還有執行的CODE以及一些data也會占用空間。

然后再根據情況降低里面的某些值了,比如db_cache,sort_area_size等等。

假如是OS系統的某Limited造成的,大家可以考慮放開限制man ulimit來觀察如何放開限制……

根據以上的2點,確定需要調整內存大小小於1.7G。

 登陸

sqlplus username/password as sysdba

1. 設置rman從SGA取內存

alter system set dbwr_io_slaves=2 scope=spfile;

alter system set backup_tape_io_slaves=true scope=spfile;

2. 調整SGA大小

alter system set sga_target=1200m;

alter system set sga_max_size=1200m scope=spfile;

3. 設置使用內存最大大小

alter system set large_pool_size=80m;

4. 重啟oracle service。

shutdown immediate;

startup;

5. 查看sga,pga,pool的大小。

另:

ORA-32001: 已請求寫入 SPFILE, 但是在啟動時未指定 SPFILE

解決思路

你的DB是以spfile還是pfile啟動的?

sql>show parameter spfile查一下是使用什么文件啟動的。

SQL> show parameter spfile;

NAME                                             TYPE         VALUE

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

spfile                                              string       %ORACLE_HOME%\DATABASE\SPFILE%ORACLE_SID%.ORA

要動態修改一定要用spfile啟動。如果現在是用pfile啟動,可以這樣切換成spfile啟動:

SQL>create spfile from pfile;

SQL>shutdown immediate;

SQL>startup;

用show parameter spfile 查看如果values對應有值,表示是spfile啟動的。否則就是pfile啟動的。

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM