2017-05-15

redeploying OEM agent after cloning VM

Environment:

Oracle Linux 7.3, OEM agent 12.1.0.5.0

Solution:

prepare or re-use (if it was used for deployment) a response file, e.g. agent.rsp.
If reusing the existing file, you have to add OMS_HOST and EM_UPLOAD_PORT to the file.
If the original agent wast deployed by Pull method, you can get EM_UPLOAD_PORT from AgentPull.sh:
grep -i omsPort= AgentPull.sh
omsPort=4900

so an example of the response file:
OMS_HOST=oms_host_name
EM_UPLOAD_PORT=4900
LOGIN_USER=sysman
LOGIN_PASSWORD=pasvorto1
PLATFORM="Linux x86-64"
VERSION=12.1.0.5.0
AGENT_REGISTRATION_PASSWORD=pasvorto2

Delete files from AGENT_BASE_DIR/agent_inst
cd /opt/oracle/product/agent/agent_inst
rm -rf *

and run agentDeploy.sh script to redeloy the agent:
cd /opt/oracle/product/agent
./agentDeploy.sh AGENT_BASE_DIR=/opt/oracle/product/agent RESPONSE_FILE=/opt/oracle/product/agent.rsp

Validating the OMS_HOST & EM_UPLOAD_PORT
Executing command : /opt/oracle/product/agent/core/12.1.0.5.0/jdk/bin/java -classpath /opt/oracle/product/agent/core/12.1.0.5.0/jlib/agentInstaller.jar:/opt/oracle/product/agent/core/12.1.0.5.0/oui/jlib/OraInstaller.jar oracle.sysman.agent.installer.AgentInstaller /opt/oracle/product/agent/core/12.1.0.5.0 /opt/oracle/product/agent /opt/oracle/product/agent AGENT_BASE_DIR=/opt/oracle/product/agent RESPONSE_FILE=/opt/oracle/product/agent.rsp -prereq

Validating oms host & port with url: http://dtooem2:4900/empbs/genwallet
Validating oms host & port with url: https://dtooem2:4900/empbs/genwallet
Return status:3-oms https port is passed
Unzipping the agentcoreimage.zip to /opt/oracle/product/agent ....
plugin.zip
Executing command : /opt/oracle/product/agent/unzip -o /opt/oracle/product/agent/plugin.zip -d /opt/oracle/product/agent
Successfully unzipped /opt/oracle/product/agent/plugin.zip to /opt/oracle/product/agent !
Executing command : /opt/oracle/product/agent/core/12.1.0.5.0/jdk/bin/java -classpath /opt/oracle/product/agent/core/12.1.0.5.0/oui/jlib/OraInstaller.jar:/opt/oracle/product/agent/core/12.1.0.5.0/oui/jlib/xmlparserv2.jar:/opt/oracle/product/agent/core/12.1.0.5.0/oui/jlib/srvm.jar:/opt/oracle/product/agent/core/12.1.0.5.0/oui/jlib/emCfg.jar:/opt/oracle/product/agent/core/12.1.0.5.0/jlib/agentInstaller.jar:/opt/oracle/product/agent/core/12.1.0.5.0/oui/jlib/share.jar oracle.sysman.agent.installer.AgentInstaller /opt/oracle/product/agent/core/12.1.0.5.0 /opt/oracle/product/agent /opt/oracle/product/agent /opt/oracle/product/agent/agent_inst AGENT_BASE_DIR=/opt/oracle/product/agent


Executing agent install prereqs...
Executing command: /opt/oracle/product/agent/core/12.1.0.5.0/oui/bin/runInstaller -debug -ignoreSysPrereqs   -prereqchecker -silent -ignoreSysPrereqs -waitForCompletion  -prereqlogloc /opt/oracle/product/agent/core/12.1.0.5.0/cfgtoollogs/agentDeploy -entryPoint oracle.sysman.top.agent_Complete -detailedExitCodes PREREQ_CONFIG_LOCATION=/opt/oracle/product/agent/core/12.1.0.5.0/prereqs  -J-DAGENT_BASE_DIR=/opt/oracle/product/agent

Agent install prereqs completed successfully

Cloning the agent home...
Executing command: /opt/oracle/product/agent/core/12.1.0.5.0/oui/bin/runInstaller -debug -ignoreSysPrereqs   -clone -forceClone -silent -waitForCompletion -nowait ORACLE_HOME=/opt/oracle/product/agent/core/12.1.0.5.0 -responseFile /opt/oracle/product/agent.rsp  AGENT_BASE_DIR=/opt/oracle/product/agent AGENT_BASE_DIR=/opt/oracle/product/agent RESPONSE_FILE=/opt/oracle/product/agent.rsp -noconfig  ORACLE_HOME_NAME=agent12c2 -force b_noUpgrade=true AGENT_PORT=-1 EMCTLCFG_MODE=NONE

Cloning of agent home completed successfully

Attaching sbin home...
Executing command: /opt/oracle/product/agent/core/12.1.0.5.0/oui/bin/runInstaller -debug -ignoreSysPrereqs   -attachHome -waitForCompletion -nowait ORACLE_HOME=/opt/oracle/product/agent/sbin ORACLE_HOME_NAME=sbin12c2 -force

Attach home for sbin home completed successfully.

Updating home dependencies...
Executing command: /opt/oracle/product/agent/core/12.1.0.5.0/oui/bin/runInstaller -debug -ignoreSysPrereqs   -updateHomeDeps -waitForCompletion HOME_DEPENDENCY_LIST={/opt/oracle/product/agent/sbin:/opt/oracle/product/agent/core/12.1.0.5.0} -invPtrLoc /opt/oracle/product/agent/core/12.1.0.5.0/oraInst.loc -force

Update home dependency completed successfully.
Executing command: /opt/oracle/product/agent/core/12.1.0.5.0/oui/bin/runConfig.sh ORACLE_HOME=/opt/oracle/product/agent/core/12.1.0.5.0 RESPONSE_FILE=/opt/oracle/product/agent/core/12.1.0.5.0/agent.rsp ACTION=configure MODE=perform COMPONENT_XML={oracle.sysman.top.agent.11_1_0_1_0.xml} RERUN=true
Agent Configuration completed successfully

The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root script to run
 /opt/oracle/product/agent/core/12.1.0.5.0/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
Agent Deployment Successful.
Agent deployment log location: /opt/oracle/product/agent/core/12.1.0.5.0/cfgtoollogs/agentDeploy/agentDeploy_2017-05-12_15-28-29-PM.log
Agent deployment completed successfully.

Some observations:

agentDeploy.sh script runs with ORACLE_HOME_NAME=sbin12c2, but old default name sbin12c1 remains in central inventory. You can see it in oraInventory/ContentsXML/inventory.xml or by "opatch lsinv -all".


No comments:

Post a Comment