10g异机恢复后EM无法启动故障处理一例

之前在自己的測试环境上做了个异机恢复,原来的库上是配置过EM的,可是在恢复的库上去启动EM就报错了。以下看详细解决过程:

PS:原主机名为zlm,恢复出来的主机名为bak

[[email protected] ~]# su - oracle

[[email protected] ~]$ 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.

[[email protected] ~]$ cd /u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/

[[email protected] 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命令

[[email protected] j2ee]$ mv -r OC4J_DBConsole_zlm_ora10g/ OC4J_DBConsole_bak_ora10g/

[[email protected] 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

[[email protected] j2ee]$ emctl status dbconsole

TZ set to PRC

EM Configuration issue. /u01/app/oracle/product/10.2.0/db_1/bak_ora10g not found.

[[email protected] j2ee]$ cd /u01/app/oracle/product/10.2.0/db_1/

[[email protected] 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

[[email protected] db_1]$ mv zlm_ora10g bak_ora10g

[[email protected] 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.

http://zlm: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

[[email protected] 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.

http://zlm: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,分析一下提示的错误日志

[[email protected] j2ee]$ cd /u01/app/oracle/product/10.2.0/db_1/bak_ora10g/sysman/log

[[email protected] 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

[[email protected] log]$ cat emoms.log

2014-08-25 11:26:23,952 [Orion Launcher] WARN  jdbc.ConnectionCache _getConnection.303 - Got a fatal exeption when getting a connection; Error code = 17002; Cleaning up cache and retrying

2014-08-25 11:26:23,991 [Orion Launcher] WARN  jdbc.ConnectionCache _getConnection.306 - Io exception: The Network Adapter could not establish the connection

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254)

at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)

at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:493)

at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164)

at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)

at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:767)

at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:324)

at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:114)

at oracle.jdbc.pool.OracleConnectionCacheImpl.getNewPoolOrXAConnection(OracleConnectionCacheImpl.java:694)

at oracle.jdbc.pool.OracleConnectionCacheImpl.getPooledConnection(OracleConnectionCacheImpl.java:540)

at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java:346)

at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java:324)

at oracle.sysman.util.jdbc.ConnectionCache._getConnection(ConnectionCache.java:296)

at oracle.sysman.util.jdbc.ConnectionCache.getUnwrappedConnection(ConnectionCache.java:423)

at oracle.sysman.emSDK.svc.conn.FGAConnectionCache.getFGAConnection(FGAConnectionCache.java:156)

at oracle.sysman.emSDK.svc.conn.ConnectionService.getPrivateConnection(ConnectionService.java:605)

at oracle.sysman.emSDK.svc.conn.ConnectionService.getRepositoryVersionAndMode(ConnectionService.java:368)

at oracle.sysman.emSDK.svc.conn.ConnectionService.verifyRepositoryEx(ConnectionService.java:395)

at oracle.sysman.emSDK.svc.conn.ConnectionService.verifyRepository(ConnectionService.java:450)

at oracle.sysman.eml.app.ContextInitializer.contextInitialized(ContextInitializer.java:174)

at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:807)

at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:533)

at com.evermind.server.Application.getHttpApplication(Application.java:886)

at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:688)

at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:570)

at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:263)

at com.evermind.server.http.HttpServer.setSites(HttpServer.java:259)

at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:160)

at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2330)

at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1503)

at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:93)

at java.lang.Thread.run(Thread.java:534)

2014-08-25 11:26:23,999 [Orion Launcher] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = Io exception: The Network Adapter could not establish the connection

2014-08-25 11:26:26,673 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ias.ias.IASIntegration

2014-08-25 11:26:27,386 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.eml.target.slb.common.SLBIntegration

2014-08-25 11:26:27,676 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.eml.ssl.intg.SSLIntegration

2014-08-25 11:26:27,915 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.tip.oem.central.domain.ProcessConnectDomainIntg

2014-08-25 11:26:27,918 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.tip.oem.central.instance.ProcessConnectInstanceIntg

2014-08-25 11:26:27,932 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.webdb.admin.em.PortalIntegration

2014-08-25 11:26:27,934 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.webdb.admin.em.SSOIntegration

