在 Oracle EM grid control 11g 安装完成后,在一个监控服务器上重装 agent 一下, agent 就不能工作了。
使用 emctl upload 检查时报错为 ”EMD upload error: uploadXMLFiles skipped” 。如下所示:
[oracle@codb2 ~]$ emctl upload
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD upload error: uploadXMLFiles skipped :: OMS version not checked yet. If this issue persists check trace files for ping to OMS related errors.
这是 Oracle EM Grid Control 11g 安装指导 一文中介绍的安装 EM GRID CONTROL 11G 结束后,配置 agent 时出现的问题。如果你需要知道如何去安装配置 grid control 11g ,请参考此文。
( miki 西游的文档 , 原文链接 : http://mikixiyou.iteye.com/blog/1545847 ,转载请著名作者和出处)
这个问题如何解决呢?
首先,我在监控服务器上,也就是 codb2 服务器上使用 emctl verifykey 校验一下。发现是 OMS 将这个 agent 给 block 了。
[oracle@codb2 ~]$ emctl verifykey
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
-----------------------------------------------------
verifykey: Successfully Completed communication with agent
EMD pingOMS error: Invalid ping response "ERROR-Agent is blocked. Blocked reason is: Agent is out-of-sync with repository. This most likely means that the agent was reinstalled or recovered. Please contact an EM administrator to unblock the agent by performing an agent resync from the console. Please contact EM adminstrator to unblock the agent"
那么,我就去 OEM grid control 11g 的控制台上去解决这个 block 。
在控制台主目录中,选择未知的对象,代理重新同步,不成功。报错如下:
“ 代理操作已完成 , 但出现错误。对于那些无法保存的目标 , 请转至目标的监视配置页以保存它们。已成功保存所有其他目标。仍未取消阻止代理。
与代理通信时出错。异常错误消息 - oracle.sysman.emSDK.emd.comm.CommException: IOException in reading Response :: Connection reset “
在界面操作上没办法去取消这个代理了。于是乎,我们登录 grid control 的资料库中,去直接修改配置信息。
使用函数 mgmt_admin.cleanup_agent('host:port'); 去清理这个 agent 。
参数 host 和 port 的值从监控端服务器中使用 emctl status agent 输出信息中取得。
详细信息如下:
[oracle@codb1 ~]$ emctl status agent
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Agent Version : 11.1.0.1.0
OMS Version : 11.1.0.1.0
Protocol Version : 11.1.0.0.0
Agent Home : /u01/app/oracle/product/10.2.0/oms/agent11g/codb1.xxyy.com.cn
Agent binaries : /u01/app/oracle/product/10.2.0/oms/agent11g
Agent Process ID : 21727
Parent Process ID : 21673
Agent URL : https://codb1.xxyy.com.cn:3872/emd/main
Repository URL : https://htwebapp1:4900/em/upload
Started at : 2012-05-31 15:54:52
Started by user : oracle
Last Reload : 2012-05-31 16:05:04
Last successful upload : 2012-05-31 16:10:07
Total Megabytes of XML files uploaded so far : 0.39
Number of XML files pending upload : 0
Size of XML files pending upload(MB) : 0.00
Available disk space on upload filesystem : 44.51%
Last successful heartbeat to OMS : 2012-05-31 16:22:05
---------------------------------------------------------------
Agent is Running and Ready
请注意这一行
Agent URL :https://codb1.xxyy.com.cn:3872/emd/main
codb1.xxyy.com.cn:3872 就是这些参数的值。在 sqlplus 中以 sysman 用户登录资料库,执行
execute mgmt_admin.cleanup_agent('codb1.xxyy.com.cn:3872');
执行过程如下:
/u01/oracle/home@webdg2=>emrep$sqlplus sysman/xxyy2012
SQL*Plus: Release 10.2.0.4.0 - Production on Thu May 31 17:15:54 2012
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> execute mgmt_admin.cleanup_agent('codb1.xxyy.com.cn:3872');
PL/SQL procedure successfully completed.
接着,我们到监控端服务器上去清理一些文件
进入 grid control 的安装目录,执行下列命令。
rm -r ./sysman/emd/state/*
rm -r ./sysman/emd/collection/*
rm -r ./sysman/emd/upload/*
rm ./sysman/emd/lastupld.xml
rm ./sysman/emd/agntstmp.txt
rm ./sysman/emd/blackouts.xml
rm ./sysman/emd/protocol.ini
最后重新配置一下 agent
emctl clearstate agent
emctl secure agent
emctl start agent
这一切都执行完成后,检查 emctl upload 是不是正常了。
[oracle@codb1 ~]$ emctl upload
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully
执行结果显示已 OK 。
( miki 西游的文档 , 原文链接 : http://mikixiyou.iteye.com/blog/1545847 ,转载请著名作者和出处)