A long title for a short trick. I have uninstalled my cloud control agent and tried to re-install it. I gave the same directory I previously used to install and EM Cloud Control Agent Deploy Wizard gave an error at remote prerequisite check:

So it says I should deploy to a different directory or uninstall the Agent Oracle Home already registered. Because of our deployment standards, I need to deploy this agent to the same directory so I searched how I can uninstall the Agent Oracle Home.

Agent Homes are stored in /etc/oragchomelist (Linux) and /var/opt/oracle/oragchomelist (Solaris). I removed the entry from oragchomelist and retry to deploy and I got the same error! Then I checked the Oracle Inventory file – its location can be found at /var/opt/oracle/oraInst.loc (Solaris), the inventory file (ContentsXML/inventory.xml) has some entries for the Agent Homes:

Because I have already a working Oracle Database at this server, I didn’t delete the oraInventory files, and I issued the following command to detach the Agent Home:

That’s it. I re-run the deployment agent and it completed without any error.

14 Responses to “How to Uninstall the Agent Oracle Home that Registered with Inventory”

  1. Hey Gokhan,

    I have the exact same problem, but a little bit different.

    I want to deploy a new agent in the same folder where there was a deployment failure. in the agent12c folder there is a folder starting with ADATMP…, which is a sign that there was a failure.

    So I tried to redeploy the agent in the same folder, but I got your error.

    The problem I have is that when I execute the command to detach the home from the inventory I get an error ‘detachhome’ failed.
    Here is the output of the script:


    $ORACLE_HOME/oui/bin/runInstaller -silent -detachHome ORACLE_HOME="/opt/oracle/agent12c/core/12.1.0.1.0"
    Starting Oracle Universal Installer...

    Checking swap space: must be greater than 500 MB. Actual 1027 MB Passed
    The inventory pointer is located at /etc/oraInst.loc
    The inventory is located at /opt/oracle/Middleware/oraInventory
    'DetachHome' failed.

    When I check the logs I have this:

    INFO: Setting variable 'CLUSTER_NODES' to ''. Received the value from a code block.
    INFO: This home /opt/oracle/agent12c/core/12.1.0.1.0 cannot be detached or deinstalled as it contains references to other homes
    INFO: Done calling doOperation.
    INFO: Ending the inventory Session
    INFO: Disposing the install area control objects
    INFO: 'DetachHome' failed.

    Any ideas?

    Thanks in advance,
    Bram

    • Gokhan Atil says:

      Bram, have you checked the inventory file (inventory.xml)? Do you see any references to your agent home (maybe some updates etc)?

    • I’m sorry for the spam. For some reason, the copy paste doesn’t work properly.

      I have the same entries in the inventory.xml file as you have.

  2. I had the same issue when trying to uninstall and redeploy the agent.

    I figured out that there is a backup copy of inventory.xml in /etc/oraInventory/backup folder.

    Grabbed the one which did not have any oem related entries and was able to deploy the agent successfully.

    Thanks for this post. Otherwise, I would not be able to resolve the issue with the agent re-install.

  3. Handy Sanjaya says:

    Great.

    I was looking for this solution for 2 weeks

  4. Radhika says:

    Hi,

    How do you deinstall the agent12c if you install the agent thru agent deployment wizard 12c ?

    In this case I don’t see $AGENT_HOME/oui/bin/runinstaller -deinstall on target side ?

    • Gokhan Atil says:

      Radhika, you can deinstall the agent using using Enterprise Manager console. Select the host in targets/hosts list, try to remove it. It will ask you to remove related targets first and it will show you the defined targets in the target server. Remove all of them and then you can remove the target (so your agent will be deinstalled).

  5. unfortunately i have deleted agent with “rm -rf” and now i am getting error when installing agent with EM console saying “old agent” is already registred this AGENT_HOME that i am trying to install agent..i did remove entry from /etc/oragchomelist . not able to to run “detachhome” option as i have removed entire agent software from server.

     

    Please let me know how can i fix this..

  6. Thank you, your article was helpfull. After a OMS crash I have to restore a snapshot of my VM. So Agent were already installed on my oracle node…

    In my case running this command doesn’t work:

    $ORACLE_HOME/oui/bin/runInstaller -silent -detachHome ORACLE_HOME=”/u01/agent12c/core/12.1.0.1.0″

    Because the oracle node already have plugins on it. So I use this command to remove dependencies and then uninstalling oms agent :

    $ORACLE_HOME/oui/bin/runInstaller -deinstall

    After that I have check that inventory  file was succesfully update:

    vi /u01/app/oraInventory/ContentsXML/inventory.xml

    Was good for me, I succesfully reinstall oms agent without that error after that.

  7. shanmugam says:

    I have completed the Oracle Enterprise Manager Cloud control 12C installation and deployment, now am looking for next step with best practice document.

    can you refrence any document for

    Oracle Enterprise Manager Cloud control 12C

    for mointoring/configuration the targets databases/asm/instance/hosts/application servers

    Please let me know.

    Shans

     

  8. Thanks Gokhan!  You’re the best…

  9. Just remove the 12c content from file “oraInventory/ContentsXML/inventory.xml”, then click “Retry” in the GUI, OK.

    • Gokhan Atil says:

      Although it may work, it’s not the “supported” way to fix the problem. As you can see at the first lines of the file, you shouldn’t modify the contents of the file by hand.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">