今天在用EM进行SQL TUNNNING时发现oracle 10g R2下EM得一个报错,错误如下 :“java.lang.Exception:IOException in sending Request :: Connection refused: connect”,遂通过查阅资料得到如下解决方案。
步骤如下:
1.停止emagent:
[oracle@prod~]$ emctl stop agent
TZset to PRC
OracleEnterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright(c) 1996, 2005 Oracle Corporation. Allrights reserved.
Thiswill stop the Oracle Enterprise Manager 10g Database Control process. Continue[y/n] :y
StoppingOracle Enterprise Manager 10g Database Control …
… Stopped.
Agentis not running.
2.重新设置时区
[oracle@prod~]$ emctl resetTZ agent
TZset to PRC
OracleEnterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright(c) 1996, 2005 Oracle Corporation. Allrights reserved.
Updating/u01/app/oracle/product/10.2/db_1/prod.oracle.com_prod/sysman/config/emd.properties…
Timezone set to PRC.
Tocomplete this process, you must either:
connectto the database served by this DBConsole as user ‘sysman’, and execute:
SQL>exec mgmt_target.set_agent_tzrgn(‘prod.oracle.com:3938′,’PRC’)
– or –
connectto the database served by this DBConsole as user ‘sys’, and execute:
SQL>alter session set current_schema = SYSMAN;
SQL>exec mgmt_target.set_agent_tzrgn(‘prod.oracle.com:3938′,’PRC’)
根据提示进行设置
3、时区设置
[oracle@prod~]$ sqlplus / as sysdba
SQL*Plus:Release 10.2.0.1.0 – Production on Sat Oct 29 11:54:16 2011
Copyright(c) 1982, 2005, Oracle. All rightsreserved.
Connectedto:
OracleDatabase 10g Enterprise Edition Release 10.2.0.1.0 – Production
Withthe Partitioning, OLAP and Data Mining options
SQL>alter session set current_schema = SYSMAN;
Sessionaltered.
SQL>exec mgmt_target.set_agent_tzrgn(‘prod.oracle.com:3938′,’PRC’)
PL/SQLprocedure successfully completed.
SQL>exit
Disconnectedfrom Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Production
Withthe Partitioning, OLAP and Data Mining options
4.启动emconsole
[oracle@prod~]$ emctl start agent
TZset to PRC
OracleEnterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright(c) 1996, 2005 Oracle Corporation. Allrights reserved.
Startingagent … started.
[oracle@prod~]$ emctl stop dbconsole
TZset to PRC
OracleEnterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright(c) 1996, 2005 Oracle Corporation. Allrights reserved.
http://prod.oracle.com:1158/em/console/aboutApplication
StoppingOracle Enterprise Manager 10g Database Control …
Cannot determine Oracle Enterprise Manager 10gDatabase Control process./u01/app/oracle/product/10.2/db_1/prod.oracle.com_prod/emctl.pid does notexist.
[oracle@prod~]$ emctl start dbconsole
TZset to PRC
OracleEnterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright(c) 1996, 2005 Oracle Corporation. Allrights reserved.
http://prod.oracle.com:1158/em/console/aboutApplication
AgentVersion : 10.1.0.4.1
OMSVersion : Unknown
ProtocolVersion : 10.1.0.2.0
AgentHome :/u01/app/oracle/product/10.2/db_1/prod.oracle.com_prod
Agentbinaries :/u01/app/oracle/product/10.2/db_1
AgentProcess ID : 12581
ParentProcess ID : 12578
AgentURL :http://prod.oracle.com:3938/emd/main
Startedat : 2011-10-29 11:55:00
Startedby user : oracle
LastReload : 2011-10-29 11:55:00
Lastsuccessful upload none)
Lastattempted upload none)
TotalMegabytes of XML files uploaded so far : 0.00
Numberof XML files pending upload : 15
Sizeof XML files pending upload(MB) : 2.41
Availabledisk space on upload filesystem : 79.74%
Agentis already started. Will restart the agent
Stoppingagent … stopped.
StartingOracle Enterprise Manager 10g Database Control …………………….started.
——————————————————————
Logsare generated in directory/u01/app/oracle/product/10.2/db_1/prod.oracle.com_prod/sysman/log
转载于:https://blog.51cto.com/803517/1354639