今天早上我启动oracle em报错,查看一下原因:是因为昨天晚上改了主机名而没有改映射 /etc/hosts
改完映射后重新创建监听netca 重建em emca -config dbcontrol db
启动em 发现端口变成了5560
启动 监听 查看了一下 HOST 是tyger 连接到实例 OK
打开浏览器使用EM 报错:java.lang.Exception: UnknownHostException sending request
细看了一下 此时的数据库居然用的主机名是 whgg
1. 查看监听状态 HOST 是tyger
[oracle@tyger ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 12-MAR-2014 09:47:04
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tyger)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 12-MAR-2014 09:05:45
Uptime 0 days 0 hr. 41 min. 18 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tyger)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "ORCLXDB" has 1 instance(s).
Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "ORCL_XPT" has 1 instance(s).
Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@tyger ~]$
2. 查看了一下文件 发现有个目录下还有whgg的配置
[oracle@tyger j2ee]$ pwd
/u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee
[oracle@tyger j2ee]$ ls
deploy_db.ini isqlplus OC4J_DBConsole OC4J_DBConsole_whgg_ORCL
home oc4j_applications OC4J_DBConsole_tyger_ORCL
3. 于是我使用-report drop 的方式删除配置
[oracle@tyger ~]$ emca -deconfig dbcontrol db -repos drop
STARTED EMCA at Mar 12, 2014 9:47:28 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID:
ORCL
Listener port number:
1521
Password for SYS user:
Password for SYSMAN user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: y
Mar 12, 2014 9:47:39 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ORCL/emca_2014-03-12_09-47-28-AM.log.
Mar 12, 2014 9:47:39 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Mar 12, 2014 9:47:44 AM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Mar 12, 2014 9:49:17 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Mar 12, 2014 9:49:17 AM
4. 接着使用 repos recreate 重建配置
[oracle@tyger ~]$ emca -config dbcontrol db -repos recreate
STARTED EMCA at Mar 12, 2014 9:50:00 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID:
ORCL
Listener port number:
1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /u01/app/oracle/product/10.2.0/db_1
Database hostname ................ tyger
Listener port number ................ 1521
Database SID ................ ORCL
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Mar 12, 2014 9:50:15 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ORCL/emca_2014-03-12_09-50-00-AM.log.
Mar 12, 2014 9:50:16 AM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Mar 12, 2014 9:50:17 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Mar 12, 2014 9:50:17 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Mar 12, 2014 9:54:18 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Mar 12, 2014 9:54:27 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Mar 12, 2014 9:56:02 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Mar 12, 2014 9:56:02 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is
http://tyger:1158/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at Mar 12, 2014 9:56:02 AM
5. 查看此时dbconle 的状态
[oracle@tyger j2ee]$ emctl status dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://tyger:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/tyger_ORCL/sysman/log
重新使用1158端口登录em 一切正常