1. 程式人生 > >在10.2.0.5上啟動EM 出錯及解決

在10.2.0.5上啟動EM 出錯及解決

通過DBCA 安裝資料庫的同時選擇了安裝OEM

但是在DBCA建立的最後報錯如圖:

意思是我的HOST 檔案有問題

1.檢查我的/etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost
::1             localhost6.localdomain6 localhost6

改為

127.0.0.1               oracleDB
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
121.xx.xx.xx            oracleDB   

2. lsnrctl start 啟動監聽

並且檢查lsnrctl status 是否正確

如果是靜態註冊的,還執行一次 動態註冊  alter system register;

3.然後執行$emca -configdbcontrol db -reposrecreate
重建EM

但是到了這步最後報錯:

CONFIG: TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0  
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
https://ehomeDB:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ..................................................................
........................... failed.
------------------------------------------------------------------
Logs are generated in directory /opt/oracle/product/10.2.0/db_1/ehomeDB_ehome/sysman/log

Dec 7, 2011 2:47:48 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /opt/oracle/product/10.2.0/db_1/bin/emctl start dbconsole
Dec 7, 2011 2:47:48 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Error starting Database Control
Refer to the log file at

/opt/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ehome/emca_2011-12-07_02-36-27-PM.log for more d
etails.
Dec 7, 2011 2:47:48 PM oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Error starting Database Control
        at oracle.sysman.emcp.EMDBPostConfig.performConfiguration(EMDBPostConfig.java:649)
        at oracle.sysman.emcp.EMDBPostConfig.invoke(EMDBPostConfig.java:227)
        at oracle.sysman.emcp.EMDBPostConfig.invoke(EMDBPostConfig.java:196)
        at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:184)
        at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:494)
        at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1161)
        at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:478)
        at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:426)

4.啟動不了EM ,為啥呢?注意上面的紅色字部分,我去查這個檔案,結構內容就是這個記錄本身,找不到真正的原因。

因為是不能啟動em報錯,於是我手動執行 emctl start dbconsole 同時看 :tail -f  $ORACLE_HOME/<hostname>_<sid>/sysman/log/emagent.trc

看到如下報錯:

2011-12-07 14:42:52 Thread-4135462592 ERROR pingManager: nmepm_pingReposURL: Cannot connect to https://ehomeDB:1158/em/upl
oad/: retStatus=-1
2011-12-07 14:42:52 Thread-4135462592 WARN  main: clear collection state due to OMS_version difference
2011-12-07 14:42:52 Thread-4135462592 WARN  command: Job Subsystem Timeout set at 600 seconds
2011-12-07 14:42:52 Thread-4135462592 WARN  upload: Upload manager has no Failure script: disabled
2011-12-07 14:42:52 Thread-4135462592 WARN  upload: Recovering left over xml files in upload directory
2011-12-07 14:42:52 Thread-4135462592 WARN  upload: Recovered 0 left over xml files in upload directory
2011-12-07 14:42:52 Thread-4121947024 ERROR ssl: Open wallet failed, ret = 28750
2011-12-07 14:42:52 Thread-4121947024 ERROR ssl: nmehlenv_openWallet failed
2011-12-07 14:42:52 Thread-4121947024 ERROR http: 6: Unable to initialize ssl connection with server, aborting connection
attempt

同時 tail -f  $ORACLE_HOME/<hostname>_<sid>/sysman/log/emdctl.trc

2011-12-07 14:43:52 Thread-4135478976 ERROR ssl: Open wallet failed, ret = 28750
2011-12-07 14:43:52 Thread-4135478976 ERROR ssl: nmehlenv_openWallet failed
2011-12-07 14:43:52 Thread-4135478976 ERROR http: 5: Unable to initialize ssl connection with server, aborting connection attempt

5.這個時候通過搜尋發現了這是10.2.0.4(5)上的BUG

p8350262_10205_Generic.zip 下載到這個補丁後打上(GOOGLE後很容易找到下載連結):

 5.1   $unzip p8350262_10205_Generic.zip

          $ cd  8350262

          $ $ORACLE_HOME/OPatch/opatch  apply

Invoking OPatch 10.2.0.4.9

Oracle Interim Patch Installer version 10.2.0.4.9
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /opt/oracle/product/10.2.0/db_1
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.4.9
OUI version       : 10.2.0.5.0
OUI location      : /opt/oracle/product/10.2.0/db_1/oui
Log file location : /opt/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-12-07_15-21-26PM.log

Patch history file: /opt/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch '8350262' to OH '/opt/oracle/product/10.2.0/db_1'

Running prerequisite checks...

OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.

Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '8350262' for restore. This might take a while...
Backing up files affected by the patch '8350262' for rollback. This might take a while...

Patching component oracle.sysman.agent.core, 10.2.0.5.0a...
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/RootCert.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/SecConstants.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/RootCert.class"
Updating jar file "/opt/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/SecConstants.class"
ApplySession adding interim patch '8350262' to inventory

Verifying the update...
Inventory check OK: Patch ID 8350262 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 8350262 are present in Oracle Home.

OPatch succeeded.

6.打完patch ,以為這個時候可以啟動了

結構emctl start dbconsole 還是報錯,和上面的一樣。

沒辦法再重灌em一次:

$emca -configdbcontrol db -reposrecreate

在最好一步啟動的時候:這個時候報錯和以前不同了:

SEVERE: Cannot start Database Control. The following ports are already in use: [EM agent port:3938].

這是端口占用的情況。提示agent 佔用了 3938埠。

於是開始想用agent:

$emctl stop agent
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0  
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
Agent is not running.

提示Agent 沒有執行,奇怪怎麼還佔用這個埠,用下面這個命令再看看

#lsof -i :3938
COMMAND   PID   USER   FD   TYPE DEVICE SIZE NODE NAME
emagent 21002 oracle    5u  IPv4 101395       TCP *:dbcontrol_agent (LISTEN)

乾脆kill掉

#kill -9  21002

7.再emctl start dbconsole 

ok 日誌裡面也沒有報錯,用 http://hostname:1158/em/console 也能訪問,登入後也沒有出現java.lang.Exception: Exception in sending Request :: null 的情況。

一切正常了

P.S. 其實剛開始第一步完成後,雖然提示HOST設定有問題,但是當時我嘗試開啟 https://hostIP:1158/em/console 也可以登入EM,並且可以登入SYS 但是開啟后里面看到EM 其實是沒有啟動的,看不到資料庫相關資訊,有java.lang.Exception: Exception in sending Request :: null 報錯。

網上大多是說這個是時區設定的問題,確實在時區修改後很多情況下也會OK,但是其實在EM 沒有安裝好的情況下也會這樣。所以如果你改了時區還是有java.lang.Exception: Exception in sending Request :: null的報錯,那麼應該就說EM沒有安裝好,最好是重新安裝吧。

出現問題多找log trc 檔案看,找到問題的關鍵然後通過google 大神找到解決辦法。