出现这种现象的原因还有,当前用户没有当前目录的可执行权限,如没有正确设置ORACLE_SID环境变量,我这里属于这种情况。
[oracle@bak log]$ set ORACLE_SID=ora10g
[oracle@bak log]$ emca -repos recreate
STARTED EMCA at Oct 20, 2014 11:49:36 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: ora10g
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
Oct 20, 2014 11:49:59 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ora10g/emca_2014-10-20_11-49-36-AM.log.
Oct 20, 2014 11:50:01 AM oracle.sysman.emcp.EMReposConfig dropRepository --删除
INFO: Dropping the EM repository (this may take a while) ...
Oct 20, 2014 11:54:25 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Oct 20, 2014 11:54:25 AM oracle.sysman.emcp.EMReposConfig createRepository --创建
INFO: Creating the EM repository (this may take a while) ...
Oct 20, 2014 11:59:58 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Enterprise Manager configuration completed successfully
FINISHED EMCA at Oct 20, 2014 11:59:58 AM
可以看到3个successfully,重建后并把em配置也重新刷了一遍
[oracle@bak log]$ 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.
:1158/em/console/aboutApplication --重建EM资料库后,现在的主机名已经更正为“bak”了
Oracle Enterprise Manager 10g is not running.
再次重新启动EM
[oracle@bak log]$ emctl start 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.
:1158/em/console/aboutApplication
Agent Version : 10.1.0.4.1
OMS Version : Unknown
Protocol Version : 10.1.0.2.0
Agent Home : /u01/app/oracle/product/10.2.0/db_1/bak_ora10g
Agent binaries : /u01/app/oracle/product/10.2.0/db_1
Agent Process ID : 29136
Parent Process ID : 28566
Agent URL : :3938/emd/main --agent还是有原主机残留信息,没有更新,不过不影响登陆EM
Started at : 2014-10-20 11:05:11
Started by user : oracle
Last Reload : 2014-10-20 11:05:11
Last successful upload : (none)
Last attempted upload : (none)
Total Megabytes of XML files uploaded so far : 0.00
Number of XML files pending upload : 40
Size of XML files pending upload(MB) : 5.84
Available disk space on upload filesystem : 5.14%
Agent is already started. Will restart the agent
Stopping agent ... stopped.
Starting Oracle Enterprise Manager 10g Database Control ........ started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/bak_ora10g/sysman/log
[oracle@bak log]$ 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.
:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/bak_ora10g/sysman/log
[oracle@bak log]$
通过重建EM后,就可以用web浏览器登陆EM管理界面了,新的url为::1158/em
总结: