28 Decommissioning and Deinstalling Oracle Management Agents

This chapter describes how to decommission and deinstall standalone Oracle Management Agents (Management Agent). In particular, this chapter covers the following:

Decommissioning Oracle Management Agents

This section describes the various ways of decommissioning Oracle Management Agents. In particular, this section covers using the Agent Decommission feature from the Enterprise Manager Cloud Control console user interface and from command line using emcli commands. They both allow to decommission a single or multiple agents at the same time.

Decommissioning Management Agents Using Enterprise Manager Console

To decommission Management Agents using the Enterprise Manager Cloud Control console, you can use the Agent Decommission button under Setup > Manage Cloud Control>Agents page.

If you want to decommission a single agent, you can also use the Agent Decommission option from Agent Home page by going to Targets> Select Agent > Agent > Target Setup > Agent Decommission.

The Agent Decommission provides the following two options:
  • Remove Agent from Repository: It removes the agent(s) selected and its targets from the repository. It doesn't require agent host credentials. Only super user credentials are sufficient.
  • Remove Agent from Host and Repository: It removes the agent(s) selected and its targets from the repository. It also performs an agent software deinstallation from the host and it requires agent install user host credentials. If you select this option, there's no need to cleanup any directories or to do any agent deinstallation manually afterward.

After you select the desired option, the Agent Decommission confirmation window will be displayed:

Agent Decommission Confirmation Window

Check "I understand that agent deletion will delete all the monitored targets" checkbox. Then, select your option and press OK.

Agent Decommission confirmation window after checking check box

After confirmation, the Enterprise Manager Jobs page will open. You need to enter the required details information and click Submit. The Successful Job Submission window will be displayed with the link to the Agent Decommission job. In some cases, user may not see the complete job details since the targets and agents are already removed from repository.

Decommissioning Management Agents Using emcli

To decommission Management Agents using emcli commands, you can use the command line to create scripts and manage the agent decommission process by running the scripts manually.

Decommissioning agents using emcli provides the following two options:
  • Remove Agent from Repository: It removes the desired agent(s) and its targets from the repository. This option doesn't require agent host credentials. Only super user credentials are sufficient. This option type is called "Multiple Agents Decommission".

  • Remove Agent from Host and Repository: It removes the desired agent(s) and its targets from the repository. It also performs an agent software deinstallation from the host and it requires agent install user host credentials. There's no need to cleanup any directories or to do any agent deinstallation manually afterward. This option type is called "Multiple Agents Cleanup".

Follow the instructions below:

  1. Create an input property file using a text editor with the following required parameters:

    name is any job name you would like to use.

    type is the agent decommission option type name. It can be type=Multiple Agents Decommission or type=Multiple Agents Cleanup.

    target_list specifies the list of targets using the fully qualified host name and port number. For example, target_list=host1.example.com:1834:oracle_emd.

    schedule.frequency specifies the frequency. The supported value is IMMEDIATE.

    cred.agent_creds.<all_targets>:oracle_emd specifies the agent credentials. This is a mandatory parameter only when using type=Multiple Agents Cleanup. For example, cred.agent_creds.<all_targets>:oracle_emd=NAMED:agentinst

    • Sample input property file for type=Multiple Agents Cleanup
      name=Multi Agent Full Cleanup Job
      type=Multiple Agents Cleanup
      target_list=<FQDN_Host_Name1>:<port>:oracle_emd
      target_list=<FQDN_Host_Name2>:<port>:oracle_emd
      target_list=<FQDN_Host_Name3>:<port>:oracle_emd
      schedule.frequency=IMMEDIATE
      cred.agent_creds.<all_targets>:oracle_emd=NAMED:<Agent_Install_User>
      
      If type=Multiple Agents Cleanup, all agents targets should have been installed with the same agent credentials. If there are agents targets installed with different credentials, the input property file with different credentials should be created.
    • Sample input property file for type=Multiple Agents Decommission
      name=Multi Agent Decommission Repo only
      type=Multiple Agents Decommission
      target_list=<FQDN_Host_Name1>:<port>:oracle_emd
      target_list=<FQDN_Host_Name2>:<port>:oracle_emd
      target_list=<FQDN_Host_Name3>:<port>:oracle_emd
      schedule.frequency=IMMEDIATE
      

    After creating the appropriate input property file, it can be saved as a text file. For example, it can be named "decom_agent_multi.txt".

  2. Run emcli command to create the job using the text file created in Step 1.
    ./emcli create_job -input_file=property_file:"decom_agent_multi.txt"
    Creation of job "MULTI AGENT FULL CLEANUP JOB" was successful.
  3. Check status of the agent decommission job.
    ./emcli get_jobs -name="MULTI AGENT FULL CLEANUP JOB"
    Name    Type
    Job ID                            Execution ID                       Scheduled
    Completed        TZ Offset   Status   Status ID  Owner   Target Type  Target Name
    MULTI AGENT FULL CLEANUP JOB  Multiple Agents Decommission
    90AF4B4FBAD35BAEE053BD70F00A8249  90AF4B4FBADC5BAEE053BD70F00A8249   2019-08-21 22:52:25
    none             GMT-07:00  Running  2           SYSMAN  oracle_emd   <Host_Name1>:<port>
    MULTI AGENT  FULL CLEANUP JOB  Multiple Agents Decommission
    90AF4B4FBAD35BAEE053BD70F00A8249  90AF4B4FBAD55BAEE053BD70F00A8249   2019-08-21 22:52:25
    none             GMT-07:00  Running  2           SYSMAN  oracle_emd   <Host_Name2>:<port>
    MULTI AGENT  FULL CLEANUP JOB  Multiple Agents Decommission
    90AF4B4FBAD35BAEE053BD70F00A8249  90AF4B4FBAD95BAEE053BD70F00A8249   2019-08-21 22:52:25
    none             GMT-07:00  Running  2           SYSMAN  oracle_emd   <Host_Name3>:<port>

