Thursday, May 17, 2018

Agent Installation on Windows Server. SQL Server (Failover Cluster) target addition in OEM 12c

Agent Installation on Windows Server. SQL Server (Failover Cluster) target addition in OEM 12c

This document is prepared for monitoring windows server where sql server installed.Mostly used OEM for monitoring databases. In this document we will cover agent installation with target addition into OEM 12c. We will also cover prerequisite like enabling port for communication from agent to oms server

Agent Installation on windows server 

  • As a part of installation, we require to fulfil prerequisite like connectivity between OEM server and Window server.
  • For Port opening and communication between two servers
  • Ports required to open : 4903 , 7799 , 3872
  • Following steps require doing for manually installation of Agent in Windows server.
    • Verifying if the agent exists on OMS.
  • To begin, open your Cloud Control and go to "Setup -> Extensibility -> Self Update". Open the "Agent Software" folder and check if the Agent Software of Windows x64 is with status "Applied", as in the image below:

    If the agent is not applied, you need to download it, deploy and then activate it.
    • Download the Agent installer
    With your agent activated, we will now download it from your OMS server. Access your OMS Server and download the package so we can later install it manually on Windows.
                First, log in with emcli:
                                  [oracle@~]$ emcli login -username=sysman
    Enter password:

    Login successful
    Let's check if the agent is really available (we have already done this check in step 1):
    [oracle@~]$ emcli get_supported_platforms
    Getting list of platforms...
    Check the logs at /opt/app/oracle/em12cR2/Middleware/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/agent.log
    About to access self-update code path to retrieve the platforms list..
    Getting Platforms list  ...
    Version =
     Platform = Linux x86-64
    Version =
     Platform = Linux x86-64
    Version =
     Platform = Oracle Solaris on SPARC (64-bit)
    Version =
     Platform = Oracle Solaris on x86-64 (64-bit)
    Version =
     Platform = Microsoft Windows x64 (64-bit)
    Version =
     Platform = HP-UX Itanium
    Platforms list displayed successfully.
    Great, let's download the installer to the local folder. This folder must be empty. Version onwards will generate two files, one for the agent and one for the plugin:
    [oracle@---~]$ emcli get_agentimage -destination=/home/oracle -platform="Microsoft Windows x64 (64-bit)" -version=""
    Platform:Microsoft Windows x64 (64-bit)
    === Partition Detail ===
    Space free : 13 GB
    Space required : 1 GB
    Check the logs at /opt/app/oracle/em12cR2/Middleware/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/get_agentimage_2013-11-08_16-04-37-PM.log
    Setting property ORACLE_HOME to:/opt/app/oracle/em12cR2/Middleware/oms
    calling pulloneoffs with arguments:/opt/app/oracle/em12cR2/Middleware/oms/opt/software/72/C1D0CDE7DD23F299E040DD0AEF3F63BD12.
    Check this logs for more information: /opt/app/oracle/em12cR2/Middleware/oms/sysman/prov/agentpush/logs
    [oracle@~]$ ls -la
    total 472424
    drwx------ 10 oracle oinstall 4096 Nov 8 16:04 .
    drwxr-xr-x 3 root root 4096 May 8 2012 ..
    -rw-r----- 1 oracle oinstall 243272366 Nov 8 16:04

    Finally, upload the generated "" (or any similar version) from your server to the client machine running Windows. In my case, I downloaded it to a temporary server via SFTP and then sent to the client using Remote Desktop.

    • Change the host file on your server

    Edit the file "C:\Windows\System32\drivers\etc\hosts" and add (or uncomment) lines, so that it stays similar to the following:
    #your host       localhost.local localhost

    #EMC 12C
    IP Address               FQDN FQDN 

    • Create an agent registration password
    Open your OEM Cloud Control, and access the "Setup -> Security -> Registration Passwords" menu:

    • Generate agent.rsp file

    Create a new "agent.rsp" file and set only some basic parameters for the installation:
    • Unpack and install the agent
     Unzip the downloaded zip file "" to some directory. Create a directory where the agent will be installed, in my case, I chosed "c:\emagent" (avoid spaces).
     PS: In version, you must leave the plugin file "" zipped in the same location where the file above was unzipped, next to the file "agentDeploy.bat". Check how it must stay:
    If this is not done during installation, you may receive the error:
    "The Management Agent configuration failed. The plug-in configuration for the oracle.sysman.oh monitoring plug-in may have failed, or this plug-in may not be present in the Management Agent software. Ensure that the Management Agent software has the oracle.sysman.oh monitoring plug-in, if not then retry the operation. If the agent software has the oracle.sysman.oh monitoring plug-in, view the plug-in deployment log E:\app\Administrator\agent12c\agent_inst\install\logs to check if the plug-in configuration for the oracle.sysman.oh monitoring plug-in failed."

    Now open a command prompt and run from the folder where you unzipped the file:
    Try to open command prompt with “Run as administrator”.
    - agentDeploy.bat AGENT_BASE_DIR=C:\emagent RESPONSE_FILE=C:\Users\Administrator\Desktop\agent\agent.rsp
    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

    C:\Users\Administrator>cd Desktop\agent\

    C:\Users\Administrator\Desktop\agent\>agentDeploy.bat AGENT_BASE_DIR=C:\emagent RESPONSE_FILE=C:\Users\Administrator\Desktop\agent\agent.rsp
    Present working directory:C:\Users\Administrator\Desktop\agent\
    Archive location:C:\Users\Administrator\Desktop\agent\
    Agent base directory:C:\emagent
    Agent base directory:C:\emagent
    OMS Host:
    Agent image loc : "C:\Users\Administrator\Desktop\agent\"
    C:\emagent configonlyfalse
    Reading the properties file: "C:\Users\Administrator\Desktop\agent\"\
            1 file(s) copied.
    This is the version
    This is the type core
    This is the aru id 233
    "Validating the OMS_HOST & EM_UPLOAD_PORT"
    "Executing command : C:\emagent\core\\jdk\bin\java -classpath C:\emagent\core\\jlib\agentInstaller.jar:C:\emagent\core\\oui\jlib\OraInstaller.jar oracle.sysman.agent.installer.AgentInstaller C:\emagent\core\ "C:\Users\Administrator\Desktop\agent\" C:\emagent -prereq"

    Validando o host e a porta de oms com o url: http://:4901/empbs/genwallet
    Validando o host e a porta de oms com o url: https://---:4901/empbs/genwallet
    Return status:3
    "Executing command : C:\emagent\core\\jdk\bin\java -classpath C:\emagent\core\\jlib\OraInstaller.jar:C:\emagent\core\\sysman\jlib\emInstaller.jar:C:\emagent\core\\jlib\xmlparserv2.jar:C:\emagent\core\\jlib\srvm.jar:C:\emagent\core\\jlib\emCfg.jar:C:\emagent\core\\sysman\jlib\agentInstaller.jar oracle.sysman.agent.installer.AgentInstaller C:\emagent\core\"

    Executando prÚ-requisitos de instalaþÒo do agente...
    Executando comando: C:\emagent\core\\oui\bin\setup.exe -ignoreSysPrereqs -prereqchecker -silent -ignoreSysPrereqs -waitForCompletion  -prereqlogloc C:\emagent\core\\cfgtoollogs\agentDeploy -entryPoint -detailedExitCodes PREREQ_CONFIG_LOCATION=C:\emagent\core\\prereqs  -J-DORACLE_HOSTNAME=
    Prereq Logs Location:C:\emagent\core\\cfgtoollogs\agentDeploy\prereq<timestamp>.log
    PrÚ-requisitos de instalaþÒo do agente concluÝdos com sucesso

    Clonando o home do agente...
    Executando comando: C:\emagent\core\\oui\bin\setup.exe -ignoreSysPrereqs -clone -forceClone -silent -waitForCompletion -nowait ORACLE_HOME=C:\emagent\core\ -responseFile C:\Users\Administrator\Desktop\agent\agent.rsp AGENT_BASE_DIR=C:/agent12c AGENT_BASE_DIR=C:/agent12c RESPONSE_FILE=C:\Users\Administrator\Desktop\agent\agent.rsp -noconfig  ORACLE_HOME_NAME=agent12c2 -force
    Clone Action Logs Location:C:\Program Files\Oracle\Inventory\logs\cloneActions<timestamp>.log
    Clonagem do home do agente concluÝda com sucesso

    Anexando home do sbin...
    Executando comando: C:\emagent\core\\oui\bin\setup.exe -ignoreSysPrereqs -attachHome -waitForCompletion -nowait ORACLE_HOME=C:\emagent\sbin ORACLE_HOME_NAME=sbin12c2 -force
    Attach Home Logs Location:C:\emagent\core\\cfgtoollogs\agentDeploy\AttachHome<timestamp>.log
    AnexaþÒo do home do sbin concluÝda com sucesso.

    Updating home dependencies...
    Executando comando: C:\emagent\core\\oui\bin\setup.exe -ignoreSysPrereqs -updateHomeDeps -waitForCompletion HOME_DEPENDENCY_LIST="C:\emagent\sbin:C:\emagent\core\" -invPtrLoc C:\emagent\core\\oraInst.loc -force
    Update Home Dependencies Location:C:\emagent\core\\cfgtoollogs\agentDeploy\UpdateHomeDeps<timestamp>.log
    AtualizaþÒo da dependÛncia do home concluÝda com sucesso.

    Executando a configuraþÒo do agente...
    Executando comando: C:\emagent\core\\oui\bin\runConfig.bat ORACLE_HOME=C:\emagent\core\ RESPONSE_FILE=C:\emagent\core\\agent.rsp ACTION=configure MODE=perform COMPONENT_XML={} RERUN=true
    Configuration Log Location:C:\emagent\core\\cfgtoollogs\cfgfw\CfmLogger<timestamp>.log
    Agent Configuration completed successfully
    Agent deployment log location:
    Agent deployment completed successfully.

    Great, your agent was installed and successfully deployed.

    NOTE: In version, an screen with Windows error may appear as below. If it appears, click "Close the Program" and ignore the message:
    Check logs if error occurred at time of installation.

    SQL server target addition into oem 12c

    • Discovering Targets
    From the Setup menu, select Add Target and then Add Targets Manually

    • In the Add Targets Manually page, select Add Targets Declaratively by Specifying Target Monitoring Properties, select Target Type as Microsoft SQL Server, select a Monitoring Agent and click Add Manually.
    • Before adding target verify agent status by emctl status agent on windows server.
    • Fill the target property.
  • Target Name: Unique target name across all Cloud Control targets, such as MSSQL_Hostname. This is the display name in Cloud Control. It represents this SQL Server target across all user interfaces within Cloud Control.
  • For E.g. MSSQL_
  • Monitoring Database Host Credentials
    • These properties keep blank as doesn’t for this configuration.
    • Monitoring Database Credentials
      • Database Username (Required for SQL Authentication): Valid user for the database in sysadmin fixed server role.
      • Username is ****
      • Database Password (Required for SQL Authentication): Corresponding password for the database user.
      • Password for ***_USER i
      • Confirm Database Password (Required for SQL Authentication): Confirm the password entered for the database user.
      • Database Role (Optional): Role assigned to the database user.
      • Confirm Database Role: Confirm database role entered for database user.
      • Properties
        • JDBC Driver: (Optional) Microsoft SQL Server 2005 JDBC driver class name.
