昨天去一客户那里做巡检,遇到了经典的ora-04030错误,alert日志如下:
tue oct 28 09:57:46 2014
errors in file /oracle/app/oracle/diag/rdbms/wmsdb/wmsdb/trace/wmsdb_ora_33358038.trc (incident=177302):
ora-04030: out of process memory when trying to allocate 118808 bytes (qerhj hash-joi,kllcqas:kllsltba)
incident details in: /oracle/app/oracle/diag/rdbms/wmsdb/wmsdb/incident/incdir_177302/wmsdb_ora_33358038_i177302.trc
errors in file /oracle/app/oracle/diag/rdbms/wmsdb/wmsdb/trace/wmsdb_ora_33358038.trc (incident=177303):
ora-04030: out of process memory when trying to allocate 169040 bytes (pga heap,kgh stack)
ora-04030: out of process memory when trying to allocate 118808 bytes (qerhj hash-joi,kllcqas:kllsltba)
incident details in: /oracle/app/oracle/diag/rdbms/wmsdb/wmsdb/incident/incdir_177303/wmsdb_ora_33358038_i177303.trc
errors in file /oracle/app/oracle/diag/rdbms/wmsdb/wmsdb/incident/incdir_177302/wmsdb_ora_33358038_i177302.trc:
ora-04030: out of process memory when trying to allocate 169040 bytes (pga heap,kgh stack)
ora-04030: out of process memory when trying to allocate 118808 bytes (qerhj hash-joi,kllcqas:kllsltba)
errors in file /oracle/app/oracle/diag/rdbms/wmsdb/wmsdb/trace/wmsdb_ora_33358038.trc (incident=177304):
ora-04030: out of process memory when trying to allocate 160 bytes (pga heap,control file cache)
ora-04030: out of process memory when trying to allocate 118808 bytes (qerhj hash-joi,kllcqas:kllsltba)
incident details in: /oracle/app/oracle/diag/rdbms/wmsdb/wmsdb/incident/incdir_177304/wmsdb_ora_33358038_i177304.trc
tue oct 28 09:57:53 2014
trace dumping is performing id=[cdmp_20141028095753]
tue oct 28 09:57:54 2014
sweep incident[177303]: completed
tue oct 28 09:57:57 2014
errors in file /oracle/app/oracle/diag/rdbms/wmsdb/wmsdb/incident/incdir_177302/wmsdb_ora_33358038_i177302.trc:
ora-04030: out of process memory when trying to allocate 160 bytes (pga heap,control file cache)
ora-04030: out of process memory when trying to allocate 118808 bytes (qerhj hash-joi,kllcqas:kllsltba)
errors in file /oracle/app/oracle/diag/rdbms/wmsdb/wmsdb/trace/wmsdb_ora_33358038.trc (incident=177305):
ora-04030: out of process memory when trying to allocate 16776728 bytes (qerhj hash-joi,qerhj hash table entries)
incident details in: /oracle/app/oracle/diag/rdbms/wmsdb/wmsdb/incident/incdir_177305/wmsdb_ora_33358038_i177305.trc
trace dumping is performing id=[cdmp_20141028095802]
......
该客户的数据库是oracle 11.1.0.7,运行在p550主机上,16个逻辑cpu,16g内存,aix 6.1 64位系统,共分配了8g内存给sga,2g内存给pga,由memory_target=10g参数动态调整,同时,memory_max_target也设置成10g,表示oracle最多可以占用os的内存为10g(物理内存的62.5%)。这2个参数是11g新增的,可以动态分配sga和pga,而在10g中仅只能通过设置sga_target来动态管理sga中的各内存组件,pga是要另外手动设置的。
sql> show parameters target
name type value
------------------------------------ ---------------------- ------------------------------
archive_lag_target integer 0
db_flashback_retention_target integer 1440
fast_start_io_target integer 0
fast_start_mttr_target integer 0
memory_max_target big integer 10g
memory_target big integer 10g
pga_aggregate_target big integer 2g
sga_target big integer 8g
网上google了一下,很多关于ora-04030的错误的描述都大同小异,主要由以下几种:
a. 对于32 bit系统,有sga 1.7g限制
b. 某些os系统本身也有一些内存参数限制
c. os系统本身物理内存+swap的限制
对于a,由于系统是64 bit的,没有1.7g的限制;
对于b,用ulimit查看的结果为ulimited;
对于c,,os本身的内存为16g,不过用topas查看,内存使用率已经为90%