在一次EMagent的升级时,在执行emctl upload agent的时候,agent无法XML文件,报错了ERROR-400。
1 2 3 4 5 6 7 |
au11qap950tels2:EMAGENT:/ora/product/emagent10g/agent10g/bin>/ora/product/emagent10g/agent10g/bin/emctl upload agent Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. --------------------------------------------------------------- EMD upload error: Failed to upload file A0000001.xml: HTTP error. Response received: ERROR-400|Data will be rejected for upload from agent 'http://nus904pi:3872/emd/main', max size limit for direct load exceeded [7078431/5242880] au11qap950tels2:EMAGENT:/ora/product/emagent10g/agent10g/bin> |
此时如果用emctl status agent检查,会发现Disabled by Upload Manager:
au11qap950tels2:CSD1AP2:/ora/product/emagent10g/agent10g/bin>./emctl status agent
Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Agent Version : 10.2.0.3.0
OMS Version : 10.2.0.5.0
Protocol Version : 10.2.0.2.0
Agent Home : /ora/product/emagent10g/agent10g/au11qap950tels2
Agent binaries : /ora/product/emagent10g/agent10g
Agent Process ID : 28617
Parent Process ID : 18098
Agent URL : http://nus904pi:3872/emd/main
Repository URL : http://emcentral.in.telstra.com.au:4889/em/upload/
Started at : 2012-05-05 14:44:10
Started by user : oracle
Last Reload : 2012-05-05 14:44:10
Last successful upload : (none)
Last attempted upload : (none)
Total Megabytes of XML files uploaded so far : 0.00
Number of XML files pending upload : 250
Size of XML files pending upload(MB) : 13.78
Available disk space on upload filesystem : 14.47%
Collection Status : Disabled by Upload Manager
Last successful heartbeat to OMS : 2012-06-08 22:07:46
---------------------------------------------------------------
Agent is Running and Ready
au11qap950tels2:CSD1AP2:/ora/product/emagent10g/agent10g/bin>
同时,如果去查emagent的trace文件:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
au11qap950tels2:EMAGENT:/ora/product/emagent10g/agent10g/au11qap950tels2/sysman/log>tail -400 emagent.trc ...... 2012-06-14 17:07:22,684 Thread-41562 ERROR upload: 1 Failure(s) in a row or XML error for A0000001.xml, retcode = -2, we give up 2012-06-14 17:08:26,642 Thread-41567 WARN upload: FxferSend: received http error in header from repository: http://emcentral.in.telstra.com.au:4889/em/upload/ ERROR-400|Data will be rejected for upload from agent 'http://nus904pi:3872/emd/main', max size limit for direct load exceeded [7078431/5242880] 2012-06-14 17:08:26,643 Thread-41567 ERROR upload: Failed to upload file A0000001.xml: HTTP error. Response received: ERROR-400|Data will be rejected for upload from agent 'http://nus904pi:3872/emd/main', max size limit for direct load exceeded [7078431/5242880] 2012-06-14 17:08:26,643 Thread-41567 ERROR upload: 1 Failure(s) in a row or XML error for A0000001.xml, retcode = -2, we give up 2012-06-14 17:09:30,588 Thread-41574 WARN upload: FxferSend: received http error in header from repository: http://emcentral.in.telstra.com.au:4889/em/upload/ ERROR-400|Data will be rejected for upload from agent 'http://nus904pi:3872/emd/main', max size limit for direct load exceeded [7078431/5242880] 2012-06-14 17:09:30,589 Thread-41574 ERROR upload: Failed to upload file A0000001.xml: HTTP error. Response received: ERROR-400|Data will be rejected for upload from agent 'http://nus904pi:3872/emd/main', max size limit for direct load exceeded [7078431/5242880] 2012-06-14 17:09:30,590 Thread-41574 ERROR upload: 1 Failure(s) in a row or XML error for A0000001.xml, retcode = -2, we give up au11qap950tels2:EMAGENT:/ora/product/emagent10g/agent10g/au11qap950tels2/sysman/log> |
这个问题产生的原因,是agent生成XML文件upload时,超过了规定的大小。而这个规定,在2个地方可以设置,一个是agent端,一个是在oms端。
(a) agent端:
在$AGENT_HOME/sysman/config/emd.properties中有个配置,单位是KB:
1 |
UploadFileSize=2048 |
该配置是设置emagen生成的每个XML文件的大小。一般来说,这个值需小于下面说的在oms端的设置。
(b) oms端:
在$OMS_HOME/sysman/config/emoms.properties中有个配置,单位是B:
1 |
em.loader.maxDirectLoadFileSz=5242880 |
oms端,这个值的默认是5M,它表示oms端允许接收来自emagent的最大的XML文件的大小。
从报错中:http://nus904pi:3872/emd/main’, max size limit for direct load exceeded [7078431/5242880],我们也可以看出oms端设置的是5M,而上传的文件大小为7M,超过其设置的最大值。
我们看一下上传报错的A0000001.xml,大小为7M,确实超过了oms端设置的最大值5M。
1 2 3 |
au11qap950tels2:EMAGENT:/ora/product/emagent10g/agent10g/au11qap950tels2/sysman/emd/upload>ls -l A0000001.xml -rw-r----- 1 oracle dba 7078431 May 5 01:18 A0000001.xml au11qap950tels2:EMAGENT:/ora/product/emagent10g/agent10g/au11qap950tels2/sysman/emd/upload> |
对于这个问题,在metalink上的给出的解决方法是修改agent端的配置文件和oms端的配置文件,特别是oms端的配置文件。Agent Upload to OMS Fails with “ERROR-400|Data will be rejected for upload from agent … max size limit for direct load exceeded” [ID 359097.1]
但是对于某些情况,如agent端在己方,oms端在局方,oms监控着全局2000多台数据库agent,不太可能访问oms的server,也不太可能重启oms。那我们只能在agent端想办法。
由于xml是agent抓的数据库性能的快照,我们其实可以删除旧的超大的xml文件,让agent重新生成xml文件。
1 2 3 4 5 6 |
emctl stop agent cd $AGENT_HOME/sysman/emd/upload mkdir xml_bak; mv *.xml xml_bak emctl start agent emctl upload agent |