Wednesday, June 19, 2013

Failed to shutdown DBConsole Gracefully

Environment:
Oracle:
Oracle 10g Release 2  10.2.0.5
OS:
Linux
Summary:
Fix Oracle EM problem:Failed to shutdown DBConsole Gracefully
Today on a Linux Oracle machine without Oracle Enterprise Manger, I would like to install Oracle EM.
Use command
emca -config dbcontrol db -repos create
It reports an error
- An instance of Oracle Enterprise Manager 10g Database Control is already running.
It is strange that I have never create or start an EM process.
So I try to stop the existing EM process
SQL> emctl stop dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0
Copyright (c) 1996, 2006 Oracle Corporation.  All rights reserved.
http://oracletest:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control …
— Failed to shutdown DBConsole Gracefully —
failed.
It fails, and also fails when I want to start EM
SQL> emctl start dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0
Copyright (c) 1996, 2006 Oracle Corporation.  All rights reserved.
http://oracletest:1158/em/console/aboutApplication
– An instance of Oracle Enterprise Manager 10g Database Control is already running.
A metalink doc tells us, it may happens when /etc/hosts file does not have following rows
127.0.0.1    localhost.localdomain  localhost
The  metalink doc also tells us to check file emctl.pid
Under $ORACLE_HOME/$HOST_$ORACLE_SID, for example in my host under /oracle/app/oracle/product/10.2.0/oracletest_mes
/oracle/app/oracle/product/10.2.0/oracletest_mes> cat emctl.pid
36599
Use ps –ef to check 36599 process, it is really not a oracle EM dbconsole process,so that’s why emctl stop dbconsole can not stop its instance.
Delete emctl.pid, emctl stop dbconsole succeed.
But when recreate dbconsole, it fails again and show error that the port 3938 has been used.
Check $ORACLE_HOME/install/portlist.ini
Enterprise Manager Console HTTP Port (mes) = 1158
Enterprise Manager Agent Port (mes) = 3938
It tells us EM agent use 3938 port, that means EM has 2 processes, one is for dbconsole, and one is for emagent. So you know how to do next, kill emagent process and recreate dbconsole. And this time, everything is OK.

No comments :

Post a Comment