当安装oracle的机器变了机器名,或者变了ip地址。那么原来的dbconsole就起不来了。
或者当在dos下运行:emctl start dbconsole 的时候报错。解决办法:
1. 修改DBSNMP密码:
重新配置DBCONSOLE,需要输入DBSNMP密码,但任何密码都会显示错误,需要预先修改。
sql>alter user dbsnmp identified by xxx;
2. 删除早期DBCONSOLE创建的用户:
sql>drop role MGMT_USER;
sql>drop user MGMT_VIEW cascade;
sql>drop user sysman cascade;
3. 删除早期DBCONSOLE创建的对象:
sql>drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;
sql>drop PUBLIC SYNONYM SETEMVIEWUSERCONTEXT;
4. 重新创建DBCONSOLE:
[Windows系统]命令提示符下输入:
c:/>emca -config dbcontrol db -repos create
Enter the following information:
Database SID: orcl
Listener port number: 1521
assword for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
----------------------------------------------------------------------
输入以下有关要配置的数据库的信息数据库
SID: 根据实际监听程序端口号: 1521
dbsnmp 口令:刚才改的xxx(sql>alter user dbsnmp identified by xxx;)
sysman 口令:自己输一个
sys 口令:据实
通知的电子邮件地址: 可不填
通知的电子邮件网关:可不填
如果重建成功,则可看到以下信息:
INFO: >>>>>>>>>>> The Database Control URL is http://192.168.120.128:5501/em <<<<<<<<<<< Enterprise Manager configuration completed successfully FINISHED EMCA at Jan 7, 2011 6:05:35 PM 5.
PS:创建EM时,提示的端口号,应为实例的断口号,比如1521,不是EM的端口号(比如1158)
EM的端口号在这个文件中可以查到10.2.0db_1sysmanconfigemca.properties
6:创建成功后,检查状态命令 emctl status dbconsole
同样可以看到你的重建信息如下:
C:/>emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0 Copyright (c) 1996, 2005 Oracle Corporation.
All rights reserved. http://192.168.120.128:5501/em/console/aboutApplication Oracle Enterprise Manager 10g is running. ------------------------------------------------------------------ Logs are generated in directory C:/oracle/product/10.2.0/db_1/192.168.120.128_or cl/sysman/log :
7. 服务已经启动了。如果想手动重起: emctl stop dbconsole emctl start dbconsole
PS:打开浏览器输入http://机器名:端口/em 或者用http://IP:PORT/em可以访问
如果http://机器名:端口/em 不可用 ,则需要更改本机hosts文件,增加IP映射.