Deinstalling Oracle Management Agents

This section lists the deinstallation prerequisites and describes the various ways of deinstalling a standalone Oracle Management Agent. In particular, this section covers the following:

Note:

On a cluster, ensure that you deinstall the Management Agents from all the nodes one by one. To do so, follow the instructions outlined in this chapter.

Note:

When you deinstall an old standalone Management Agent and install a new standalone Management Agent on the same host, you will lose all historical target information from the Management Repository.

To avoid losing all historical target information, first install the new standalone Management Agent, then run the emcli relocate_targets command to hand over the targets from the old standalone Management Agent to the new standalone Management Agent, and then deinstall the old standalone Management Agent.

For information about the emcli relocate_targets command, see relocate_targets in the Oracle Enterprise Manager Cloud Control Command Line Interface Guide.

Deinstalling Standalone Management Agents

This section describes the following:

Deinstalling Standalone Management Agents Using the AgentDeinstall.pl Script

To deinstall a standalone Management Agent using the AgentDeinstall.pl script, follow these steps:

  1. Invoke the AgentDeinstall.pl script to delete the standalone Management Agent and also remove the agent base directory.

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

    For example,

    /u01/software/em13c/agentbasedir/agent_13.4.0.0.0/perl/bin/perl /u01/software/em13c/agentbasedir/agent_13.4.0.0.0/sysman/install/AgentDeinstall.pl -agentHome /u01/software/em13c/agentbasedir/agent_13.4.0.0.0

  2. Manually remove the targets, which were being monitored by the standalone Management Agent you deinstalled, from the Enterprise Manager Cloud Control Console. To do so, run the following EM CTL command from any host where EM CLI is installed.

    emcli delete_target

    -name="<host_name>:<agent_port>"

    -type="oracle_emd"

    -delete_monitored_targets

    For example,

    emcli delete_target

    -name="example.com:1836"

    -type="oracle_emd"

    -delete_monitored_targets

  3. Manually delete the agent base directory. For information on agent base directory, see What Is an Agent Base Directory?.

    For UNIX platforms:

    rm -rf <absolute_path_to_install_base_dir>

    For Microsoft Windows platforms:

    rmdir /s /q <absolute_path_to_install_base_dir>

Note:

While deinstalling the standalone Management Agent, the Management Agent service is removed automatically. If the service is not removed automatically, you can remove it manually after the deinstall, by running the following command:

sc delete <service_name>

Deinstalling Shared Agents

To deinstall a Shared Agent, run the following command from the Master Agent home that is visible on the host where your Shared Agent is installed:

$<AGENT_HOME>/perl/bin/perl <AGENT_HOME>/sysman/install/NFSAgentDeInstall.pl AGENT_INSTANCE_HOME=<absolute_path_to_agent_instance_home> ORACLE_HOME=<absolute_path_to_agent_home>

For example,

/shared/app/agentbasedir/agent_13.4.0.0.0/perl/bin/perl /shared/app/agentbasedir/agent_13.4.0.0.0/sysman/install/NFSAgentDeInstall.pl AGENT_INSTANCE_HOME=/shared/app/agentbasedir/agent_inst ORACLE_HOME=/shared/app/agentbasedir/agent_13.4.0.0.0

Deinstalling Standalone Management Agents Installed Using an RPM File

To deinstall a standalone Management Agent that was installed using a .rpm file, ensure that you have Resource Package Manager (RPM) installed on the Management Agent host, then follow these steps:

  1. Run the following command on the Management Agent host to obtain the RPM name:

    rpm -qa | grep oracle-agt

  2. Run the following command as a root user to deinstall the Management Agent:

    rpm -e <rpm_name>

    Here, <rpm_name> is the RPM name that is displayed in the output of the command you ran in Step 1.

After Deinstalling Standalone Management Agents

After you deinstall a standalone Management Agent, follow these steps:

  1. Verify that the Oracle homes you deinstalled are deregistered from the central inventory. However, some files might still remain in these Oracle homes. If they do, you can manually delete them.

    You must also manually delete the auto-startup script called gcstartup that will be present under /etc/init.d directory.

    Note:

    These auto-start scripts are not available on Microsoft Windows.

  2. If you deinstalled on a Microsoft Windows platform, then follow these steps to remove the entries from the Microsoft Windows registry. Ensure that you are logged in as a user with Administrator privileges on that host.

    1. Expand HKEY_LOCAL_MACHINE, SOFTWARE, Oracle, and then Sysman. Under the Sysman directory, delete the Management Agent service. For example, Oracleagent13cAgent.

    2. Close the registry editor.

Deinstalling or Undeploying Only Plug-ins from the Oracle Management Agent

If you want to deinstall or undeploy only the plug-ins from the Management Agent, and not to deinstall the Management Agent itself, then use the Plug-ins page within the Enterprise Manager Cloud Control Console. For instructions, see Undeploying Plug-Ins from Oracle Management Agent in the Oracle Enterprise Manager Cloud Control Administrator's Guide.Do NOT use the installer to undeploy only the plug-ins.