<span style="font-size:16px;font-family:'Courier New';"><br />
客户的一套Oracle 11.2.0.3 for AIX 6.1的RAC环境每天一直有ORA-04030的报错,能够确定的是<span style="color:#E53333;">物理内存充足,操作系统oracle用户ulimit没有任何限制,PGA的大小跟此报错没有关系(增大PGA或者缩小PGA的值</span><span style="color:#E53333;">都会报这个错)</span>。<br />
<br />
<strong><span style="font-size:18px;">一.告警日志文件。</span></strong><span style="font-size:18px;"></span><br />
数据库ALERT日志报错如下:</span><br />
<span style="font-size:14px;font-family:'Courier New';">......</span><br />
<span style="font-size:14px;font-family:'Courier New';">2015-08-10 22:29:16.438000 +08:00</span><br />
<span style="font-size:14px;font-family:'Courier New';">Errors in file /u01/app/oracle/diag/rdbms/ynsyn13/ynsyn13/incident/incdir_133659/ynsyn13_ora_14352442_i133659.trc:</span><br />
<span style="font-size:14px;font-family:'Courier New';">ORA-04030: out of process memory when trying to allocate 824504 bytes (pga heap,kco buffer)</span><br />
<span style="font-size:14px;font-family:'Courier New';">ORA-04030: out of process memory when trying to allocate 64544 bytes (sort subheap,sort key)</span><br />
<span style="font-size:14px;font-family:'Courier New';">Errors in file /u01/app/oracle/diag/rdbms/ynsyn13/ynsyn13/trace/ynsyn13_ora_14352442.trc (incident=133661):</span><br />
<span style="font-size:14px;font-family:'Courier New';">ORA-04030: out of process memory when trying to allocate 824504 bytes (pga heap,kco buffer)</span><br />
<span style="font-size:14px;font-family:'Courier New';">ORA-04030: out of process memory when trying to allocate 64544 bytes (sort subheap,sort key)</span><br />
<span style="font-size:14px;font-family:'Courier New';">Incident details in: /u01/app/oracle/diag/rdbms/ynsyn13/ynsyn13/incident/incdir_133661/ynsyn13_ora_14352442_i133661.trc</span><br />
<span style="font-size:14px;font-family:'Courier New';">Use ADRCI or Support Workbench to package the incident.</span><br />
<span style="font-size:14px;font-family:'Courier New';">See Note 411.1 at My Oracle Support for error and packaging details.</span><br />
<span style="font-size:14px;font-family:'Courier New';">Archived Log entry 139978 added for thread 1 sequence 161599 ID 0x515a23a dest 1:</span><br />
<span style="font-size:14px;font-family:'Courier New';">Dumping diagnostic data in directory=[cdmp_20150810222917], requested by (instance=1, osid=14352442), summary=[incident=133660].</span><br />
<span style="font-size:14px;font-family:'Courier New';">2015-08-10 22:29:18.455000 +08:00</span><br />
<span style="font-size:14px;font-family:'Courier New';">Errors in file /u01/app/oracle/diag/rdbms/ynsyn13/ynsyn13/incident/incdir_133659/ynsyn13_ora_14352442_i133659.trc:</span><br />
<span style="font-size:14px;font-family:'Courier New';">ORA-04030: out of process memory when trying to allocate 824504 bytes (pga heap,kco buffer)</span><br />
<span style="font-size:14px;font-family:'Courier New';">ORA-04030: out of process memory when trying to allocate 64544 bytes (sort subheap,sort key)</span><br />
<span style="font-size:14px;font-family:'Courier New';">......</span><br />
<br />
<strong><span style="font-size:18px;font-family:'Courier New';">二.trace文件。</span></strong><br />
<span style="font-size:16px;font-family:'Courier New';">trace文件的内容如下:</span><br />
<span style="font-size:14px;font-family:'Courier New';">Dump file /u01/app/oracle/diag/rdbms/ynsyn13/ynsyn13/incident/incdir_145646/ynsyn13_ora_11075592_i145646.trc</span><br />
<span style="font-size:14px;font-family:'Courier New';">Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production</span><br />
<span style="font-size:14px;font-family:'Courier New';">With the Partitioning, Automatic Storage Management, OLAP, Data Mining</span><br />
<span style="font-size:14px;font-family:'Courier New';">and Real Application Testing options</span><br />
<span style="font-size:14px;font-family:'Courier New';">ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1</span><br />
<span style="font-size:14px;font-family:'Courier New';">System name: AIX</span><br />
<span style="font-size:14px;font-family:'Courier New';">Node name: lpar2</span><br />
<span style="font-size:14px;font-family:'Courier New';">Release: 1</span><br />
<span style="font-size:14px;font-family:'Courier New';">Version: 6</span><br />
<span style="font-size:14px;font-family:'Courier New';">Machine: 00F94D394C00</span><br />
<span style="font-size:14px;font-family:'Courier New';">Instance name: ynsyn13</span><br />
<span style="font-size:14px;font-family:'Courier New';">Redo thread mounted by this instance: 1</span><br />
<span style="font-size:14px;font-family:'Courier New';">Oracle process number: 38</span><br />
<span style="font-size:14px;font-family:'Courier New';">Unix process pid: 11075592, image: oracle@lpar2</span><br />
<br />
<br />
<span style="font-size:14px;font-family:'Courier New';">*** 2015-08-11 02:37:33.105</span><br />
<span style="font-size:14px;font-family:'Courier New';">*** SESSION ID:(434.341) 2015-08-11 02:37:33.105</span><br />
<span style="font-size:14px;font-family:'Courier New';">*** CLIENT ID:() 2015-08-11 02:37:33.105</span><br />
<span style="font-size:14px;font-family:'Courier New';">*** SERVICE NAME:(ynsyn13) 2015-08-11 02:37:33.105</span><br />
<span style="font-size:14px;font-family:'Courier New';">*** MODULE NAME:(SQL*Plus) 2015-08-11 02:37:33.105</span><br />
<span style="font-size:14px;font-family:'Courier New';">*** ACTION NAME:() 2015-08-11 02:37:33.105</span><br />
<span style="font-size:14px;font-family:'Courier New';"> </span><br />
<span style="font-size:14px;font-family:'Courier New';">Dump continued from file: /u01/app/oracle/diag/rdbms/ynsyn13/ynsyn13/trace/ynsyn13_ora_11075592.trc</span><br />
<span style="font-size:14px;font-family:'Courier New';">ORA-04030: out of process memory when trying to allocate 64544 bytes (sort subheap,sort key)</span><br />
<br />
<br />
<span style="font-size:14px;font-family:'Courier New';">========= Dump for incident 145646 (ORA 4030) ========</span><br />
<span style="font-size:14px;font-family:'Courier New';">----- Beginning of Customized Incident Dump(s) -----</span><br />
<span style="font-size:14px;font-family:'Courier New';">=======================================</span><br />
<span style="font-size:14px;font-family:'Courier New';">TOP 10 MEMORY USES FOR THIS PROCESS</span><br />
<span style="font-size:14px;font-family:'Courier New';">---------------------------------------</span><br />
<span style="font-size:14px;font-family:'Courier New';">39% 43 MB, 907 chunks: "kllcqas:kllsltba " SQL</span><br />
<span style="font-size:14px;font-family:'Courier New';"> QERHJ hash-joi ds=1110841a0 dsprt=110bb1268</span><br />
<span style="font-size:14px;font-family:'Courier New';">29% 33 MB, 562 chunks: "permanent memory " SQL</span><br />
<span style="font-size:14px;font-family:'Courier New';"> sort subheap ds=111083eb8 dsprt=110bb1268</span><br />
<span style="font-size:14px;font-family:'Courier New';">12% 13 MB, 907 chunks: "free memory " SQL</span><br />
<span style="font-size:14px;font-family:'Courier New';"> QERHJ hash-joi ds=1110841a0 dsprt=110bb1268</span><br />
<span style="font-size:14px;font-family:'Courier New';"> 7% 8160 KB, 9 chunks: "QERHJ list array " SQL</span><br />
<span style="font-size:14px;font-family:'Courier New';"> QERHJ hash-joi ds=1110841a0 dsprt=110bb1268</span><br />
<span style="font-size:14px;font-family:'Courier New';"> 4% 4096 KB, 1 chunk : "HT buckets " SQL</span><br />
<span style="font-size:14px;font-family:'Courier New';"> QERHJ hash-joi ds=1110841a0 dsprt=110bb1268</span><br />
<span style="font-size:14px;font-family:'Courier New';"> 3% 2931 KB, 29 chunks: "kllcqc:kllcqslt " SQL</span><br />
<span style="font-size:14px;font-family:'Courier New';"> QERHJ hash-joi ds=1110841a0 dsprt=110bb1268</span><br />
<span style="font-size:14px;font-family:'Courier New';"> 2% 2048 KB, 16 chunks: "QERHJ Bit vector " SQL</span><br />
<span style="font-size:14px;font-family:'Courier New';"> QERHJ hash-joi ds=1110841a0 dsprt=110bb1268</span><br />
<span style="font-size:14px;font-family:'Courier New';"> 1% 1184 KB, 213 chunks: "free memory " </span><br />
<span style="font-size:14px;font-family:'Courier New';"> pga heap ds=110004c20 dsprt=0</span><br />
<span style="font-size:14px;font-family:'Courier New';"> 1% 836 KB, 25 chunks: "permanent memory " </span><br />
<span style="font-size:14px;font-family:'Courier New';"> pga heap ds=110004c20 dsprt=0</span><br />
<span style="font-size:14px;font-family:'Courier New';"> 1% 660 KB, 1442 chunks: "free memory " </span><br />
<span style="font-size:14px;font-family:'Courier New';"> session heap ds=110954758 dsprt=110101b80</span><br />
<span style="font-size:14px;font-family:'Courier New';"><span style="font-size:16px;color:#E53333;"><br />
<<<<这个地方显示的是该进程(服务器进程)使用的PGA内存情况,可以看出该进程的PGA内存分配已经接近100MB。</span><br />
......</span><br />
<br />
<span style="font-size:18px;font-family:'Courier New';"><strong>三.数据库参数配置。</strong></span><br />
<span style="font-size:18px;font-family:'Courier New';"><strong></strong></span><br />
<span style="font-size:16px;font-family:'Courier New';">数据库实例的配置参数如下:</span><br />
<span style="font-size:16px;font-family:'Courier New';">SELECT a.ksppinm Param,</span><br />
<span style="font-size:16px;font-family:'Courier New';"> b.ksppstvl SessionVal,</span><br />
<span style="font-size:16px;font-family:'Courier New';"> c.ksppstvl InstanceVal,</span><br />
<span style="font-size:16px;font-family:'Courier New';"> a.ksppdesc Descr</span><br />
<span style="font-size:16px;font-family:'Courier New';"> FROM x$ksppi a, x$ksppcv b, x$ksppsv c</span><br />
<span style="font-size:16px;font-family:'Courier New';"> WHERE a.indx = b.indx</span><br />
<span style="font-size:16px;font-family:'Courier New';"> AND a.indx = c.indx</span><br />
<span style="font-size:16px;font-family:'Courier New';"> AND a.ksppinm LIKE '/_%' ESCAPE '/' and a.ksppinm='_smm_max_size'</span><br />
<span style="font-size:16px;font-family:'Courier New';">ORDER BY 1</span><br />
<span style="font-size:16px;font-family:'Courier New';">/</span><br />
<span style="font-size:16px;font-family:'Courier New';"></span><br />
<span style="font-size:16px;font-family:'Courier New';"></span><span style="font-size:16px;font-family:'Courier New';">PARAM</span><br />
<span style="font-size:16px;font-family:'Courier New';">--------------------------------------------------------------------------------</span><br />
<span style="font-size:16px;font-family:'Courier New';">SESSIONVAL</span><br />
<span style="font-size:16px;font-family:'Courier New';">--------------------------------------------------------------------------------</span><br />
<span style="font-size:16px;font-family:'Courier New';">INSTANCEVAL</span><br />
<span style="font-size:16px;font-family:'Courier New';">--------------------------------------------------------------------------------</span><br />
<span style="font-size:16px;font-family:'Courier New';">DESCR</span><br />
<span style="font-size:16px;font-family:'Courier New';">--------------------------------------------------------------------------------</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">_smm_max_size</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">51200</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">51200</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">maximum work area size in auto mode (serial)</span><br />
<span style="font-size:16px;font-family:'Courier New';"></span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;"><<<<自动模式下,单个进程最大的work area大小。</span><span style="color:#E53333;"></span><br />
<br />
<span style="font-size:16px;font-family:'Courier New';">SQL> SELECT a.ksppinm Param,</span><br />
<span style="font-size:16px;font-family:'Courier New';"> 2 b.ksppstvl SessionVal,</span><br />
<span style="font-size:16px;font-family:'Courier New';"> 3 c.ksppstvl InstanceVal,</span><br />
<span style="font-size:16px;font-family:'Courier New';"> 4 a.ksppdesc Descr</span><br />
<span style="font-size:16px;font-family:'Courier New';"> 5 FROM x$ksppi a, x$ksppcv b, x$ksppsv c</span><br />
<span style="font-size:16px;font-family:'Courier New';"> 6 WHERE a.indx = b.indx</span><br />
<span style="font-size:16px;font-family:'Courier New';"> 7 AND a.indx = c.indx</span><br />
<span style="font-size:16px;font-family:'Courier New';"> 8 AND a.ksppinm LIKE '/_%' ESCAPE '/' and a.ksppinm='_pga_max_size'</span><br />
<span style="font-size:16px;font-family:'Courier New';"> 9 ORDER BY 1</span><br />
<span style="font-size:16px;font-family:'Courier New';"> 10 /</span><br />
<br />
<br />
<span style="font-size:16px;font-family:'Courier New';">PARAM</span><br />
<span style="font-size:16px;font-family:'Courier New';">--------------------------------------------------------------------------------</span><br />
<span style="font-size:16px;font-family:'Courier New';">SESSIONVAL</span><br />
<span style="font-size:16px;font-family:'Courier New';">--------------------------------------------------------------------------------</span><br />
<span style="font-size:16px;font-family:'Courier New';">INSTANCEVAL</span><br />
<span style="font-size:16px;font-family:'Courier New';">--------------------------------------------------------------------------------</span><br />
<span style="font-size:16px;font-family:'Courier New';">DESCR</span><br />
<span style="font-size:16px;font-family:'Courier New';">--------------------------------------------------------------------------------</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">_pga_max_size</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">104857600</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">104857600</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">Maximum size of the PGA memory for one process</span><br />
<span style="font-size:16px;font-family:'Courier New';"></span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;"><<<< 一个进程最大的PGA内存为100MB。</span><br />
<br />
<span style="font-size:16px;font-family:'Courier New';">SQL> show parameter pga</span><br />
<br />
<br />
<span style="font-size:16px;font-family:'Courier New';">NAME TYPE VALUE</span><br />
<span style="font-size:16px;font-family:'Courier New';">------------------------------------ ----------- ------------------------------</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">_pga_max_size big integer 100M <<<< 初始化参数中限制了_pga_max_size大小。</span><br />
<span style="font-size:16px;font-family:'Courier New';">pga_aggregate_target big integer 2G</span><br />
<span style="font-size:16px;font-family:'Courier New';">SQL> </span><br />
<span style="font-size:16px;font-family:'Courier New';">SQL> show parameter workarea</span><br />
<br />
<br />
<span style="font-size:16px;font-family:'Courier New';">NAME TYPE VALUE</span><br />
<span style="font-size:16px;font-family:'Courier New';">------------------------------------ ----------- ------------------------------</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">workarea_size_policy string AUTO</span><br />
<span style="font-size:16px;font-family:'Courier New';">SQL> </span><br />
<span style="font-size:16px;font-family:'Courier New';">SQL> show parameter target</span><br />
<br />
<br />
<span style="font-size:16px;font-family:'Courier New';">NAME TYPE VALUE</span><br />
<span style="font-size:16px;font-family:'Courier New';">------------------------------------ ----------- ------------------------------</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">memory_max_target big integer 0</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">memory_target big integer 0</span><br />
<span style="font-size:16px;font-family:'Courier New';color:#E53333;">pga_aggregate_target big integer 2G</span><br />
<span style="font-size:16px;font-family:'Courier New';">sga_target big integer 15G</span><br />
<span style="font-size:16px;font-family:'Courier New';">SQL> <br />
</span><span style="font-size:16px;font-family:'Courier New';"></span><span style="font-size:16px;font-family:'Courier New';"></span><br />
<span style="font-size:16px;font-family:'Courier New';"></span><span style="font-size:18px;font-family:'Courier New';"><strong>四.pga_aggregate_target和</strong></span><span style="font-size:18px;font-family:'Courier New';"><strong>WORKAREA_SIZE_POLICY参数的含义。</strong></span><br />
<span style="font-size:16px;font-family:'Courier New';"></span><br />
<span style="font-size:16px;font-family:'Courier New';"></span>
<h1 class="sect1" id="insertedID0" style="font-size:21px;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#DDDDDD;width:1147px;font-family:Tahoma, sans-serif;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<span style="font-size:18px;font-family:'Courier New';">>PGA_AGGREGATE_TARGET</span>
</h1>
<div class="inftblinformal" style="font-family:Tahoma, sans-serif;font-size:small;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<table class="Informal" title="PGA_AGGREGATE_TARGET initialization parameter" summary="This table is described in the preceding text" dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0" style="font-size:small;">
<colgroup><col width="25%" /><col width="*" /></colgroup>
<thead>
<tr align="left" valign="top">
<th align="left" valign="bottom" id="r1c1-t364" style="vertical-align:bottom;">
<span style="font-size:16px;font-family:'Courier New';">Property</span>
</th>
<th align="left" valign="bottom" id="r1c2-t364" style="vertical-align:bottom;">
<span style="font-size:16px;font-family:'Courier New';">Description</span>
</th>
</tr>
</thead>
<tbody>
<tr align="left" valign="top">
<td align="left" id="r2c1-t364" headers="r1c1-t364" style="vertical-align:top;">
<span class="bold" style="font-size:16px;font-family:'Courier New';">Parameter type</span>
</td>
<td align="left" headers="r2c1-t364 r1c2-t364" style="vertical-align:top;">
<span style="font-size:16px;font-family:'Courier New';">Big integer</span>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r3c1-t364" headers="r1c1-t364" style="vertical-align:top;">
<span class="bold" style="font-size:16px;font-family:'Courier New';">Syntax</span>
</td>
<td align="left" headers="r3c1-t364 r1c2-t364" style="vertical-align:top;">
<code><span style="font-size:16px;font-family:'Courier New';">PGA_AGGREGATE_TARGET =</span></code><span style="font-size:16px;font-family:'Courier New';"> </span><code><span class="codeinlineitalic" style="font-style:italic;font-size:16px;font-family:'Courier New';">integer</span></code><span style="font-size:16px;font-family:'Courier New';"> </span><code><span style="font-size:16px;font-family:'Courier New';">[K | M | G]</span></code>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r4c1-t364" headers="r1c1-t364" style="vertical-align:top;">
<span class="bold" style="font-size:16px;font-family:'Courier New';">Default value</span>
</td>
<td align="left" headers="r4c1-t364 r1c2-t364" style="vertical-align:top;">
<span style="font-size:16px;font-family:'Courier New';">10 MB or 20% of the size of the SGA, whichever is greater</span>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r5c1-t364" headers="r1c1-t364" style="vertical-align:top;">
<span class="bold" style="font-size:16px;font-family:'Courier New';">Modifiable</span>
</td>
<td align="left" headers="r5c1-t364 r1c2-t364" style="vertical-align:top;">
<code><span style="font-size:16px;font-family:'Courier New';">ALTER SYSTEM</span></code>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r6c1-t364" headers="r1c1-t364" style="vertical-align:top;">
<span class="bold" style="font-size:16px;font-family:'Courier New';">Range of values</span>
</td>
<td align="left" headers="r6c1-t364 r1c2-t364" style="vertical-align:top;">
<span style="font-size:16px;font-family:'Courier New';">Minimum: 10 MB</span>
<p style="margin-top:0px;margin-bottom:0px;">
<span style="font-size:16px;font-family:'Courier New';">Maximum: 4096 GB - 1</span>
</p>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r7c1-t364" headers="r1c1-t364" style="vertical-align:top;">
<span class="bold" style="font-size:16px;font-family:'Courier New';">Basic</span>
</td>
<td align="left" headers="r7c1-t364 r1c2-t364" style="vertical-align:top;">
<span style="font-size:16px;font-family:'Courier New';">Yes</span>
</td>
</tr>
</tbody>
</table>
<br />
</div>
<p style="font-family:Tahoma, sans-serif;font-size:small;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';">PGA_AGGREGATE_TARGET</span></code><span style="font-size:16px;font-family:'Courier New';"> specifies the target aggregate PGA memory available to all server processes attached to the instance.</span>
</p>
<p style="font-family:Tahoma, sans-serif;font-size:small;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong>Setting </strong></span><code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong>PGA_AGGREGATE_TARGET</strong></span></code><span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong> to a nonzero value has the effect of automatically setting the </strong></span><code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong>WORKAREA_SIZE_POLICY</strong></span></code><span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong> parameter to </strong></span><code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong>AUTO</strong></span></code><span style="font-size:16px;font-family:'Courier New';"><strong>.</strong> This means that SQL working areas used by memory-intensive SQL operators (such as sort, group-by, hash-join, bitmap merge, and bitmap create) will be automatically sized. A nonzero value for this parameter is the default since, unless you specify otherwise, Oracle sets it to 20% of the SGA or 10 MB, whichever is greater.</span>
</p>
<p style="font-family:Tahoma, sans-serif;font-size:small;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong>Setting </strong></span><code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong>PGA_AGGREGATE_TARGET</strong></span></code><span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong> to 0 automatically sets the </strong></span><code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong>WORKAREA_SIZE_POLICY</strong></span></code><span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong> parameter to </strong></span><code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong>MANUAL</strong></span></code><span style="font-size:16px;font-family:'Courier New';">. This means that SQL workareas are sized using the </span><code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';">*_AREA_SIZE</span></code><span style="font-size:16px;font-family:'Courier New';"> parameters.</span>
</p>
<p style="font-family:Tahoma, sans-serif;font-size:small;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<span style="font-size:16px;font-family:'Courier New';">Oracle attempts to keep the amount of private memory below the target specified by this parameter by adapting the size of the work areas to private memory. When increasing the value of this parameter, you indirectly increase the memory allotted to work areas. Consequently, more memory-intensive operations are able to run fully in memory and less will work their way over to disk.</span>
</p>
<p style="font-family:Tahoma, sans-serif;font-size:small;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<span style="font-size:16px;font-family:'Courier New';">When setting this parameter, you should examine the total memory on your system that is available to the Oracle instance and subtract the SGA. You can assign the remaining memory to</span><code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';">PGA_AGGREGATE_TARGET</span></code><span style="font-size:16px;font-family:'Courier New';">.</span>
</p>
<h1 class="sect1" id="insertedID0" style="font-size:21px;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#DDDDDD;width:1164px;font-family:Tahoma, sans-serif;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<span style="font-size:18px;font-family:'Courier New';"><br />
</span>
</h1>
<h1 class="sect1" id="insertedID0" style="font-size:21px;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#DDDDDD;width:1164px;font-family:Tahoma, sans-serif;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<span style="font-size:18px;font-family:'Courier New';">>WORKAREA_SIZE_POLICY</span>
</h1>
<div class="inftblinformal" style="font-family:Tahoma, sans-serif;font-size:small;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<table class="Informal" title="WORKAREA_SIZE_POLICY initialization parameter" summary="This table is described in the preceding text" dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0" style="font-size:small;">
<colgroup><col width="25%" /><col width="*" /></colgroup>
<thead>
<tr align="left" valign="top">
<th align="left" valign="bottom" id="r1c1-t510" style="vertical-align:bottom;">
<span style="font-size:16px;font-family:'Courier New';">Property</span>
</th>
<th align="left" valign="bottom" id="r1c2-t510" style="vertical-align:bottom;">
<span style="font-size:16px;font-family:'Courier New';">Description</span>
</th>
</tr>
</thead>
<tbody>
<tr align="left" valign="top">
<td align="left" id="r2c1-t510" headers="r1c1-t510" style="vertical-align:top;">
<span class="bold" style="font-size:16px;font-family:'Courier New';">Parameter type</span>
</td>
<td align="left" headers="r2c1-t510 r1c2-t510" style="vertical-align:top;">
<span style="font-size:16px;font-family:'Courier New';">String</span>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r3c1-t510" headers="r1c1-t510" style="vertical-align:top;">
<span class="bold" style="font-size:16px;font-family:'Courier New';">Syntax</span>
</td>
<td align="left" headers="r3c1-t510 r1c2-t510" style="vertical-align:top;">
<code><span style="font-size:16px;font-family:'Courier New';">WORKAREA_SIZE_POLICY = { AUTO | MANUAL }</span></code>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r4c1-t510" headers="r1c1-t510" style="vertical-align:top;">
<span class="bold" style="font-size:16px;font-family:'Courier New';">Default value</span>
</td>
<td align="left" headers="r4c1-t510 r1c2-t510" style="vertical-align:top;">
<code><span style="font-size:16px;font-family:'Courier New';">AUTO</span></code>
</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r5c1-t510" headers="r1c1-t510" style="vertical-align:top;">
<span class="bold" style="font-size:16px;font-family:'Courier New';">Modifiable</span>
</td>
<td align="left" headers="r5c1-t510 r1c2-t510" style="vertical-align:top;">
<code><span style="font-size:16px;font-family:'Courier New';">ALTER SESSION</span></code><span style="font-size:16px;font-family:'Courier New';">, </span><code><span style="font-size:16px;font-family:'Courier New';">ALTER SYSTEM</span></code>
</td>
</tr>
</tbody>
</table>
<br />
</div>
<p style="font-family:Tahoma, sans-serif;font-size:small;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';">WORKAREA_SIZE_POLICY</span></code><span style="font-size:16px;font-family:'Courier New';"> specifies the policy for sizing work areas. This parameter controls the mode in which working areas are tuned.</span>
</p>
<p style="font-family:Tahoma, sans-serif;font-size:small;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<span class="bold" style="font-size:16px;font-family:'Courier New';">Values:</span>
</p>
<ul style="font-family:Tahoma, sans-serif;font-size:small;line-height:normal;white-space:normal;widows:auto;background-color:#FFFFFF;">
<li>
<p>
<code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';">AUTO</span></code>
</p>
<p>
<span style="font-size:16px;font-family:'Courier New';">Work areas used by memory-intensive operators are sized automatically, based on the PGA memory used by the system, the target PGA memory set in </span><code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';">PGA_AGGREGATE_TARGET</span></code><span style="font-size:16px;font-family:'Courier New';">, and the requirement of each individual operator.</span>
</p>
</li>
<li>
<p>
<code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';">MANUAL</span></code>
</p>
<p>
<span style="font-size:16px;font-family:'Courier New';">The sizing of work areas is manual and based on the values of the *</span><code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';">_AREA_SIZE</span></code><span style="font-size:16px;font-family:'Courier New';"> parameter corresponding to the operation (for example, a sort uses </span><code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';">SORT_AREA_SIZE</span></code><span style="font-size:16px;font-family:'Courier New';">). Specifying </span><code style="font-size:12px;"><span style="font-size:16px;font-family:'Courier New';">MANUAL</span></code><span style="font-size:16px;font-family:'Courier New';"> may result in sub-optimal performance and poor PGA memory utilization.</span>
</p>
</li>
</ul>
<span style="font-size:16px;font-family:'Courier New';"></span><span style="font-size:16px;font-family:'Courier New';color:#E53333;"><strong>实践证明,可以将PGA_AGGREGATE_TARGET设置为非0值,而将WORKAREA_SIZE_POLICY设置为MANUAL;</strong></span><br />
<br />
<span style="font-size:18px;font-family:'Courier New';"><strong>五.</strong></span><span style="font-size:18px;font-family:'Courier New';"><strong>How To Super-Size Work Area Memory Size Used By Sessions? (Doc ID 453540.1)</strong></span><span style="font-size:18px;font-family:'Courier New';"><strong></strong></span><br />
<p>
<b><span style="font-size:16px;">In this Document</span></b>
</p>
<table>
<tbody>
<tr>
<td width="0">
</td>
<td>
<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=312447618955362&id=453540.1&_adf.ctrl-state=9ybipf1yn_75#GOAL"><span style="font-size:16px;">Goal</span></a>
</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td width="0">
</td>
<td>
<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=312447618955362&id=453540.1&_adf.ctrl-state=9ybipf1yn_75#FIX"><span style="font-size:16px;">Solution</span></a>
</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td width="0">
</td>
<td>
<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=312447618955362&id=453540.1&_adf.ctrl-state=9ybipf1yn_75#REF"><span style="font-size:16px;">References</span></a>
</td>
</tr>
</tbody>
</table>
<hr size="1" />
<p>
<br />
</p>
<h2 class="km">
<span style="font-size:16px;">Applies to:</span>
</h2>
<span style="font-size:16px;">Oracle Database - Enterprise Edition - Version 10.2.0.1 and later</span><br />
<span style="font-size:16px;">Information in this document applies to any platform.</span><br />
<span style="font-size:16px;"> ***Checked for relevance on 08-Jul-2015***</span><br />
<h2 class="km">
<span style="font-size:16px;">Goal</span>
</h2>
<p>
<span style="font-size:16px;">How to super-size the work area memory size that can be used by any session in the database?</span>
</p>
<h2 class="km">
<span style="font-size:16px;">Solution</span>
</h2>
<p>
<span style="font-size:16px;">With the automatic PGA management mode, you can control the size for
the work area sizes, to be able perform big sort operations or hash
joins in memory and avoid messages like:</span>
</p>
<div class="kmnotebox">
<span style="font-size:16px;">kxhfWrite: hash-join is spilling to disk</span>
</div>
<p>
<br />
<span style="font-size:16px;">You have to set the following parameters to proper values:</span><br />
<br />
<span style="font-size:16px;">1. PGA_AGGREGATE_TARGET</span>
</p>
<ul>
<li>
<span style="font-size:16px;">should be set to five times the desired work area size</span>
</li>
</ul>
<p>
<br />
<span style="font-size:16px;">2. _PGA_MAX_SIZE</span>
</p>
<ul>
<li>
<span style="font-size:16px;">should be set in minimum of twice the desired work area size. The default value is 200Mb.</span>
</li>
</ul>
<p>
<br />
<span style="font-size:16px;">3. _SMM_MAX_SIZE</span>
</p>
<ul>
<li>
<span style="font-size:16px;">normally this parameter is not needed but maybe under certain circumstances</span>
</li>
<li>
<span style="font-size:16px;">if set it should be equal to the desired work area size (in kb !)</span>
</li>
</ul>
<p>
<br />
<span style="font-size:16px;">Example:</span><br />
<span style="font-size:16px;">If you like to use a sort area size of 2GB for a
special operation (e.g for the creating of an index on a large table)
you could set the values as follows:</span>
</p>
<div class="kmcodeblock">
<span style="font-size:16px;">PGA_AGGREGATE TARGET = 10G</span><br />
<span style="font-size:16px;">"_PGA_MAX_SIZE" = 2G</span><br />
<span style="font-size:16px;">"_SMM_MAX_SIZE" = 2097152</span>
</div>
<p>
<br />
<span style="font-size:16px;">Dynamically, the values must be changed for the full instance
using the "alter system" command. It is not allowed changes the above
parameters for one session.</span><br />
<br />
<span style="font-size:16px;">Please note that there is an internal
limitation that a single workarea size is limited to 2GB. But you can
manually set _pga_max_size above 2gb if you have the fix for bug
17951233.</span><br />
<br />
<em><span style="font-size:16px;">_PGA_MAX_SIZE is set up to 2GB (1GB limit for 32-bit) per bug </span></em><span style="font-size:16px;">3946308</span><br />
<br />
<span style="font-size:16px;">Also
please be careful that the above changes are very dangerous because the
values affect all sessions in the database. If you need to have
granular control of the work area for a single session, then it is
better to set at the session level WORKAREA_SIZE_POLICY=MANUAL and
*_AREA_SIZE as high as needed.</span>
</p>
<div class="kmnotebox">
<strong><span style="font-size:16px;">NOTE:</span></strong><br />
<span style="font-size:16px;">PGA_AGGREGATE_TARGET can only be used when using ASMM with Oracle 10g and higher. </span><br />
<span style="font-size:16px;">When using AMM with Oracle 11g and higher, the PGA size is also automatically managed.</span>
</div>
<span style="font-size:16px;"><br />
MOS文章写得很清楚,到此应该明白该问题的原因,以及处理该问题的方法了。<br />
</span><span style="font-size:16px;font-family:'Courier New';"><br />
之前的一个案例《</span><span style="font-size:16px;font-family:'Courier New';">WORKAREA_SIZE_POLICY参数引起的ORA-04030错误</span><span style="font-size:16px;font-family:'Courier New';">》</span><span style="font-size:16px;font-family:'Courier New';">:</span><a href="http://blog.itpub.net/23135684/viewspace-712772/" target="_blank"><span style="font-size:16px;font-family:'Courier New';">http://blog.itpub.net/23135684/viewspace-712772/</span></a><span style="font-size:16px;font-family:'Courier New';"></span><br />
<span style="font-size:16px;font-family:'Courier New';"></span><br />
<span style="font-size:16px;font-family:'Courier New';">--end--</span> <span style="font-size:16px;"></span><br />
再次遇到ORA-04030的错误
时间: 2024-10-12 11:57:15
再次遇到ORA-04030的错误的相关文章
tomcat-关于hibernate的问题,一个项目刚导入时可以运行,但在果断时间后再次运行就报500错误
问题描述 关于hibernate的问题,一个项目刚导入时可以运行,但在果断时间后再次运行就报500错误 具体情况介绍,在某网站下载了一份开源代码之后,第一次导入Eclipse,是可以运行的.但在一段时间之后,再次运行报500错误.期间没有对代码有过任何修改.删除该项目重新解压一份并导入后又可以运行,但过段时间后又不能运行.感觉这个问题很奇怪,有没有大神懂.下面我说一下今天的情况:下午又导入了一次,运行时没问题的,然后我停掉tomcat后,紧接着又运行了一遍,还是可以的.之后我就不再运行这个项目.
ORACLE的ORA-1693错误以及表和索引的表空间的移动
本公司开发的软件,有客户不能上传大的附件,页面不报任何错误.查看JBOSS日志,同样看不到任何错误,排除了软件本身故障. 在查看oracle数据库日志,发现当上传大的附件时出现错误信息 OEA_1693: MAX # EXTENTS 4096 reached in lobsegment nes.sys_LOB0000024832C00008$$ 解决过程 上网找了下资料 ORA-1693 max # extents (string) reached in lob segment string.s
Yaf中Action再次Dispatch导致PHP段错误Segmentation fault
首先,这个问题是在Yaf群偶然看到的,这些小伙儿不折腾不畅快,今天闲来,扫了一下代码,得出结论. 其次,另外一个观点是,工具在运用时一定要清楚其原理,不然就是自己跳坑了没有人救的. 先简单明了看一下,在基于Yaf的PHP代码示例: 代码如下 复制代码 <?php use Yaf\Dispatcher; use Yaf\Controller_Abstract; final class IndexController extends Controller_Abstract { public
XMPPStream::connectToHost:onPort:withTimeout:error: ,每次进入后台几分钟后再次打开程序回报这个错误
问题描述 解决方案 这不是报错,是连接环信服务器的打印,error是空,后面是端口信息.
plsql连接oracle数据库报ora 12154错误解决方法_oracle
plsql连接oracle数据库报ora 12154错误 今天遇到一个问题,使用sqlplus能够连接到远程的数据库,但是使用plsql却连接不上,报错"ORA-12154: TNS: 无法解析指定的连接标识符" 解决方法如下: 1.先检查服务器端的监听服务是否打开,如果没有打开请启动其监听 客户端:tnsping <tns_name> 服务器Linux下: #>lsnrctl status 查看监听状态 #>lsnrctl start 启动监听 2.通过Sql
Oracle的常见错误及解决办法
ORA-12528: TNS:listener: all appropriate instances are blocking new connections ORA-12528问题是因为监听中的服务使用了动态服务,实例虽然启动,但没有注册到监听.实例是通过PMON进程注册到监听上的,而PMON进程需要在MOUNT状态下才会启动.所以造成了上面的错误. 解决这个问题,有三种方法:1.把监听设置为静态:2.在tnsnames.ora中追加(UR=
Oracle11.1.0.7版本的ASSM与ORA-04030错误
虽然Oracle的最新版本都已经要到12.2了,但是在国内的生产环境,因为各种原因,尤其是政府部门和传统企业,其数据库版本却没有迭代到最新的Oracle数据库版本,本人就负责的就有10g的生产库,并且还存着核心数据(之前听同行说他们生产环境还有9i的库,不敢轻易触碰......).这次的经验和教训是: 1.本人一开始学习的版本是11.2.0.4,相比之前的版本新特性很多,切忌套用到旧版本: 2.RAC架构的数据库,停库的时候一定要保留一个节点,一次关闭一个实例,这或许会成为你救命的稻草: 3.最
该内存不能为read或written错误的解决
当我们在计算机系统中运行一些容量较大的程序或者游戏时,系统常常会自动弹出"xx内存不能为read或written"的错误提示,遇到这种故障信息时,我们该如何才能将它有效排除,同时确保下次运行容量较大的程序或者游戏时,系统不会再次出现系统内存读写错误呢?事实上,当我们不幸遭遇上面的故障信息时,我们可以尝试按照如下步骤进行依次排查: 移除无效插件程序 在上网冲浪的过程中,许多插件程序会偷偷地安装到计算机系统中,而不少插件程序往往都有防删除的功能,因此这些插件很容易与其他的应用程序发生冲突,
XP系统出现“内存不能为read”错误
当我们在计算机系统中运行一些容量较大的程序或者游戏时,系统常常会自动弹出"xx内存不能为read或written"的错误提示,遇到这种故障信息时,我们该如何才能将它有效排除,同时确保下次运行容量较大的程序或者游戏时,系统不会再次出现系统内存读写错误呢?事实上,当我们不幸遭遇上面的故障信息时,我们可以尝试按照如下步骤进行依次排查: 移除无效插件程序 在上网冲浪的过程中,许多插件程序会偷偷地安装到计算机系统中,而不少插件程序往往都有防删除的功能,因此这些插件很容易与其他的应用程序发生冲
让Windows XP不再出现内存读写错误
让WindowsXP不再出现内存读写错误 计算机系统中运行一些容量较大的程序或者游戏时,系统常常会自动弹出"xx内存不能为read或written"的错误提示,遇到这种故障信息时,我们该如何才能将它有效排除,同时确保下次运行容量较大的程序或者游戏时,系统不会再次出现系统内存读写错误呢?事实上,当我们不幸遭遇上面的故障信息时,我们可以尝试按照如下步骤进行依次排查:移除无效插件程序 在上网冲浪的过程中,许多插件程序会偷偷地安装到计算机系统中,而不少插件程序往往都有防删除的功能,因此这些插件