Oracle 11gR2 登入EM狀態顯示Agent Unreachable的問題
最近在Windows Server 2008 R2安裝Oracle Database 11gR2,
安裝後原本一切正常,
後來某次重開機後,登入Enterprise Manager後,
status卻顯示Agent Unreachable
開啟services清單發現OracleDBConsoleorcl服務未啟動,
手動啟動失敗並出現錯誤訊息:
“Windows could not start OracleDbConsoleorcl on Local Computer. If this is a non-Microsoft service, contact the service vendor, and refer the service specific error code 2”
後來回想前一天似乎曾調整過系統的時區,把UTC-8更改成UTC+8,
可能是造成服務無法啟動的原因,
因此試看看是否能夠透過重設agent時區解決問題。
以系統管理者啟動命令提示字元,輸入指令:
1 |
emctl resetTZ agent |
(執行前先確認環境變數ORACLE_UNQNAME是否已設定,值即是SID,我的設定是預設值orcl)
回傳下列訊息:
1 2 3 4 5 6 7 8 9 10 11 12 |
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0 Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved. Updating C:\app\Administrator\product\11.2.0\dbhome_1/servername_orcl/sysman/config /emd.properties... Successfully updated C:\app\Administrator\product\11.2.0\dbhome_1/servername_orcl/s ysman/config/emd.properties. Login as the em repository user and run the script: exec mgmt_target.set_agent_tzrgn('servername:3938','Asia/Taipei') and commit the changes This can be done for example by logging into sqlplus and doing SQL> exec mgmt_target.set_agent_tzrgn('servername:3938','Asia/Taipei') SQL> commit |
再以sysdba身分登入SQL Plus,輸入剛剛回傳訊息中提示的指令:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 27 13:55:40 2013 Copyright (c) 1982, 2010, Oracle. All rights reserved. Enter user-name: sys as sysdba Enter password: Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> exec mgmt_target.set_agent_tzrgn('servername:3938','Asia/Taipei') PL/SQL procedure successfully completed. SQL>commit; Commit complete. |
重新啟動OS後就恢復正常了!! \(^▽^)/