ORA-04030

来源:互联网 发布:安禄山 知乎 编辑:程序博客网 时间:2024/04/30 16:42

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.

这使我想起我当初在安装数据库时分配的内存可以过大,下图是我安装的配置:

clip_image040

安装后的oracle的内存分配如下图:(large_pool_size原来是0,后来修改到800M)

clip_image042

clip_image044

通过sql命令查看得知sga_target=1800M,pga_aggregate_target=600和我设置的一致,对于Share Memory Management设为automatic,oracle的说法是oracle会自己自行管理,看来是没有管理好,还得手动分配的好。

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。

 

1. 设置rman从SGA取内存

alter system set dbwr_io_slaves=2 scope=spfile;

alter system set backup_tape_io_slaves=true scope=spfile;

clip_image046

clip_image048

clip_image050

2. 调整SGA大小

alter system set sga_target=1200m;

alter system set sga_max_size=1200m scope=spfile;

clip_image052

clip_image054

3. 设置使用内存最大大小

alter system set large_pool_size=80m;

clip_image056

4. 重启oracle service。

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

clip_image058