Enterprise Manager

Easy EM12c Agent Deployment on Windows

One of the greatest advancements in EM12c from previous Enterprise Manager versions is the auto-deployment.  I have a number of clients with Windows environments and upon another recent search on Google, I found that there was a consistent and solid recommendation of installing Cygwin, (or another shell emulator installation) to utilize the auto-deploy.  There is a large amount of work that is required to perform the pre-requisites to then take advantage of the auto-deploy, so I’m thrilled when I see someone recommend using the silent installation with Windows installation.  I’m aware that I, along with others, have created posts that demonstrate silent deployments, but not JUST for Windows, so here it is!

The Software Library

A silent deploy demands a software library for a download the agent zip file to.  This must be pre-configured beforehand.

To configure the software library, log into the EM12c environment and go to the software library:

em12c_sw_lib

 

In the Software Library administration section, click on ADD.

Enter a name and location for the software library, ensure you’ve already created the folder names in Windows to ensure success.

sw_lib

 

Click on OK

You will see the software library in the list:

sw_lib_2

 

You will now use this directory to download the agent deployment zip files to.

Download the Agent Deployment Files

Deployment is done by the Enterprise Manager Command Line Interface, (EMCLI).   The emcli is ready with EM12c, release 2, but you need to set the environment up to support the emcli.  The JAVA_HOME must be set before your Windows emcli will work correctly.  Either set it in the environment variables or set it at the command line.  It must be java 1.6 or greater to work with emcli.

set JAVA_HOME=C:\Progra~2\Java\jre7

Log into the EMCLI as SYSMAN or user with agent deployment privs:

E:\app\oracle\em12c\oms\BIN>emcli login -username=sysman
Enter password :
Login successful

Syncronize the EMCLI so that it is up to date with the repository:

E:\app\oracle\em12c\oms\BIN>emcli sync
Synchronized successfully

Query the repository to get what agents are in the repository:

E:\app\oracle\em12c\oms\BIN>emcli get_supported_platforms
Getting list of platforms ...
Check the logs at E:\app\oracle\em12c\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 = 12.1.0.2.0
 Platform = Microsoft Windows x64 (64-bit)
-----------------------------------------------
Platforms list displayed successfully.

 

Deploy the Agent 

OK, time to download it to the software drive.  The syntax asks for the destination, which we list, along with the exact name of the platform of the agent that we want and the version:

 

emcli get_agentimage -destination=E:/sw_lib/12.2 –platform="Microsoft Windows x64 (64-bit)" –version=12.1.0.2.0
Platform:Microsoft Windows x64 (64-bit)
Destination:e:\swlib
 === Partition Detail ===
Space free : 20 GB
Space required : 1 GB
Check the logs at E:\app\oracle\em12c\gc_inst\em\EMGC_OMS1\sysman\emcli\setup/.emcli/get_agentimage_2013-10-24_12-55-31-PM.log

A zip file now resides in the download folder:

deploy_file

 

Copy this file over to the target server that you wish to deploy the EM12c agent to and unzip the file:

You will see a list of files, (depending on version of EM12c, output may vary some…) but there are two files you are mainly interested in:

agentDeploy.bat     Batch file to deploy the agent.

agent.rsp                     Agent response file that requires configuration.

The agent.rsp requires the following changes made:

OMS_HOST=OMS_ORCL.com #OMS Host Server name
EM_UPLOAD_PORT=4800 #Upload port for OMS
AGENT_REGISTRATION_PASSWORD=pssword #You can add a new one in security if you don't already have.
AGENT_INSTANCE_HOME=E:\app\agent12c #Installation directory on new target
AGENT_PORT=3872 #Agent port
b_startAgent=true
ORACLE_HOSTNAME=TRGT_ORCL.com #Name of target host
s_agentHomeName=TRGT_ORCL #Name of the target in EM12c

Save the changes and execute the batch file to deploy the agent:

