楼主: nailxu

[讨论] 服务器都128G内存,还报ora04030。郁闷,求助!

[复制链接]
招聘 : 数据库管理员
论坛徽章:
20
祖国60周年纪念徽章
日期:2009-10-09 08:28:00数据库板块每日发贴之星
日期:2011-02-20 01:01:01ITPUB季度 技术新星
日期:2011-04-02 10:31:09ITPUB十周年纪念徽章
日期:2011-11-01 16:24:042012新春纪念徽章
日期:2012-01-04 11:54:26玉石琵琶
日期:2012-02-21 15:04:38最佳人气徽章
日期:2012-03-13 17:39:18ITPUB 11周年纪念徽章
日期:2012-10-09 18:09:192013年新春福章
日期:2013-02-25 14:51:242011新春纪念徽章
日期:2011-02-18 11:43:33
11#
发表于 2010-6-13 17:44 | 只看该作者
估计跟这个sql关系不是很大  可能还是哪儿设置的问题

使用道具 举报

回复
论坛徽章:
0
12#
 楼主| 发表于 2010-6-13 18:05 | 只看该作者
Alter System Set "_pga_max_size"=12288M;

SELECT ksppinm, ksppstvl, ksppdesc
  FROM x$ksppi x, x$ksppcv y
WHERE x.indx = y.indx AND ksppinm IN ('_pga_max_size', '_smm_max_size');

_pga_max_size        12884901888
_smm_max_size       6291456


可是还报同样的错。

在toad中监控该进程,
SELECT   SID, NAME, VALUE,substr(value/1024/1024/1024,1,4)||'G'
    FROM v$statname n, v$sesstat s
   WHERE n.statistic# = s.statistic# AND NAME LIKE 'session%memory%'
ORDER BY 3 deSC;
总是当
session pga memory max 到达3.99G
session uga memory max 到达3.99G

时程序崩溃!
限制到底在哪里?

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
13#
发表于 2010-6-13 21:31 | 只看该作者
I looked at the bug yezhibin mentioned. It would be triggered by bulk insert, which is not what you did.

Try setting pga_aggregate_target to a larger number, say, 100 GB (so 5% of it 5 GB).

On the other hand, it's unusual for a SQL to require so much PGA. Is it possible you break it up into smaller pieces and process them one piece at a time? The subquery factoring creates poi_keywords temporarily. How about forcing it to be a temporary segment by putting /*+ materialize */ hint in the subquery?

But in the whole SQL, the part that really uses too much PGA may be the XML processing part. I'm told there're two general methods to parse XML (not limited to Oracle or Java), one taking the whole XML document in, fast but with lots of memory, the other reading the document one chunk at a time, slow but with much less memory. But I don't know how to adapt that philosophy into Oracle XML processing.

Yong Huang

使用道具 举报

回复
论坛徽章:
25
授权会员
日期:2007-08-20 23:44:422011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-02-18 11:42:49管理团队成员
日期:2011-05-07 01:45:082012新春纪念徽章
日期:2012-01-04 11:49:54咸鸭蛋
日期:2012-02-06 17:15:202012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:36
14#
发表于 2010-6-16 13:07 | 只看该作者
看上去你这个SQL使用了XML,而在SQL执行时,会生成大量的临时的XML对象存储在PGA中。
不知道为什么要生成几百万行的XML数据,生成XML可以考虑使用客户端来实现。

使用道具 举报

回复
论坛徽章:
86
2015中国数据库技术大会纪念徽章
日期:2015-04-24 16:04:24马上有车
日期:2014-02-19 11:55:14马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11优秀写手
日期:2013-12-18 09:29:11日产
日期:2013-10-17 08:44:39马自达
日期:2013-08-26 16:28:022013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-23 16:55:51马上有房
日期:2014-02-19 11:55:14
15#
发表于 2010-6-16 19:26 | 只看该作者
好强大的数据量

使用道具 举报

回复
论坛徽章:
0
16#
 楼主| 发表于 2010-6-17 11:46 | 只看该作者

回复 #14 magic007 的帖子

可是PGA已经很大了,应该能放得下这些数据了呀。
可为何还不行呀。

使用道具 举报

回复
论坛徽章:
2
2009日食纪念
日期:2009-07-22 09:30:00ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28
17#
发表于 2010-6-17 23:51 | 只看该作者
通常ora-4030的错误有三种情况:
1、OS内存限制
2、内存泄露bug
3、分配太多对象

用PGA heapdump确认一下subheap内容:
SQL>oradebug setospid xxxxx
SQL>oradebug dump headdump 536870913

(备注:536870913=0×20000000+level 1
       0×20000000: dump top 5 subheaps 内容)
     level 1: PGA
)

然后egrep "HEAP DUMP|FIVE LARGEST|^SUBHEAP|Subheap|^Total"  xxxxxx.trc

看占用最多PGA前5个PGA是什么?

使用道具 举报

回复
论坛徽章:
2
2009日食纪念
日期:2009-07-22 09:30:00ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28
18#
发表于 2010-6-18 00:18 | 只看该作者
另外忘了重复一下,先看以下内容是否和v$sesstat值匹配,如果不匹配,再用上面heapdump看多余的部分是什么?

select category, allocated, used, max_allocated
from v$process_memory
where pid = (
              select        pid
              from        v$process
              where addr = ( select        paddr
                        from        V$session
                        where        sid = 你的SID))

select pga_used_mem, pga_alloc_mem, pga_freeable_mem, pga_max_mem
from v$process
where addr = (select  paddr
               from        V$session
               where sid = 你的SID);

使用道具 举报

回复
论坛徽章:
0
19#
 楼主| 发表于 2010-6-21 14:28 | 只看该作者
原来是个BUG
Bug 5883585 - ORA-4030 from long running XMLAGG query [ID 5883585.8]
Bug 5883585  ORA-4030 from long running XMLAGG query
This note gives a brief overview of bug 5883585.
The content was last updated on: 11-DEC-2009
Click here for details of each of the sections below.

Affects:
Product (Component) Oracle Server (Rdbms)
Range of versions believed to be affected Versions < 11  
Versions confirmed as being affected 10.2.0.4

Platforms affected Generic (all / most platforms affected)

Fixed:
This issue is fixed in 10.2.0.4 Patch 5 on Windows Platforms
10.2.0.5 (Server Patch Set)
11.1.0.6 (Base Release)

升级到10.2.0.5后就不报错了。早听二楼的就好了,呵呵!感谢大家的关心和指导!


[ 本帖最后由 nailxu 于 2010-6-21 14:29 编辑 ]

使用道具 举报

回复
论坛徽章:
40
技术图书徽章
日期:2023-02-28 10:16:02暖羊羊
日期:2015-02-10 17:19:24马上有房
日期:2015-01-12 10:57:17ITPUB社区OCM联盟徽章
日期:2014-08-27 17:33:52青年奥林匹克运动会-帆船
日期:2014-08-27 13:50:412014年世界杯参赛球队: 哥伦比亚
日期:2014-07-10 14:10:592014年世界杯参赛球队:墨西哥
日期:2014-06-24 10:38:072014年世界杯参赛球队: 加纳
日期:2014-06-23 13:12:032014年世界杯参赛球队: 美国
日期:2014-05-21 08:18:36沸羊羊
日期:2015-03-04 14:51:52
20#
发表于 2010-6-21 14:46 | 只看该作者
关注

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表