hosts文件有多余条目导致dbconsole配置不成功

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
oracle@rac1[rac1]:/home/oracle$ 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 http://rac1:1158/em <<<<<<<<<<<
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...

oracle@rac1[rac1]:/oracle/app/oracle/product/11.2.0.3/dbhome_1/rac2_racdb/sysman/log$ 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.
http://rac1:1158/em/console/aboutApplication
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

oracle@rac1[rac1]:/home/oracle$ /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.
oracle@rac1[rac1]:/home/oracle$ /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.
http://rac1:1158/em/console/aboutApplication
DBCONSOLE already stopped... Done.
Failed to stop agent...
oracle@rac1[rac1]:/home/oracle$ /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.
http://rac1:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control ..... started.
------------------------------------------------------------------

dbconsole启动成功,用http://rac1:1158/em可以访问,没有secure,不是https

9.但停止dbconsole一直不成功,hang住
oracle@rac1[rac1]:/home/oracle$ emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
http://rac1:1158/em/console/aboutApplication
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 http://rac1:3938/emd/main. 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 http://rac1:3938/emd/main. 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不通

root@rac1:/# 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看并没有这个地址
root@rac1:/# 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

oracle@rac1[rac1]:/home/oracle$ emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
http://rac1:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 11g Database Control ...
... Stopped.

14.重新secure dbconsole,也正常

oracle@rac1[rac1]:/home/oracle$ 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.
http://rac1:1158/em/console/aboutApplication
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也正常了
oracle@rac1[rac1]:/home/oracle$ emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
http://rac1:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 11g Database Control ...
... Stopped.
oracle@rac1[rac1]:/home/oracle$ 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.
http://rac1:1158/em/console/aboutApplication
Please enter repository password:
DBCONSOLE already stopped... Done.
Agent is already stopped... Done.
Securing dbconsole... Started.
Please enter repository schema password:
Securing dbconsole... Sucessful.
oracle@rac1[rac1]:/home/oracle$ emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
https://rac1:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control ..... started.

16.加密也成功了,可以通过https://rac1:1158/em/正常访问

总结:
1.碰到任何问题都要先看仔细的日志,不要漏过任何信息,然后根据日志一步一步的分析,不要盲目的处理。

2./etc/hosts文件中不要不留无用的条目 ,碰到一些问题棘手问题的时候检查一下hosts配置是否正确

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/90901/viewspace-1056601/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/90901/viewspace-1056601/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值