Wednesday, August 28, 2013

Oracle - Cannot Start DBConsole Windows Service on Windows 7

This Article is Applicable to Windows 7 (possibly Vista but not tested)

There are situations when you just cannot start the Oracle DB Console Windows service. The error written on the Event Viewer is Error Return (-2).

I have summarized in chronological order, the methods to solve this:

Step 1: Check the Windows Host File

Cause: Oracle, on Windows 7 has problems deciphering the links between the IP address and the host name.

The host file is located at {Windows Home Directory}\system32\drivers\etc.

Add the following entries to the file hosts:

127.0.0.1 localhost
{host ip address} {hostname}<.domain>

Specify the domain if the computer is part of a network domain, else can leave blank. Sometimes adding these entries solve the problem, else continue to step 2.

Step 2: Check the System Environment Variables

Ensure the following environments are configured:

ORACLE_HOSTNAME={hostname}
ORACLE_BASE={Oracle base, the Oracle version number folder just below product}
ORALCE_HOME={Oracle home, the folder just above the BIN folder}
ORACLE_SID={SID name}
ORACLE_UNQNAME={SID name}

Continue to Step 3 if this does not resolve.

Step 3: Check the Time Zone Region

Under the folder, %ORACLE_HOME%\{hostname}_{SID}\sysman\config\emd.properties

Look out the entry, agentTZRegion, and ensure it is set to the correct time zone (DO NOT edit the file directly):
agentTZRegion=Asia/Singapore

If you are not sure on the values for your region, check it out in the file:
%ORACLE_HOME%\sysman\admin\supportedtzs.lst

Use the following console commands to change the value:

%ORACLE_HOME%\BIN\emctl stop dbconsole

%ORACLE_HOME%\BIN\emctl resetTZ agent

Login to SQLPLUS with sysman/{password}, then run:

SQL> exec mgmt_target.set_agent_tzrgn('{host name}:3938','Asia/Singapore')

Value of first parameter is EMD_URL from emd.properties file.

Then, restart dbconsole:

%ORACLE_HOME%\BIN\emctl start dbconsole

If this still does not resolve, proceed to Step 3.

Step 3: Check Error Logs for Password Expiry or Locked for sysman and dbsnmp users

Check the following log files for the said errors:

%ORACLE_HOME%\{hostname}_{SID}\sysman\logs

agabend.txt, emagent.trc, OracledbConsolesfluxdbsrvc.txt


Alternatively, run sqlplus and login using user name, sysman and then dbsnmp. Ensure the passwords are not expired or not locked, else reactivate the passwords.

Continue to Step 4 if this does not solve the problem.

Step 4: Check Error Logs - emctl upload agent failed

Check the log files as in Step 3 and watch out for errors mentioned below. If there is such error, you need to clear the Enterprise manager agent that fails to upload.

Generally, there are two types of errors:

Error when executing emctl upload agent

EMD upload error: uploadXMLFiles skipped :: OMS version not checked yet..

Error when executing emctl start dbconsole

Starting agent …………………………… started but not ready.

Follow the steps below to resolve:

(1) Stop the agent

%ORACLE_HOME%\bin\emctl stop dbconsole

This is so that you can clear the old logs and uploads

(2) Remove old log and upload files

rm -r %ORACLE_HOME%\sysman\emd\collection\*
rm -r %ORACLE_HOME%\sysman\emd\state\*
rm -r %ORACLE_HOME%\sysman\emd\upload\*
rm %ORACLE_HOME%\sysman\emd\lastupld.xml
rm %ORACLE_HOME%\sysman\emd\agntstmp.txt
rm %ORACLE_HOME%\sysman\emd\protocol.ini

Remove the "blackout" file also if any in sysman\emd folder

(3) Start the agent

%ORACLE_HOME%\bin\emctl start dbconsole

(4) Issue an agent clearstate from the agent home

%ORACLE_HOME%\bin\emctl clearstate agent

(5) Force an upload to the OMS

%ORACLE_HOME%\bin\emctl upload agent

(6) Re-secure the agent

%ORACLE_HOME%\bin\emctl secure dbconsole

Enter the sysman password when prompted for password. You will be prompted for another password. You are not required to enter the password again. Just wait for it to finish.

Step 5: Certificate Security Key

High specification OS has greater security checking. If the Oracle installation is fine, dbconsole started without errors but https://{host name or host ip}:1158/em complaints that the page cannot be displayed on the Internet Explorer, most likely it is the certificate verification problem.

Windows 64 bit uses 1024 bit certificate key, whereas Oracle certificate uses 512 bit. Therefore, in order to solve this, type the following command on the command prompt:

c:\> certutil -setreg chain\minRSAPubKeyBitLength 512

Then, restart IE and access: http://{host name or host ip}:1158/em

If all of these cannot resolve your problem, recheck the log files.

DISCLAIMER:
The author of this blog is not responsible for any of your data losses as a result of following the instructions of this blog. You use all information at your own risks.

No comments:

Post a Comment