2014-08-25 11:26:27,937 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.reports.em.RepIntg

2014-08-25 11:26:27,940 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ocs.mntr.target.OcsEmailIntegration

2014-08-25 11:26:27,945 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ocs.mntr.target.OcsOidIntegration

2014-08-25 11:26:27,948 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ocs.mntr.target.OcsOvfIntegration

2014-08-25 11:26:27,970 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ocs.mntr.target.OcsWebconfIntegration

2014-08-25 11:26:27,975 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ocs.mntr.target.OcsWirelessIntg

2014-08-25 11:26:27,978 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ocs.mntr.target.OcsCalGrpIntegration

刷屏了。中间省略同样错误一堆,按Ctrl+C才终止的

2014-08-25 11:29:24,713 [HttpRequestHandler-23603795] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = Io exception: The Network Adapt

怀疑是否是由于监听没起来的缘故,先启动监听

[[email protected] log]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 20-OCT-2014 11:15:26

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

TNS-12541: TNS:no listener

TNS-12560: TNS:protocol adapter error

TNS-00511: No listener

Linux Error: 111: Connection refused

[[email protected] log]$ lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 20-OCT-2014 11:15:29

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production

Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bak)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production

Start Date                20-OCT-2014 11:15:29

Uptime                    0 days 0 hr. 0 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bak)(PORT=1521)))

The listener supports no services

The command completed successfully

[[email protected] log]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 20-OCT-2014 11:16:17

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production

Start Date                20-OCT-2014 11:15:29

Uptime                    0 days 0 hr. 0 min. 48 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bak)(PORT=1521)))

Services Summary...

Service "ora10g" has 1 instance(s).

Instance "ora10g", status READY, has 1 handler(s) for this service...

Service "ora10gXDB" has 1 instance(s).

Instance "ora10g", status READY, has 1 handler(s) for this service...

Service "ora10g_XPT" has 1 instance(s).

Instance "ora10g", status READY, has 1 handler(s) for this service...

The command completed successfully

