EM 12C: The Agent Fails to Start on Windows Platforms with the Error "The service name is invalid" and "More help is available by typing NET HELPMSG 2185" (Doc ID 2089129.1)

Last updated on DECEMBER 21, 2015

Applies to:

Enterprise Manager Base Platform - Version 12.1.0.1.0 and later
Generic Windows

Symptoms

On Windows Platforms, the Enterprise Manager  (EM) Agent fails to start:

 

The same error occurs running the command "emctl stop agent".

Starting or stopping the EM Agent from the Control Panel Services application completes successfully.

The environment variables are correctly set (ORACLE_HOME, ORACLE_HOME/bin in PATH)

ORACLE_HOME=C:\app\oracle\product\emagent\core\12.1.0.4.0
Path=C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;
        C:\app\oracle\product\emagent\core\12.1.0.4.0\bin;C:\app\oracle\product\emagent\core\12.1.0.4.0\OPatch

The Windows Registry is correct and matches the information in the file C:\Program Files\Oracle\Inventory\ContentsXML\inventory.xml

Example of entry in the file C:\Program Files\Oracle\Inventory\ContentsXML\inventory.xml

<HOME NAME="agent12c1" LOC="C:\app\oracle\product\emagent\core\12.1.0.4.0" TYPE="O" IDX="15">

Example of matching entries in the Windows Registry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Oracleagent12c1Agent
=> DisplayName=Oracleagent12c1Agent
=> ImagePath=C:\app\oracle\product\emagent\core\12.1.0.4.0\bin\nmesrvc.exe

HKEY_LOCAL_MACHINE\SOFTWARE\oracle\KEY_agent12c1
=> ORACLE_HOME=C:\app\oracle\product\emagent\core\12.1.0.4.0
=> HOME_NAME=agent12c1

HKEY_LOCAL_MACHINE\SOFTWARE\oracle\SYSMAN\Oracleagent12c1Agent
=> EMDROOT=C:\app\oracle\product\emagent\core\12.1.0.4.0
=> ORACLE_HOME=C:\app\oracle\product\emagent\core\12.1.0.4.0

In the EM Agent %INSTANCE_HOME%\sysman\log directory, (Example C:\app\oracle\product\emagent\agent_inst\sysman\log), the following two files are not created.

Oracleagent12c1Agentexit.log (For Agent Stop)
Oracleagent12c1Agentsrvc.log (For agent Start)

The following old files are present in the directory %INSTANCE_HOME%\sysman\log

Oracleagent12c2Agentexit.log (For Agent Stop)
Oracleagent12c2Agentsrvc.log (For agent Start)

 

There are no relevant error messages logged in the log files from the directory %INSTANCE_HOME%\sysman\log.

If you open the file emctl.bat from the directory %ORACLE_HOME%\bin (Example: C:\app\oracle\product\emagent\core\12.1.0.4.0\bin),
then search for the string AGENT_SERVICE_NAME, you will find:

REM
REM If start should use non service methods, set AGENT_SERVICE_NAME to
REM "NOSERVICE"
REM
if not defined AGENT_SERVICE_NAME (set AGENT_SERVICE_NAME=Oracleagent12c2Agent)
set SAC_SERVICE_NAME=
if not defined DBCONSOLE_SERVICE_NAME (set DBCONSOLE_SERVICE_NAME=OracleDBConsole%ORACLE_SID%)

The EM Agent Service name is wrong and does not match the Windows Registry entries.

The EM Agent Service Name is Oracleagent12c2Agent instead of Oracleagent12c1Agent.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms