Home Administration Steps to remove OEM Agent

Steps to remove OEM Agent

Recently I migrated all targets (Cluster, Databases, Instances, ASM, etc) and their jobs to a 13c OEM system. I had to clean up the targets from 12c OMS and remove the OEM agent. Here are the steps to properly delete/remove a monitored host and its targets from OEM (Oracle Enterprise Manager). The steps were done on a 12c (12.1.0.5) OEM environment and the AgentDeinstall.pl script is used to remove the OEM agent.

Stop EM Agent

Stop the agent on the host that is being removed. The agent MUST be marked UNREACHABLE in the Enterprise Manager Cloud Control to perform the delete_target operation.

# Set the ORACLE_HOME variable to AGENT home
> . oraenv
ORACLE_SID = [oracle] ? AGENT
The Oracle base remains unchanged with value /u01/app/oracle



> emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.5.0
OMS Version            : 12.1.0.5.0
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/app/oracle/agent/12.1.0.5/agent_inst
Agent Log Directory    : /u01/app/oracle/agent/12.1.0.5/agent_inst/sysman/log
Agent Binaries         : /u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0
Agent Process ID       : 20252
Parent Process ID      : 4671
Agent URL              : https://mydbhost01.domain.com:3872/emd/main/
Local Agent URL in NAT : https://mydbhost01.domain.com:3872/emd/main/
Repository URL         : https://oemconsole.domain.com:1159/empbs/upload
Started at             : 2020-03-07 09:28:09
Started by user        : oracle
Operating System       : Linux version 2.6.32-754.3.5.el6.x86_64 (amd64)
Last Reload            : (none)
Last successful upload                       : 2020-07-14 20:24:29
Last attempted upload                        : 2020-07-14 20:24:29
Total Megabytes of XML files uploaded so far : 331.57
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 60.67%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2020-07-14 20:26:04
Last successful heartbeat to OMS             : 2020-07-14 20:26:04
Next scheduled heartbeat to OMS              : 2020-07-14 20:27:04

---------------------------------------------------------------
Agent is Running and Ready



# Stop the EM Agent
> emctl stop agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Stopping agent ..... stopped.

Delete monitored targets

From the OMS host, delete all the targets that are being monitored by this agent.

> . oraenv
ORACLE_SID = [oracle] ? OMS
The Oracle base has been set to /u01/app/oracle

> emcli login -username=sysman
> emcli delete_target -name="mydbhost01.domain.com:3872" -type="oracle_emd" -delete_monitored_targets

Target "mydbhost01.domain.com:3872:oracle_emd" deleted successfully

De-install the EM Agent

From the host that is being removed, deinstall the agent using the AgentDeinstall.pl script. This is the recommended method to remove an agent. The alternative method is to use the graphical mode calling the runInstaller utility from EM Agent home.

# Syntax
$<AGENT_HOME>/perl/bin/perl <AGENT_HOME>/sysman/install/AgentDeinstall.pl -agentHome <AGENT_HOME>


# Deinstall log
> /u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0/perl/bin/perl /u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0/sysman/install/AgentDeinstall.pl -agentHome /u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0


 Agent Oracle Home: /u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0

agentHome = /u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0

NOTE: The agent base directory: /u01/app/oracle/agent/12.1.0.5 will be removed after successful deinstallation of agent home.


 DetachHome Command executed:/u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0/oui/bin/runInstaller -detachHome -force -depHomesOnly -silent ORACLE_HOME=/u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0 -waitForCompletion -invPtrLoc /u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0/oraInst.loc
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 10614 MB    Passed
The inventory pointer is located at /u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0/oraInst.loc
'DetachHome' was successful.
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 10614 MB    Passed
The inventory pointer is located at /u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0/oraInst.loc
The Oracle home '/u01/app/oracle/agent/12.1.0.5/sbin' could not be updated as it does not exist.


Deinstall Command executed:/u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0/oui/bin/runInstaller -deinstall -silent "REMOVE_HOMES={/u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0}" -waitForCompletion -removeAllFiles -invPtrLoc /u01/app/oracle/agent/12.1.0.5/core/12.1.0.5.0/oraInst.loc
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 10614 MB    Passed
Oracle Universal Installer, Version 11.1.0.13.0 Production
Copyright (C) 1999, 2015, Oracle. All rights reserved.

Starting deinstall


Deinstall in progress (Tuesday, July 14, 2020 8:45:33 PM GMT)
Configuration assistant "Agent Deinstall Assistant" succeeded
............................................................... 100% Done.

Deinstall successful

End of install phases.(Tuesday, July 14, 2020 8:45:39 PM GMT)
End of deinstallations
Please check '/u01/app/oraInventory/logs/silentInstall2020-07-14_08-45-30PM.log' for more details.

Delete Agent Base directory

Post deinstall, you need to manually delete the Agent Base directory.

> cd /u01/app/oracle/agent
> rm -rf 12.1.0.5

Optionally, remove the entry from /etc/oratab.

Reference

Enterprise Manager Cloud Control Advanced Installation and Configuration Guide

LEAVE A REPLY

Please enter your comment!
Please enter your name here

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

Latest posts

Steps to remove OEM Agent

Recently I migrated all targets (Cluster, Databases, Instances, ASM, etc) and their jobs to a 13c OEM...

DBCA fails with ORA-27125 on 19c

Issue I recently encountered an issue where DBCA failed with ORA-27125 when creating a...

How to rename a PDB in 19c

Let's look at how to rename a PDB in 19c. The steps are the same as 12c....

How to change the ethernet switch password on Exadata

Let's look at how to log in and change the ethernet switch (adm) password on an Exadata...

You might also likeRELATED
Recommended to you