遇到各种原因造成的em无法登陆的问题,通常是因为旧的em资料库配置有问题,或者是因为改变了主机或ip地址所造成,可以使用emca -
之前在自己的测试环境上做了个异机恢复,原来的库上是配置过em的,但是在恢复的库上去启动em就报错了,下面看具体解决过程:
ps:原主机名为zlm,恢复出来的主机名为bak
[root@bak ~]# su - oracle
[oracle@bak ~]$ emctl status dbconsole
tz set to prc
oc4j configuration issue. /u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/oc4j_dbconsole_bak_ora10g not found.
[oracle@bak ~]$ cd /u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/
[oracle@bak j2ee]$ ll
total 24
-rw-r--r-- 1 oracle oinstall 256 aug 22 16:42 deploy_db.ini
drwxr-x--- 15 oracle oinstall 4096 aug 22 16:29 home
drwxr-x--- 9 oracle oinstall 4096 aug 22 16:24 isqlplus
drwxr-x--- 3 oracle oinstall 4096 aug 22 16:24 oc4j_applications
drwxr-x--- 5 oracle oinstall 4096 aug 22 16:24 oc4j_dbconsole
drwxr-x--- 7 oracle oinstall 4096 aug 25 11:25 oc4j_dbconsole_zlm_ora10g
既然提示文件找不到,很显然是因为主机名变更的缘故,那么把名字变一下,用mv命令
[oracle@bak j2ee]$ mv -r oc4j_dbconsole_zlm_ora10g/ oc4j_dbconsole_bak_ora10g/
[oracle@bak j2ee]$ ll
total 24
-rw-r--r-- 1 oracle oinstall 256 aug 22 16:42 deploy_db.ini
drwxr-x--- 15 oracle oinstall 4096 aug 22 16:29 home
drwxr-x--- 9 oracle oinstall 4096 aug 22 16:24 isqlplus
drwxr-x--- 3 oracle oinstall 4096 aug 22 16:24 oc4j_applications
drwxr-x--- 5 oracle oinstall 4096 aug 22 16:24 oc4j_dbconsole
drwxr-x--- 7 oracle oinstall 4096 oct 20 10:58 oc4j_dbconsole_bak_ora10g
[oracle@bak j2ee]$ emctl status dbconsole
tz set to prc
em configuration issue. /u01/app/oracle/product/10.2.0/db_1/bak_ora10g not found.
[oracle@bak j2ee]$ cd /u01/app/oracle/product/10.2.0/db_1/
[oracle@bak db_1]$ ll
total 260
drwxr-x--- 7 oracle oinstall 4096 aug 22 16:24 assistants
drwxr-xr-x 2 oracle oinstall 12288 aug 22 16:42 bin
drwxr-x--- 3 oracle oinstall 4096 aug 22 16:33 cdata
drwxr-x--- 6 oracle oinstall 4096 aug 25 11:08 cfgtoollogs
drwxr-x--- 4 oracle oinstall 4096 aug 22 16:24 clone
drwxr-x--- 2 oracle oinstall 4096 aug 22 16:33 config
drwxr-x--- 6 oracle oinstall 4096 aug 22 16:24 crs
drwxr-x--- 7 oracle oinstall 4096 aug 22 16:33 css
drwxr-x--- 10 oracle oinstall 4096 aug 22 16:33 ctx
drwxr-x--- 2 oracle oinstall 4096 oct 20 09:17 dbs
drwxr-x--- 3 oracle oinstall 4096 aug 22 16:24 demo
drwxr-x--- 3 oracle oinstall 4096 aug 22 16:24 diagnostics
drwxr-x--- 3 oracle oinstall 4096 aug 22 16:24 has
drwxr-x--- 6 oracle oinstall 4096 aug 22 16:42 hs
drwxr-x--- 5 oracle oinstall 4096 aug 25 11:27 install
-rw-r----- 1 oracle oinstall 37 aug 22 16:24 install.platform
drwxr-x--- 12 oracle oinstall 4096 aug 22 16:42 inventory
drwxr-x--- 7 oracle oinstall 4096 aug 22 16:24 javavm
drwxr-x--- 4 oracle oinstall 4096 aug 22 16:31 jdbc
drwxr-x--- 7 oracle oinstall 4096 aug 22 16:32 jdk
drwxr-x--- 2 oracle oinstall 4096 aug 22 16:32 jlib
drwxr-x--- 3 oracle oinstall 4096 aug 22 16:24 jre
drwxr-x--- 13 oracle oinstall 4096 aug 22 16:33 ldap
drwxr-x--- 3 oracle oinstall 12288 aug 22 16:42 lib
drwxr-x--t 3 oracle oinstall 4096 aug 25 11:24 log
drwxr-x--- 6 oracle oinstall 4096 aug 22 16:24 md
drwxr-x--- 2 oracle oinstall 4096 aug 22 16:25 mesg
drwxr-x--- 7 oracle oinstall 4096 aug 22 16:32 mgw
drwxr-x--- 11 oracle oinstall 4096 aug 22 16:42 network
drwxr-x--- 6 oracle oinstall 4096 aug 22 16:24 nls
drwxr-x--- 15 oracle oinstall 4096 aug 22 16:42 oc4j
drwxr-x--- 6 oracle oinstall 4096 aug 22 16:24 odbc
drwxr-x--- 5 oracle oinstall 4096 aug 22 16:24 olap
drwxr-x--- 4 oracle oinstall 4096 aug 22 16:32 opatch
drwxr-x--- 7 oracle oinstall 4096 aug 22 16:32 opmn
drwxr-x--- 4 oracle oinstall 4096 aug 22 16:24 oracore
-rw-r--r-- 1 oracle oinstall 63 aug 22 16:22 orainst.loc
drwxr-x--- 8 oracle oinstall 4096 aug 22 16:24 ord
drwxr-x--- 7 oracle oinstall 4096 aug 22 16:32 oui
drwxr-x--- 4 oracle oinstall 4096 aug 22 16:24 owm
drwxr-x--- 6 oracle oinstall 4096 aug 22 16:24 perl
drwxr-x--- 7 oracle oinstall 4096 aug 22 16:25 plsql
drwxr-x--- 7 oracle oinstall 4096 aug 22 16:24 precomp
drwxr-x--- 7 oracle oinstall 4096 aug 22 16:33 racg
drwxr-x--- 13 oracle oinstall 4096 aug 22 16:42 rdbms
drwxr-x--- 4 oracle oinstall 4096 aug 22 16:31 relnotes
-rwxr-xr-x 1 oracle oinstall 9522 aug 22 16:42 root.sh
-rwxr-xr-x 1 oracle oinstall 0 jun 7 2005 root.sh.old
drwxr-x--- 3 oracle oinstall 4096 aug 22 16:24 slax
drwxr-x--- 3 oracle oinstall 4096 aug 22 16:24 sqlj
-rw-r----- 1 oracle oinstall 9338 aug 25 11:42 sqlnet.log
drwxr-x--- 9 oracle oinstall 4096 aug 22 16:33 sqlplus
drwxr-x--- 12 oracle oinstall 4096 aug 22 16:33 srvm
drwxr-x--- 12 oracle oinstall 4096 aug 22 16:33 sysman
drwxr-x--- 4 oracle oinstall 4096 aug 22 16:24 uix
drwxr-x--- 3 oracle oinstall 4096 aug 22 16:24 wwg
drwxr-x--- 6 oracle oinstall 4096 aug 22 16:30 xdk
drwxr----- 3 oracle oinstall 4096 aug 25 11:25 zlm_ora10g
这次是找不到zlm_ora10g目录,同样的,也mv为bak_ora10g
[oracle@bak db_1]$ mv zlm_ora10g bak_ora10g
[oracle@bak db_1]$ 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 not running.
------------------------------------------------------------------
logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/bak_ora10g/sysman/log
[oracle@bak j2ee]$ 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
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
无法启动,看到url里的信息是原主机zlm,分析一下提示的错误日志
[oracle@bak j2ee]$ cd /u01/app/oracle/product/10.2.0/db_1/bak_ora10g/sysman/log
[oracle@bak log]$ ll
total 1656
-rw-r----- 1 oracle oinstall 180 aug 25 11:28 emagentfetchlet.log
-rw-r----- 1 oracle oinstall 180 aug 25 11:28 emagentfetchlet.trc
-rw-r----- 1 oracle oinstall 500 oct 20 11:06 emagent.log
-rw-r----- 1 oracle oinstall 42010 oct 20 11:14 emagent.trc
-rw-r----- 1 oracle oinstall 9816 oct 20 11:05 emdb.nohup
-rw-r----- 1 oracle oinstall 4096 oct 20 11:05 emdb.nohup.lr
-rw-r----- 1 oracle oinstall 0 aug 25 11:25 emdctl.log
-rw-r----- 1 oracle oinstall 7330 oct 20 11:14 emdctl.trc
-rw-r----- 1 oracle oinstall 802261 aug 25 11:45 emoms.log
-rw-r----- 1 oracle oinstall 802261 aug 25 11:45 emoms.trc
[oracle@bak log]$ cat emoms.log