hosts檔案有多餘條目導致dbconsole配置不成功

liaoxiaomao發表於2011-11-29

1.修改密碼
alter user system identified by oracle;
alter user sys identified by oracle;
alter user dbsnmp identified by oracle account unlock;
alter user sysman identified by oracle account unlock;

2.配置em

emca -config dbcontrol db -repos recreate -cluster

===========crmdb
emca -config dbcontrol db -repos recreate -cluster

STARTED EMCA at Nov 23, 2011 2:45:49 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.

Enter the following information:
Database unique name: racdb
Service name: racdb
Listener ORACLE_HOME [ /oracle/app/11.2.0.3/grid ]:
Password for SYS user:
Database Control is already configured for the database racdb
You have chosen to configure Database Control for managing the database racdb
This will remove the existing configuration and the default settings and perform a fresh configuration
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Password for DBSNMP user:
Password for SYSMAN user:
Cluster name: racdb
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /oracle/app/oracle/product/11.2.0.3/dbhome_1

Database instance hostname ................ Listener ORACLE_HOME ................ /oracle/app/11.2.0.3/grid
Listener port number ................ 1521
Cluster name ................ racdb
Database unique name ................ racdb
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Nov 23, 2011 2:46:40 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/app/oracle/cfgtoollogs/emca/racdb/emca_2011_11_23_14_45_48.log.
Nov 23, 2011 2:46:44 PM oracle.sysman.emcp.util.PortManager isPortInUse
WARNING: Specified port 5540 is already in use.
Nov 23, 2011 2:46:44 PM oracle.sysman.emcp.util.PortManager isPortInUse
WARNING: Specified port 5520 is already in use.
Nov 23, 2011 2:46:44 PM oracle.sysman.emcp.util.PortManager isPortInUse
WARNING: Specified port 1158 is already in use.
Nov 23, 2011 2:46:44 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Nov 23, 2011 2:46:52 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Nov 23, 2011 2:49:02 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Nov 23, 2011 2:49:03 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Nov 23, 2011 2:53:43 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Nov 23, 2011 2:53:49 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Nov 23, 2011 2:54:55 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Nov 23, 2011 2:54:57 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /oracle/app/oracle/product/11.2.0.3/dbhome_1/oc4j/j2ee/OC4J_DBConsole_rac1_racdb to remote nodes ...
Nov 23, 2011 2:55:03 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /oracle/app/oracle/product/11.2.0.3/dbhome_1/oc4j/j2ee/OC4J_DBConsole_rac2_racdb to remote nodes ...
Nov 23, 2011 2:55:16 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /oracle/app/oracle/product/11.2.0.3/dbhome_1/rac1_racdb to remote nodes ...
Nov 23, 2011 2:55:22 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /oracle/app/oracle/product/11.2.0.3/dbhome_1/rac2_racdb to remote nodes ...
Nov 23, 2011 2:55:29 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Nov 23, 2011 2:56:48 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl secure dbconsole -host rac1 -sid racdb
Nov 23, 2011 2:56:48 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
WARNING: Error securing Database Control for node rac1.
Nov 23, 2011 2:57:03 PM oracle.sysman.emcp.EMDBPostConfig setRACWarnMsg
INFO: Error securing Database Control. Database Control has not been brought-up on nodes rac1 . Execute the following command(s) on nodes: rac1 .

1) Set the environment variable ORACLE_UNQNAME to Database unique name
2) /oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl config emkey -repos -sysman_pwd < Password for SYSMAN user > -host -sid < Database unique name >
3) /oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl secure dbconsole -sysman_pwd < Password for SYSMAN user > -host -sid < Database unique name >
4) /oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl start dbconsole

To secure Em Key, run /oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl config emkey -remove_from_repos -sysman_pwd < Password for SYSMAN user >
Nov 23, 2011 2:57:03 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Nov 23, 2011 2:57:21 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Nov 23, 2011 2:57:21 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is <<<<<<<<<<<
Nov 23, 2011 2:57:22 PM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO:
**************** Current Configuration ****************
INSTANCE NODE DBCONTROL_UPLOAD_HOST
---------- ---------- ---------------------

racdb rac1 rac1
racdb rac2 rac1

=======================================================
3. 日誌報secure agent時錯:
WARNING: Error executing /oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl secure dbconsole -host rac1 -sid racdb
Nov 23, 2011 2:56:48 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
WARNING: Error securing Database Control for node rac1.

4.重新執行emca -config dbcontrol db -repos recreate -cluster,結果還是相同的錯誤

5.檢查secure.log中的日誌,報Failed to stop agent...

2011-11-23 16:06:24,848 [main] INFO rep.EmKeyUtil main.542 - Configuring emkey from repos
2011-11-23 16:06:24,963 [main] INFO rep.EmKeyUtil main.572 - The Em Key has been configured successfully.
[23-11-2011 16:06:26] USERINFO ::DBCONSOLE already stopped... Done.
[23-11-2011 16:07:40] USERINFO ::Failed to stop agent...
2011-11-23 16:07:43,554 [main] INFO rep.EmKeyUtil main.517 - Configuring emkey
2011-11-23 16:07:43,677 [main] INFO rep.EmKeyUtil getConnection.464 - Connecting to jdbc:oracle:thin:@rac-scan:1521/racdb using i
d SYSMAN


6.手工執行/oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl secure dbconsole -host rac1 -sid racdb
也是報Failed to stop agent...

emctl secure dbconsole -host rac1 -sid racdb
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

Please enter repository password:
DBCONSOLE already stopped... Done.
Failed to stop agent...

