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.

uninstall01

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.

10 Responses to “How to Manually Remove the Enterprise Manager Grid/Cloud Control Agent”

  1. Vincent Ogbu says:

    Hi Atil:

    I have successfully installed Oracle Cloud Grid Control 12c (12.1.0.1.0) on a Target server. However, before I could get the SEs to run the root.sh 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.

    Vincent

    • Gokhan Atil says:

      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 says:

    Hi Atil:

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

    ./emcli delete_target -name=”oraprod02.thig.com:1836″ -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.

    Vincent.

    • Gokhan Atil says:

      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 says:

      Hi Atil:

      I suppose you mean this path:

      /u01/app/oracle/agent12c/core/12.1.0.1.0

      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.

      Vincent.

    • Gokhan Atil says:

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

  3. Vincent Ogbu says:

    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 : 10.3.1.10 ==> failed with the error pasted below:
    =========================================
    Execution of command /u01/app/oracle/agent12c/ADATMP_2013-05-07_15-52-42-PM/agentDeploy.sh -ignorePrereqs ORACLE_HOSTNAME=10.3.1.10 AGENT_BASE_DIR=/u01/app/oracle/agent12c OMS_HOST=sflgnvoms01.thig.com 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 10.3.1.10 Failed Error Message: Attach home of sbin home failed.

    Any suggestions or advise?

    Best regards.

    Vincent

    • Gokhan Atil says:

      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 says:

    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. erkan ülgey says:

    Teşekkürler Gökhan Bey.

     

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="">