How to Manually Remove the Enterprise Manager Grid/Cloud Control Agent

One of my friend told me that they used to have Oracle Enterprise Manager Grid Control 10g and deployed its agents to some database servers but now they removed Grid Control and want to use Oracle Enterprise Manager Database Console. Usually people ask the opposite question 🙂

Anyway, in this blog post, I’ll describe how to manually remove Enterprise Manager Grid/Cloud Control Agent and then enable Enterprise Manager Database Control on the target system. First we need to stop the agent:

If your Cloud Control is up, we need to remove agent. Login as oracle user and run the following commands:

If you have Grid Control 10g/11g, then login to the repository database as SYSMAN and execute the following:

Now we’re ready to uninstall the agent software. Run the installer:

Click “deinstall products..” button to see Inventory (installed Oracle products on the server). For Grid Control Agents, all you need is to select agent home and click “Remove”. For Cloud Control Agents, you need to first select and remove plug-in homes (OraHome1..5), then select and remove sbin12cX home, and lastly select and remove agent home.


After we uninstall the agent, we’re ready to reconfigure Enterprise Manager Database Control. All you need is to run the following command. It will ask us to enter some information such as the Database SID, listener port number, passwords of SYS, DBSNMP and SYSMAN users:

After a few minutes, you’ll see that Database Control is up.

Please share

AWS Big Data Specialist. Oracle Certified Professional (OCP) for EBS R12, Oracle 10g and 11g. Co-author of "Expert Oracle Enterprise Manager 12c" book published by Apress. Awarded as Oracle ACE (in 2011) and Oracle ACE Director (in 2016) for the continuous contributions to the Oracle users community. Founding member, and vice president of Turkish Oracle User Group (TROUG). Presented at various international conferences including Oracle Open World.


  1. Vincent Ogbu

    Hi Atil:

    I have successfully installed Oracle Cloud Grid Control 12c ( on a Target server. However, before I could get the SEs to run the scripts as root for me on the server, the system timed out on me. I decided to re-install the agent again.
    This is where my problem started. It looks like I made made the situation worst by doing this.

    I was advised to de-install the agent from the Target server.
    Your document is the best document I have found so far to help me resolve this issue. My questions are:

    The steps and commands in listed in document are they executed on the Target server or on the OMS server?
    Please could you identified for me which of the proceedure on the document are executed on the Target server and which one are executed on the OMS serevr.
    Thanks for your usual cooperation.

    Best regards.


    • Gokhan Atil

      Hi Vincent,

      First command (emctl stop agent) should run on target server if your agent is up.

      EMCLI commands should run on OMS server. You do not need to run “mgmt_admin.cleanup_agent” because you have EM12c.

      The last command (runInstaller) should run on target server to deinstall the agent. If you can’t deinstall your agent with runInstaller (because your deployment is broken), you may delete the directory of the agent and re-deploy the agent to another directory.

  2. Vincent Ogbu

    Hi Atil:

    I ran the below listed command and got this error message (Error: Target does not exist)

    ./emcli delete_target -name=”″ -type=”oracle_emd” -delete_monitored_targets

    Is there anything that is missing in the command line?

    Any advise on how to proceed from this point?

    Best regards.


    • Gokhan Atil

      Vincent, so the agent is not registered on OMS. All you need is to remove agent software from the target server and re-deploy the agent.

    • Vincent Ogbu

      Hi Atil:

      I suppose you mean this path:


      when you say “remove agent software from the target server”. In other word you want me to delete “agent12c” directory I created before the deployment of the agent on the target server?

      Thanks for your usual cooperation.


    • Gokhan Atil

      Yes just delete the agent12c directory, and re-deploy the agent.

  3. Vincent Ogbu

    Hi Atil:

    Thanks for your response.

    I rerun the process again after deleting and recreating the agent12c directory per your instruction.

    Initialization Details ==> succeeded

    Remote Prerequisite Check Details ==> succeeded

    Agent Deployment Details : ==> failed with the error pasted below:
    Execution of command /u01/app/oracle/agent12c/ADATMP_2013-05-07_15-52-42-PM/ -ignorePrereqs ORACLE_HOSTNAME= AGENT_BASE_DIR=/u01/app/oracle/agent12c EM_UPLOAD_PORT=4901 AGENT_INSTANCE_HOME=/u01/app/oracle/agent12c/agent_inst b_doDiscovery=false b_startAgent=false b_forceInstCheck=true AGENT_PORT=1830 2>/u01/app/oracle/agent12c/ADATMP_2013-05-07_15-52-42-PM/logs/install.err 1>/u01/app/oracle/agent12c/ADATMP_2013-05-07_15-52-42-PM/logs/install.log on host Failed Error Message: Attach home of sbin home failed.

    Any suggestions or advise?

    Best regards.


    • Gokhan Atil

      Why do you use -ignorePrereqs? You shouldn’t ignore the prerequisites, you should try to fix them before you deploy the agent.

  4. Shahzad Malik

    How do i go about in removing in 12c database, i’m running into

    emca -deconfig dbcontrol db -repos drop

    -bash: emca: command not found

    Seems like there is no emca in the $ORACLE_HOME/bin directory


  5. Burak CINAR


    how can i remove the target system if target host offline and removed ? i cant make it online again , it was test vm.


    oracle@OEMC:/u01/app/middleware/oms/bin> ./emcli delete_target -name=”hostname:3872¨ -type=”oracle_emd” -delete_monitored_targets

    Error: Target does not exist

    I’ve checked with ./emcli get_targets command and it says Agent Unreachab



    • Gokhan Atil

      Burak, you probably enter the name wrong. Write tha name of the target as it’s seen in the output of emcli get_targets.

  6. Thanks alot, good article.

    here little share about remove agent on client

    login as oracle

    cd /

    export DISPLAY=p.q.r.s:0.0

    /u01/app/Oracle/core/ stop agent


  7. shariq


    I am facing following issue  during  database discovery on 12c oem:

    javax.el.ELException: java.lang.NullPointerException

  8. Abhi

    Hi, I have installed oracle enterprise manager 13c, however after installing i messed up with SYSMAN password. I directly changed it. Now i tried all possible method but my admin server or oms server as a whole is not coming up. What is the best option? Do i need to uninstall OEM and reinstall again?

Leave Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.