agentDeploy.bat AGENT_BASE_DIR=E:\app RESPONSE_FILE=E:\app\12.1.0.2.0_AgentCore\agent.rsp
E:\12.1.0.2.0_AgentCore_233>agentDeploy.bat AGENT_BASE_DIR=E:\app RESPONSE_FILE=E:\12.1.0.2.0_AgentCore_233\agent.rsp
E:\12.1.0.2.0_AgentCore_233
Present working directory:E:\12.1.0.2.0_AgentCore_233
Archive location:E:\12.1.0.2.0_AgentCore_233 directory
AGENT_BASE_DIR
AGENT_BASE_DIR
E:\app
Agent base directory:E:\app
E:\app
RESPONSE_FILE
E:\12.1.0.2.0_AgentCore_233\agent.rsp
Agent base directory:E:\app
OMS Host:
Agent image loc : "E:\12.1.0.2.0_AgentCore_233"
E:\app configonlyfalse
Reading the properties file: "E:\12.1.0.2.0_AgentCore_233"\agentimage.properties
 1 file(s) copied.
This is the version 12.1.0.2.0
This is the type core
This is the aru id 233
"Validating the OMS_HOST & EM_UPLOAD_PORT"
"E:\app\core\12.1.0.2.0"
"Executing command : E:\app\core\12.1.0.2.0\jdk\bin\java -classpath E:\app\core\12.1.0.2.0\jlib\agentInstaller.jar:E:\app\core\12.1.0.2.0\oui\jlib\OraInstaller.jar oracle.sysman.agent.installer.AgentInstaller E:\app\core\12.1.0.2.0 "E:\12.1.0.2.0_AgentCore
Validating oms host & port with url: http://OMS_ORCL.com:4800/empbs/genwallet
Validating oms host & port with url: https://OMS_ORCL.com:4800/empbs/genwallet
Return status:3
"E:\12.1.0.2.0_AgentCore_233"\12.1.0.2.0_PluginsOneoffs_233.zip
"Executing command : E:\app\core\12.1.0.2.0\jdk\bin\java -classpath E:\app\core\12.1.0.2.0\jlib\OraInstaller.jar:E:\app\core\12.1.0.2.0\sysman\jlib\emInstaller.jar:E:\app\core\12.1.0.2.0\jlib\xmlparserv2.jar:E:\app\core\12.1.0.2.0\jlib\srvm.jar:E:\app\core
Executing agent install prereqs...
Executing command: E:\app\core\12.1.0.2.0\oui\bin\setup.exe -ignoreSysPrereqs -prereqchecker -silent -ignoreSysPrereqs -waitForCompletion -prereqlogloc E:\app\core\12.1.0.2.0\cfgtoollogs\agentDeploy -entryPoint oracle.sysman.top.agent_Complete -detailedEx
Prereq Logs Location:E:\app\core\12.1.0.2.0\cfgtoollogs\agentDeploy\prereq<timestamp>.log
Agent install prereqs completed successfully
Cloning the agent home...
Executing command: E:\app\core\12.1.0.2.0\oui\bin\setup.exe -ignoreSysPrereqs -clone -forceClone -silent -waitForCompletion -nowait ORACLE_HOME=E:\app\core\12.1.0.2.0 -responseFile E:\12.1.0.2.0_AgentCore_233\agent.rsp AGENT_BASE_DIR=E:/app AGENT_BASE_DIR
Clone Action Logs Location:C:\Program Files\Oracle\Inventory\logs\cloneActions<timestamp>.log
Cloning of agent home completed successfully
Attaching sbin home...
Executing command: E:\app\core\12.1.0.2.0\oui\bin\setup.exe -ignoreSysPrereqs -attachHome -waitForCompletion -nowait ORACLE_HOME=E:\app\sbin ORACLE_HOME_NAME=sbin12c1 -force
Attach Home Logs Location:E:\app\core\12.1.0.2.0\cfgtoollogs\agentDeploy\AttachHome<timestamp>.log
Attach home for sbin home completed successfully.
Updating home dependencies...
Executing command: E:\app\core\12.1.0.2.0\oui\bin\setup.exe -ignoreSysPrereqs -updateHomeDeps -waitForCompletion HOME_DEPENDENCY_LIST={E:\app\sbin:E:\app\core\12.1.0.2.0,} -invPtrLoc E:\app\core\12.1.0.2.0\oraInst.loc -force
Update Home Dependencies Location:E:\app\core\12.1.0.2.0\cfgtoollogs\agentDeploy\UpdateHomeDeps<timestamp>.log
Update home dependency completed successfully.
Performing the agent configuration...
Executing command: E:\app\core\12.1.0.2.0\oui\bin\runConfig.bat ORACLE_HOME=E:\app\core\12.1.0.2.0 RESPONSE_FILE=E:\app\core\12.1.0.2.0\agent.rsp ACTION=configure MODE=perform COMPONENT_XML={oracle.sysman.top.agent.11_1_0_1_0.xml} RERUN=true
Configuration Log Location:E:\app\core\12.1.0.2.0\cfgtoollogs\cfgfw\CfmLogger<timestamp>.log
Agent Configuration completed successfully
Agent deployment log location:
E:\app\core\12.1.0.2.0\cfgtoollogs\agentDeploy\agentDeploy_2013-10-24_13-26-41-PM.log
Agent deployment completed successfully.
E:\12.1.0.2.0_AgentCore_233>E:\12.1.0.2.0_AgentCore_233

A couple times, you will see the Oracle Installer come up and you may see an error with an opportunity to close the program or repair.  Choose to not close and let it continue, it’s an issue as the Installer attempts to login in without direct admin privileges, but it does recover.

You have now deployed the agent successfully and you can now log back into your EM12c and see the target host you just deployed.  If you have auto-discovery, the secondary targets will be discovered and configuration completed or you can manually discover targets from this point.

hosts_em12c

This is all there is to deploying in Windows and not one Cygwin installation in sight! 🙂

 

Kellyn

http://about.me/dbakevlar

30 thoughts on “Easy EM12c Agent Deployment on Windows

  • David

    Last time I used pull method to deployment a 12c agent onto windows host. But it looks like still some bugs in the deployment scripts.

    http://docs.oracle.com/cd/E24628_01/install.121/e24089/install_agent_usng_rsp.htm#BABBFAAD

    1. download the bat script from https://oms_server/em/install/getAgentImage?script=bat

    2. install the curl from http://curl.haxx.se/dlwiz/?type=bin&os=Win64&flav=MinGW64
    download it and unzip. and move it to c:\curl

    3.change the curl path in the agentpull.bat to correct one

    4.verify the pull scripts
    -showPlatforms

    5. wirte a repository file
    LOGIN_USER=sysman
    LOGIN_PASSWORD=xxxxx
    PLATFORM=”Microsoft Windows x64 (64-bit)”
    VERSION=12.1.0.2.0
    AGENT_REGISTRATION_PASSWORD=xxxxxxx

    6. using this command to pull the agent
    must put AGENT_REGISTRATION_PASSWORD here

    AgentPull.bat RSPFILE_LOC=C:\stage\agent.rsp AGENT_REGISTRATION_PASSWORD=xxxxxx AGENT_BASE_DIR=C:\oracle\agent

  • Due to the bugs you mention here, this is why I’ve documented the earlier “push” process. It’s easy once you set it up once, then you only need to copy the file over to the new target server and proceed to make a few small response file changes and deploy.
    Thanks,
    Kellyn

  • Hi Kellyn,

    I’ve given your EM12c example a shot, thanks for the post !

    In your example .rsp file you state port EM_UPLOAD_PORT=4800 (Target side), but how do I determine which port# I should use ? Port 4800 seems to be non-responsive on the OMS server.

    On the OMS Server I checked the C:\orabase\gc_inst\em\EMGC_OMS1\emgc.properties file, which contains a number of port assignments. I see no transparency here when it comes to ponting out the correct EM_UPLOAD_PORT in the .rsp file.

    Maybe I’m barking up the wrong tree ?? I get the following error:
    D:\orabase\swlib>agentDeploy.bat AGENT_BASE_DIR=D:\orabase\agentbase RESPONSE_FI
    LE=D:\orabase\swlib\agent.miracle.rsp
    D:\orabase\swlib
    Present working directory:D:\orabase\swlib
    Archive location:D:\orabase\swlib directory
    AGENT_BASE_DIR
    AGENT_BASE_DIR
    D:\orabase\agentbase
    Agent base directory:D:\orabase\agentbase
    D:\orabase\agentbase
    RESPONSE_FILE
    D:\orabase\swlib\agent.miracle.rsp
    Agent base directory:D:\orabase\agentbase
    OMS Host:
    Agent image loc : “D:\orabase\swlib”
    D:\orabase\agentbase configonlyfalse
    Reading the properties file: “D:\orabase\swlib”\agentimage.properties
    1 file(s) copied.
    This is the version 12.1.0.3.0
    This is the type core
    This is the aru id 233
    “Validating the OMS_HOST & EM_UPLOAD_PORT”
    “D:\orabase\agentbase\core\12.1.0.3.0”
    “Executing command : D:\orabase\agentbase\core\12.1.0.3.0\jdk\bin\java -classpat
    h D:\orabase\agentbase\core\12.1.0.3.0\jlib\agentInstaller.jar:D:\orabase\agentb
    ase\core\12.1.0.3.0\oui\jlib\OraInstaller.jar oracle.sysman.agent.installer.Agen
    tInstaller D:\orabase\agentbase\core\12.1.0.3.0 “D:\orabase\swlib” D:\orabase\ag
    entbase -prereq”
    The image file D:\orabase\agentbase\core\12.1.0.3.0\jdk\bin\java.exe is valid, b
    ut is for a machine type other than the current machine.
    “Validating OMS_HOST & EM_UPLOAD_PORT failed.”

    My .rsp file looks like this:
    EM_INSTALL_TYPE=”AGENT”
    OMS_HOST=xxxxxxxxx016.xxx.xxx#OMS Host Server name
    EM_UPLOAD_PORT=4800 #Upload port for OMS
    AGENT_REGISTRATION_PASSWORD=yyyyyyyyy #You can add a new one in security if you don’t already have.
    AGENT_INSTANCE_HOME=D:\orabase\agentbase #Installation directory on new target
    AGENT_PORT=3872 #Agent port
    b_startAgent=true
    ORACLE_HOSTNAME=xxxxxxxx223.xxx.xxx#Name of target host
    s_agentHomeName=xxxxxxxx223 #Name of the target in EM12c
    BR
    Joe

  • Hi Joe,
    I should have added this information to the post. Log onto your OMS server and execute the following from the command line:
    emctl status oms -details

    This will produce all the information for you, including the http/https upload port that you are looking for!
    Good luck and let me know if you run into any other issues.
    Kellyn

  • thanks for this post ,
    I have a question on deploying agent on windows failover cluster as after i deploy the agent on the two cluster nodes i followed document 464191.1 for deploy the agent on virtual host, but the problem i faild to install the plugin on the virtual host and this documention doesn’t help me in this issue.
    thanks again.

  • You do need to install the plugin for the virtual host and follow the instructions in the doc 464191.1. It has a section that covers the 12.1 release vs. just the 10g/11g version.

  • Pingback: ASH Analytics- Activity Focused on SQL Data, Part I - Oracle - Oracle - Toad World

  • aj203355

    Thank you very much for your posting. It was very helpful. I was able to successfully deploy a OEM 12c agent to a Windows Server 2008 R2 server and I’m able to confirm the status of the 12c agent [emctl.bat status agent]. The final remaining problem that I have is that the host is not showing up in the “managed hosts” in OEM. I even tried to setup the discovery to discover the Windows Server 2008 R2 host running the 12c agent and still does not show up in the “hosts” section of the OEM web application. Is there something that I’m missing?

  • Glad to hear this helped you deploy the agent. I would recommend trying the following:
    1. Try to ping the agent host from the OMS server- Can it resolve the agent host?
    If it can’t, have the network admin check the firewall for rules that are stopping the OMS from communicating with the agent.
    2. From the target host command line, try:
    emctl status agent
    and
    emctl pingOMS

    These both should resolve without any issues regarding connectivity to the OMS server, etc.

    Hope this helps, either way, I’m seeing a firewall issue stopping communication between the OMS and the target.
    Thanks,
    Kellyn

  • Perfect document, installed agent following it, thanks a ton.

  • It’s going to be end of mine day, except before end I am reading this great article to improve my
    know-how.

  • This a very helpful article. God bless you.

  • How do you deinstall the host agent in windows deployed with the push method? There is no AgentDeinstall.pl script( as per Oracle docs)

  • You can simply remove each of the child targets from the EM12c and then remove the host from the EM console. In Windows, you then delete the service, (sc delete ) and then delete the folders. No, there isn’t a script to uninstall.. 🙂

  • Karthik

    Hi

    Can you please let me know if I can follow the documentation Doc ID 464191.1 related to the installation of the OEM Agent 12c (12.1.0.3.0) on SQL server 2005 cluster database (windows 2003R2 OS 64-bit). I have successfully installed the OEM 12c agent on other non-cluster Windows servers using the curl package. I am not receiving any proper response from Oracle

    Thank you
    KR

  • Hi KR,
    I wish I could tell you these directions work, but they won’t and I’m working hard to get this fixed for another customer. Could you tell me a little about your environment? Are you attempting to install the agent locally to the hosts or at the shared storage level and using the VIP’s via a service in the cluster management?
    Thanks,
    Kellyn

  • Kellyn,

    Most importantly thank you for all of the work that you do with OEM. The DBA Kevlar site is always accurate and it is really helpful.

    Have you done any work with the OEM 12c R3 agent on Windows? This article discusses OEM 12c R2. When I tried following these instructions, I succeeded in installing the agent on Windows, but so far, the agent still throws errors when I attempt to bring it online and make it communicate with the OMS.

    Thanks,

    R3

  • Hi

    I installed the OEM Agent on one of our Windows server using the curl package. I would like to uninstall the agent. Can you please tell me the instructions how to uninstall the agent

  • Have you on just the base install for R3? Without the PSU patches for both the OMS/OMR and the agent, you will experience failures in the silent install for Windows agents with the push method. Once you apply those, you should have success. If not, let me know the exact error in the installation log for the agent on the target host.
    Thanks,
    Kellyn

  • Thank you very much….. and one more quick question from my side … I am receiving these alerts
    Metrics “Database Time Spent Waiting (%)” is at 76.417 for event class “Commit”
    Metrics “Database Time Spent Waiting (%)” is at 76.417 for event class “Network”
    “Others” etc. I tried to disable them from the template but still they have appeared and also I tried to change the critical to 100% and Warning to 99% from the database using a PL/SQL script and still it hasn’t worked (I still got “Database time spent waiting (%) is at 44.76 for event class”) . Finally I disabled them from the database and it worked like a Charm. Can you please let me know if there is any PL/SQL script that I need to execute from the database so that I receive the alerts only at 99% and 100%

    Thank you

    GKR

  • I’m not surprised that this is your most popular post of 2014! I must confess I am totally puzzled as to why almost everyone thinks Cygwin, psexec or some other remote installer / Unix emulator is absolutely required, and goes to such lengths to try to use them. As far as I can see, Cygwin etc. would only be needed in an environment where the DBA doesn’t have access to the Windows Oracle database server at OS level, and therefore has to jump through such hoops. Do you have any ideas about this?

    Thanks for busting the myth and showing us the way!

  • DBAkevlar

    Thank you, Penny! 🙂

  • To be fair, people get that idea because the Oracle installation documentation says to use one of those (cygwin or psexec) as two methods for installing on Windows hosts, and provide step by step instructions for doing so. The documentation also lists the ‘Add Hosts Target Wizard’ as the first preferred method for doing mass deployments, which requires Cygwin in order to work on Windows hosts.

    http://docs.oracle.com/cd/E24628_01/install.121/e22624/install_agent.htm#CACJEFJI

    We used Cygwin on our Windows hosts until Heartbleed, then removed all Cygwin installs and have been doing it the way this post suggests ever since – so thank you for the insight presented here.

    It would be most welcome if the ‘Add Host Target Wizard’ worked out of the box for Windows hosts without the need for 3rd party libraries or utilities.

    Shops that run Windows expect a setup/install .exe, double click, bring up an installer, enter credentials/path, click install, done – the way it was in OEM 10.

  • DBAkevlar

    Windows is a “lost” OS in the support world and I’ll continue working to get the best support for all OS platforms and hope for better. For those of us that supported Windows, along with other platforms, you recognize that there are different requirements and if you work with those, then you have success.

  • Thanks for the reply – that (“lost”) seems like an apt description – those of us who have to support Oracle on Windows appreciate the effort. We can’t convert everyone to *nix based hosts, so we do what we can.

  • robin Upcott

    Yes this is the way I’ve been doing this as well. I run the install as administrator.
    I secure my agent – or try to as the install shows agent configuration failed status=1 – so I did a emctl secure agent which did the trick. Not sure why this happens though

  • when i generate the script to deploy agent in AIX, the zip 12.1.0.4.0_PluginsOneoffs_212.zip is not good :s

    E:GRID12omsBIN>emcli get_agentimage -destination=C:Agent_GRIDAIX -platform=”IBM AIX on POWER Systems (64-bit)” -ver
    sion=12.1.0.4.0
    === Partition Detail ===
    Space free : 13 GB
    Space required : 1 GB
    Check the logs at E:gc_instemEMGC_OMS1sysmanemclisetup/.emcli/get_agentimage_2015-09-02_09-31-34-AM.log
    Downloading C:Agent_GRIDAIX12.1.0.4.0_AgentCore_212.zip
    File saved as C:Agent_GRIDAIX12.1.0.4.0_AgentCore_212.zip
    Downloading C:Agent_GRIDAIX12.1.0.4.0_PluginsOneoffs_212.zip
    File saved as C:Agent_GRIDAIX12.1.0.4.0_PluginsOneoffs_212.zip
    Downloading C:Agent_GRIDAIXunzip
    File saved as C:Agent_GRIDAIXunzip
    ERROR: Command C:Agent_GRIDAIXunzip C:Agent_GRIDAIX12.1.0.4.0_AgentCore_212.zip agentcoreimage.zip -d C:Agent_GRI
    DAIX execution failed.
    RECOMMENDATION: If your agent image platform and the emcli client setup is on a different platform then you need to set
    the environment variable ZIP_LOC to absolute path to the zip utility which is greater than or equal to version 3.0.
    Example: setenv ZIP_LOC /usr/local/bin/zip

    the zip file contains no plugins its contains some directory and files like
    ‘autodeploy,bin,config,startWebLogic.sh ….) and the size of the zip is 888130ko

    when i deploy and install the agent in the AIX servers i can’t discovry the target like DB… it’s normal because the plugins does not exist

    How can i correct this in the OMS server to when i generate the agent image the zip pluginsOneoffs are correct ?

    can you help me PLZ

  • Pingback: Installing EM13c on Windows Tips – DBA Kevlar

  • Pingback: Oracle – Install OEM Cloud Control 12c on Windows 7 x64 PC – Based on data

Comments are closed.