For example,

  • JDBC URL: URL for JDBC. It is recommended that the host name provided in the JDBC URL should be a fully qualified domain name (FQDN). The default port number for Microsoft SQL Server is 1433. You can specify either IP Address or host name. If you are monitoring a Microsoft SQL Server Cluster, then specify the IP address or host name of the virtual SQL server of the cluster (Note: this is not the same as the IP address or host name of the Windows cluster). For example:
jdbc:sqlserver:// ****:1433
You do not need to include the port number if your instance is using the default of 1433.


  • There may be possibility of agent not properly configured. It requires complete de-installation with certain steps.
  • Use this document for complete de-installation
  • Don’t forget to do after deinstall steps with regedit entry removal.
  • At time of installation, if any error comes, it will be identified by logs.
  • C:\emagent\core\\cfgtoollogs\cfgfw\CfmLogger<timestamp>.log
  • Due to wrong agent password agent unable to secure agent.
  • Follow steps to manually secure agent. For Agent secure related logs available at sysman/config/log/secure.log

  •  Execute the command: cmd /c set NEED_EXIT_CODE=1&&C:\emagent\agent_inst\bin\emctl.bat secure agent  
  •  Start the agent by executing the command: C:\emagent\agent_inst\bin\emctl start agent
  •  Add the targets by executing the command: C:\emagent\agent_inst\bin\emctl config agent addinternaltargets