一oracle 11g 出现ORACLE ORA-04030之 out of process memory when trying to allocate报错,查询ORACLE官方MOS确定是:BUG11852492,原因是用户会话单进程占用PGA超过4GB异常终止,根据MOS文章1325100.1的建议:可以根据服务器实际情况及SQL运行的实际情况放开PGA单进程使用内存空间的限制到16GB。

相关分析处理过程如下:

ORA4030告警,告警信息如下:****************************查看数据库告警日志**************************ERRORINALERTLOGFILE-LAST3DAYS=====================================15/12/201622:44:13ThuDec1522:44:132016ThuDec1522:44:132016ORA-04030:outofprocessmemorywhentryingtoallocate64bytes(kxs-heap-c,allocatorstate)ORA-04030:outofprocessmemorywhentryingtoallocate624bytes(kxs-heap-c,MSQ2)ORA-04030:outofprocessmemorywhentryingtoallocate82456bytes(pgaheap,controlfilei/obuffer)Errorsinfile/u01/app/oracle/diag/rdbms/orcl/orcl2/incident/incdir_498/orcl_pmon_60993.trc:SeeNote411.1atMyOracleSupportforerrorandpackagingdetails.UseADRCIorSupportWorkbenchtopackagetheincident.

针对PGA单进程4GB内存空间的限制,查证当前操作系统相关限制参数设置为4GB:

[root@host~]#more/proc/sys/vm/max_map_count65530[root@host~]#more/proc/sys/vm/max_map_count65530[root@host~]#

针对PGA单进程4GB内存空间的限制,使用如下sql语句查证oracle数据库相关隐含参数设置为4GB:

_realfree_heap_pagesize_hint=65536selecta.ksppinmname,b.ksppstvlvalue,a.ksppdescdescriptionfromx$ksppia,x$ksppcvbwherea.indx=b.indxanda.ksppinmlike'_realfree_heap_pagesize_hint';

如果实际情况可以,oracle官方允许PGA单进程设置为16GB,相关操作如下:

SOLUTIONChangetheupperlimitateithertheOSoratthedatabaselevel:ChangethepagecountattheOSlevel:more/proc/sys/vm/max_map_countsysctl-wvm.max_map_count=262144(forexample)**Pleasenotetheabovechangeswillrevertuponhostrebootunlessthechangesarepermanentlymadeinthe/etc/sysctl.conffile**Adjusttherealfreeheappagesizewithinthedatabasebysettingthefollowingparametersintheinit/spfileandrestartthedatabase.Forversions11.2.0.4andlower:_use_realfree_heap=TRUE_realfree_heap_pagesize_hint=262144For12.1andhigher:_use_realfree_heap=TRUE_realfree_heap_pagesize=262144