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启动的。