7.殺掉節點2 agent 程式,重新執行第6步,還是一樣的錯誤

8.根據第2步中的日誌提示先執行以下指令碼
/oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl config emkey -repos -sysman_pwd oracle -host rac1 -sid racdb
/oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl secure dbconsole -sysman_pwd oracle -host rac1 -sid racdb
/oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl start dbconsole

/emctl config emkey -repos -sysman_pwd oracle -host rac1 -sid racdb <
/oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl secure dbconsole -sysman_pwd oracle -host rac1 -sid racdb
/oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

The Em Key has been configured successfully.
/emctl secure dbconsole -sysman_pwd oracle -host rac1 -sid racdb <
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

DBCONSOLE already stopped... Done.
Failed to stop agent...
/oracle/app/oracle/product/11.2.0.3/dbhome_1/bin/emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

Starting Oracle Enterprise Manager 11g Database Control ..... started.
------------------------------------------------------------------

dbconsole啟動成功,用可以訪問,沒有secure,不是https

9.但停止dbconsole一直不成功,hang住
emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

Stopping Oracle Enterprise Manager 11g Database Control ...
...

10.檢視emdctl.trc,報以下錯誤
2011-11-23 17:28:59,544 Thread-1 WARN http: nmehl_connect_internal: connect failed to (rac1:1158): A remote host did not respond w
ithin the timeout period. (error = 78)
2011-11-23 17:29:00,548 Thread-1 WARN http: nmehl_connect_internal: connect failed to (rac1:3938): A remote host did not respond w
ithin the timeout period. (error = 78)
2011-11-23 17:29:00,548 Thread-1 ERROR main: nmectla_agentctl: Error connecting to . Returning status code
2
2011-11-23 17:30:14,623 Thread-1 WARN http: nmehl_connect_internal: connect failed to (rac1:1158): A remote host did not respond w
ithin the timeout period. (error = 78)
2011-11-23 17:30:16,626 Thread-1 WARN http: nmehl_connect_internal: connect failed to (rac1:3938): A remote host did not respond w
ithin the timeout period. (error = 78)
2011-11-23 17:30:16,626 Thread-1 ERROR main: nmectla_agentctl: Error connecting to . Returning status code
2

11.根據"Returning status code 2"關鍵字查詢MOS,找到1292074.1,裡面提到可能的原因是"etc/hosts file was not in the correct format."

12.檢視/etc/hosts檔案
127.0.0.1 loopback localhost # loopback (lo0) name/address
10.27.229.220 rac1
10.27.229.221 rac1-vip
200.200.229.220 rac1-priv
10.27.229.222 rac2
10.27.229.223 rac2-vip
200.200.229.222 rac2-priv
10.27.229.224 rac-scan
10.27.229.196 stormon2
10.27.229.11 stormon2_cps
192.168.10.3 rac1

格式沒有問題,發現多了192.168.10.3 rac1,而且192.168.10.3地址ping不通

# ping 192.168.10.3
PING 192.168.10.3: (192.168.10.3): 56 data bytes
^C
----192.168.10.3 PING Statistics----
2 packets transmitted, 0 packets received, 100% packet loss

nestat -in看並沒有這個地址
# netstat -in
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
en13 1500 link#2 e4.1f.13.50.e4.72 0 0 1488 1488 0
en13 1500 192.168.10 192.168.10.11 0 0 1488 1488 0
en17 1500 link#3 5c.f3.fc.f.19.6e 9676217 0 1862293 2 0
en17 1500 10.27.229 10.27.229.220 9676217 0 1862293 2 0
en17 1500 10.27.229 10.27.229.221 9676217 0 1862293 2 0
en17 1500 10.27.229 10.27.229.224 9676217 0 1862293 2 0
en18 1500 link#4 5c.f3.fc.f.10.80 8392367 0 7428186 3 0
en18 1500 200.200.229 200.200.229.220 8392367 0 7428186 3 0
en18 1500 169.254 169.254.38.237 8392367 0 7428186 3 0
lo0 16896 link#1 1935698 0 1935376 0 0
lo0 16896 127 127.0.0.1 1935698 0 1935376 0 0
lo0 16896 ::1%1 1935698 0 1935376 0 0

13.註釋該地址後em可以正常停止,立刻返回Stopped

emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

Stopping Oracle Enterprise Manager 11g Database Control ...
... Stopped.

14.重新secure dbconsole,也正常

emctl secure dbconsole -host rac1 -sid racdb
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

Please enter repository password:
DBCONSOLE already stopped... Done.
Agent is already stopped... Done.
Securing dbconsole... Started.
Please enter repository schema password:
Securing dbconsole... Sucessful.

15.重啟dbconsole也正常了
emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

Stopping Oracle Enterprise Manager 11g Database Control ...
... Stopped.
emctl secure dbconsole -host rac1 -sid racdb
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

Please enter repository password:
DBCONSOLE already stopped... Done.
Agent is already stopped... Done.
Securing dbconsole... Started.
Please enter repository schema password:
Securing dbconsole... Sucessful.
emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

Starting Oracle Enterprise Manager 11g Database Control ..... started.

16.加密也成功了,可以透過正常訪問

總結:
1.碰到任何問題都要先看仔細的日誌,不要漏過任何資訊,然後根據日誌一步一步的分析,不要盲目的處理。

2./etc/hosts檔案中不要不留無用的條目 ,碰到一些問題棘手問題的時候檢查一下hosts配置是否正確

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/90901/viewspace-1056601/,如需轉載,請註明出處,否則將追究法律責任。

相關文章