[orac[email protected] 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.

http://zlm: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

显然,EM启动不了不是监听的问题。那么又一次配置一下EM是否会有效呢?

[[email protected] log]$ emca -config dbcontrol db

STARTED EMCA at Oct 20, 2014 11:22:43 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

Database Control is already configured for the database ora10g

You have chosen to configure Database Control for managing the database ora10g

This will remove the existing configuration and the default settings and perform a fresh configuration

Do you wish to continue? [yes(Y)/no(N)]: y

Listener port number: 1521

Password for SYS user:

Password for DBSNMP user:

Password for SYSMAN user:

Password for SYSMAN user: oEmail address for notifications (optional):

Invalid email.

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 ................ bak

Listener port number ................ 1521

Database SID ................ ora10g

Email address for notifications ...............

Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------

Do you wish to continue? [yes(Y)/no(N)]: y

Oct 20, 2014 11:24:36 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-22-43-AM.log.

Oct 20, 2014 11:24:49 AM oracle.sysman.emcp.util.DBControlUtil stopOMS

INFO: Stopping Database Control (this may take a while) ...

Oct 20, 2014 11:25:53 AM oracle.sysman.emcp.ParamsManager getLocalListener

WARNING: Error retrieving listener for bak

Oct 20, 2014 11:26:15 AM oracle.sysman.emcp.EMConfig perform

SEVERE: Cannot start Database Control. The following ports are already in use: [EM agent port:3938].

Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ora10g/emca_2014-10-20_11-22-43-AM.log for more details.

Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ora10g/emca_2014-10-20_11-22-43-AM.log for more details.

[[email protected] log]$ cat /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ora10g/emca_2014-10-20_11-22-43-AM.log

发现也是一堆报错,当中有一段是这种,显示地主机命名还是之前旧的信息(原来的主机名为zlm,如今的为bak):

CONFIG: emdProps: /u01/app/oracle/product/10.2.0/db_1/bak_ora10g/sysman/config/emd.properties url: http://zlm:1158/em

Oct 20, 2014 11:24:49 AM oracle.sysman.emcp.EMDBPreConfig isDBControlSecure

CONFIG:  isDbcSecure: false

Oct 20, 2014 11:24:49 AM oracle.sysman.emcp.ParamsManager setFlag

CONFIG: Flag ‘IS_DBCONSOLE_SECURED‘ set to false

Oct 20, 2014 11:24:49 AM oracle.sysman.emcp.util.DBControlUtil stopOMS

INFO: Stopping Database Control (this may take a while) ...

Oct 20, 2014 11:24:49 AM oracle.sysman.emcp.util.PlatformInterface getSortedEnvArray

CONFIG: New Env List: [DISPLAY=, NEED_EXIT_CODE=1, ORACLE_SID=ora10g, PATH=/usr/sbin:/u01/app/oracle/product/10.2.0/db_1/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/mysql/bin:/usr/local/mysql/bin:/home/oracle/bin,
TZ=]

Oct 20, 2014 11:24:49 AM oracle.sysman.emcp.util.PlatformInterface executeCommand

CONFIG: Starting execution: /u01/app/oracle/product/10.2.0/db_1/bin/emctl stop dbconsole

Oct 20, 2014 11:25:43 AM oracle.sysman.emcp.util.PlatformInterface executeCommand

CONFIG: Exit value of 0

Oct 20, 2014 11:25:43 AM oracle.sysman.emcp.util.PlatformInterface executeCommand

CONFIG: Execution of /u01/app/oracle/product/10.2.0/db_1/bin/emctl stop dbconsole  completed successfully

Oct 20, 2014 11:25:43 AM oracle.sysman.emcp.util.PlatformInterface executeCommand

CONFIG: 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://zlm:1158/em/console/aboutApplication

Stopping Oracle Enterprise Manager 10g Database Control ...

...  Stopped.

看来只又一次配置一下EM资料库是不行的,须要重建一下(先删除,后创建)

[[email protected] log]$ emca -repos recreate

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Error occurred during initialization of VM

java.lang.Error: Properties init: Could not determine current working directory.

该错误表示 getcwd 命令无法定位到当前工作文件夹。一般来说是由于 cd 到了某个文件夹之后又rm
了这个文件夹

这时去运行某些命令就会报 getcwd 错误?,仅仅须要 cd 到不论什么一个实际存在的文件夹下在运行命令就可以。

出现这样的现象的原因还有,当前用户没有当前文件夹的可运行权限。如没有正确设置ORACLE_SID环境变量。我这里属于这样的情况。

[[email protected] log]$ set ORACLE_SID=ora10g

[[email protected] 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配置也又一次刷了一遍

[[email protected] 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.

http://bak:1158/em/console/aboutApplication    --重建EM资料库后。如今的主机名已经更正为“bak”了

Oracle Enterprise Manager 10g is not running.

再次又一次启动EM

[[email protected] 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.

http://bak: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         : http://zlm: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

[[email protected] 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.

http://bak: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

[[email protected] log]$

通过重建EM后,就能够用web浏览器登陆EM管理界面了,新的url为:http://bak:1158/em

总结:

遇到各种原因造成的EM无法登陆的问题,一般是由于旧的EM资料库配置有问题,或者是由于改变了主机或IP地址所造成,能够使用emca -repos recreate重建,就能直接解决这个问题,只通过emca -config dbconsole db来又一次配置是不够彻底的,由于还会有之前错误信息的残留,除了这几个命令外,emca还有非常多其它參数。能够通过emca --help查看,这里就不列举了。

时间: 2024-10-24 01:38:40

10g异机恢复后EM无法启动故障处理一例的相关文章

Oracle 单实例 迁移到 RAC 实例 -- 使用RMAN 异机恢复

Oracle 官网有关单实例迁移到RAC的一个步骤说明: How to Convert 10g Single-Instance database to 10g RAC using Manual Conversion procedure [ID 747457.1] http://blog.csdn.net/tianlesoftware/archive/2010/12/09/6065903.aspx   RMAN 备份异机恢复 并创建新DBID http://blog.csdn.net/tianle

RMAN异机恢复步骤及故障处理

一.测试机安装OS+Oracle Software,包括配置oracle用户组和环境变量(略) 二.开始异机恢复 1. 复制源库最新备份集.初始化参数.密码文件到测试机 [[email protected] backupsets]$ scp *20141012* 192.168.1.213:/tmp The authenticity of host '192.168.1.213 (192.168.1.213)' can't be established. RSA key fingerprint

Linux平台下RMAN异机恢复总结

下面总结.整理一下RMAN异机恢复这方面的知识点,这篇笔记在个人笔记里面躺了几年了,直到最近偶然被翻看到,遂整理.总结一下.如下所示,个人将整个RMAN异机恢复分为准备工作和操作步骤两大部分.当然,准备工作里面,有些步骤不是必须的,可以跳过或忽略的.这个取决于你的实际环境和你对RMAN异机恢复的熟悉程度. 准备工作 1:了解一下目标服务器与源服务器的操作系统版本信息 需要对比一下目标服务器与源服务器的操作系统版本是否一致,具体来说,操作系统版本信息.内核信息(例如Oracle Linux是否使用

Networker 8.1异机恢复Oracle 11gR2

本文是一篇迟来的博文,写这篇博文源于近日在整理技术笔记时,看到2年前写的EMC Networker 8.1异机恢复Oracle 11gR2数据库的操作笔记(测试的是假如生产数据库服务器崩溃宕机,而将备份数据恢复到备用数据库服务器).虽然去年EMC就已推出了Networker 9,但本文可能多少还有一点参考价值,便稍加整理后发了出来. 一.测试环境 计算机名 IP地址 操作系统 角色 安装软件 Bakserver 10.1.1.4 RedHat 6 备份服务器 EMC Networker 8.1.

Oracle异机恢复

RMAN异机恢复注意事项:1.RMAN 异机恢复的时候,db_name必须相同. 如果说要想改成其他的实例名,可以在恢复成功后,用nid 命令修改. 实例名的信息会记录到控制文件里,所以如果在恢复的时候,如果实例名不一致,恢复的时候会报错.2.如果恢复的路径和源库不一致,就需要在restore时用set 命令指定新位置. 并且使用switch datafile all将信息更新的到控制文件.在做duplicate的时候,RMAN 会自动根据pfile中的log_file_name_convert

Oracle 11G RMAN 单实例异机恢复

数据备份当然是为数据恢复准备,新环境的oracle一直在进行备份,但都没有测试验证备份的有效性,所以本次测试的重要性不言而喻了!以下为WIN平台下RMAN异机恢复实例. 源库 目标库 操作系统 WIN SVR 2008 R2 WIN SVR 2008 R2 主机名 Ora ORATEST IP 192.168.18.20 192.168.18.25 数据库版本 11.2.0.1.0 11.2.0.1.0 存储方式 单实例 单实例 ORACLE_HOME D:\app\Administrator\

oracle rman异机恢复

  Oracle源主机 Oracle目标主机 主机平台 CentOS6.2(final) CentOs6.2(FInal) 主机名 vick rman IP地址 192.168.1.11 192.168.1.10 实例名字 orcl orcl Oracle版本 11.2.0.4 11.2.0.4 Oracle数据文件存储 filesystem filesystem 控制文件路径 /u01/app/oracle/oradata /u01/app/oracle/oradata 数据文件路径 /u01

Oracle 11g 异机恢复参考文档

  原库 目标库 操作系统 CentOS 6.4 CentOS 6.4 主机名 sht-sgmhadoopnn-01 sht-sgmhadoopnn-02 IP 172.16.101.55 172.16.101.56 数据库版本 11.2.0.4.0 11.2.0.4.0 $ORACLE_BASE /u01/app/oracle /u01/app/oracle $ORACLE_HOME /u01/app/oracle/product/11.2.0/db_1 /u01/app/oracle/pro

RMAN异机恢复实验---转载

一.RMAN异机恢复实验 2011年3月23日00:44 1.环境介绍: 主机1: 操作系统 REDHAT5.5 IP地址 172.16.1.120 主机名 sigle 数据库版本 10.2.0.4 数据库名 orcl DBID 1305151947 catalog win_yjr catalog用户 sigle/sigle 主机2: 操作系统 REDHAT5.5 IP地址 172.16.1.121 主机名 clone_sigle 数据库版本 10.2.0.4     2.本次恢复实验目的: 主