Upgrading EM12c Agents using EMCLI
Note to self on how to upgrade EM Agents using EMCLI
Find upgradeable agents:
Note that the sign-off doesn't remove the old agent home. You will have to manually remove the directory.
e.g. rm -rf /u01/oracle/agent12c/core/12.1.0.2.0
Find upgradeable agents:
$ emcli get_upgradable_agentsUpgrade agents using an input file
Upgradable Agents
Agent Installed Version Version After Upgrade Platform Oracle Home
----- ----------------- --------------------- -------- -----------
oradba10t:3872 12.1.0.2.0 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.2.0
oradba11t:3872 12.1.0.2.0 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.2.0
$ vi /tmp/oradba_agents.txt
$ cat /tmp/oradba_agents.txt
oradba10t:3872
oradba11t:3872
$ emcli upgrade_agents -input_file="agents_file:/tmp/oradba_agents.txt" -job_name="labrac_agent_upgrade" -stage_location=/u02/tmpCheck Status of agent upgrade
The agent list size is 2
Upgradable Agents
Agent Installed Version Version After Upgrade Platform Oracle Home
----- ----------------- --------------------- -------- -----------
oradba10t:3872 12.1.0.2.0 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.2.0
oradba11t:3872 12.1.0.2.0 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.2.0
For the following Management Agents root.sh cannot be run. Run the script(/root.sh) manually post upgrade
Agent Reason
----- ------
oradba10t:3872 Preferred Privileged Credential for Oracle Home of Agent : Not Set | Privilege Delegation for Host : Not Set
oradba11t:3872 Preferred Privileged Credential for Oracle Home of Agent : Not Set | Privilege Delegation for Host : Not Set
Agent Upgrade Job submitted for Upgradable Agents shown above. Use emcli get_agent_upgrade_status command or goto EM CONSOLE -> Set Up -> Manage Cloud Control -> Upgrade Agents -> Agent Upgrade Results to see job status
Job Name : LABRAC_AGENT_UPGRADE
$ emcli get_agent_upgrade_status -job_name=LABRAC_AGENT_UPGRADEDetailed steps are not available from the command-line. Use the GUI to get the exact steps that are being executed.
Showing for each agent in the job LABRAC_AGENT_UPGRADE
Agent Status Started Ended
----- ------ ------- -----
oradba11t:3872 Running 2013-11-21 16:12:52 CST -
oradba10t:3872 Running 2013-11-21 16:12:52 CST -
$ emcli get_agent_upgrade_status -job_name=LABRAC_AGENT_UPGRADERemove old agents. First check which agents have been successfully upgraded.
Showing for each agent in the job LABRAC_AGENT_UPGRADE
Agent Status Started Ended
----- ------ ------- -----
oradba11t:3872 Success 2013-11-21 16:12:52 CST 2013-11-21 16:33:30 CST
oradba10t:3872 Success 2013-11-21 16:12:52 CST 2013-11-21 16:35:03 CST
$ emcli get_signoff_agentsThe output can be re-directed to a file which can then be used as the input file for the signoff.
Agents available for Sign-off
Agent Installed Version Platform Oracle Home
----- ----------------- -------- -----------
lnxvmorat01 :3872 12.1.0.3.0 Linux x86-64 /u02/oracle/agent12c/core/12.1.0.3.0
smoora01 :3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12cR2/core/12.1.0.3.0
oradba10t:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.3.0
pocora30d:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.3.0
pocora31d:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.3.0
oem1 :3872 12.1.0.3.0 Linux x86-64 /u02/oracle/agent12c/core/12.1.0.3.0
pocora10d :3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12cR2/core/12.1.0.3.0
oradba11t:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.3.0
pocora11d :3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12cR2/core/12.1.0.3.0
$ emcli get_signoff_agents -output_file="/tmp/signoff_agents.txt"View output of file
Agents available for Sign-off
Agent Installed Version Platform Oracle Home
----- ----------------- -------- -----------
lnxvmorat01:3872 12.1.0.3.0 Linux x86-64 /u02/oracle/agent12c/core/12.1.0.3.0
smoora01:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12cR2/core/12.1.0.3.0
oradba10t:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.3.0
pocora30d:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.3.0
pocora31d:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.3.0
oem1:3872 12.1.0.3.0 Linux x86-64 /u02/oracle/agent12c/core/12.1.0.3.0
pocora10d:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12cR2/core/12.1.0.3.0
oradba11t:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.3.0
pocora11d:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12cR2/core/12.1.0.3.0
$ cat /tmp/signoff_agents.txtRemove agents matching string oradba%
lnxvmorat01:3872
smoora01:3872
oradba10t:3872
pocora30d:3872
pocora31d:3872
oem1:3872
pocora10d:3872
oradba11t:3872
pocora11d:3872
$ emcli signoff_agents -agents="oradba%" -job_name=CLEANUP_12cR2_AGNTSCheck status of signoff job
Agents available for Sign-off
Agent Installed Version Platform Oracle Home
----- ----------------- -------- -----------
oradba10t:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.3.0
oradba11t:3872 12.1.0.3.0 IBM AIX on POWER Systems (64-bit) /u02/oracle/agent12c/core/12.1.0.3.0
Agent Sign-off Job Submitted for the above agents. Use emcli get_signoff_status or goto EM CONSOLE -> Set Up -> Manage Cloud Control -> Upgrade Agents -> Post Agent Upgrade Tasks -> Sign-off Agent Results to see job status
Job Name : CLEANUP_12CR2_AGNTS
$ emcli get_signoff_status
Showing for each job
Job Name Status Total Agents Started Ended
-------- ------ ------------ ------- -----
CLEANUP_12CR2_AGNTS Success 2 2013-11-21 17:08:30 CST
2013-11-21 17:08:44 CST
Note that the sign-off doesn't remove the old agent home. You will have to manually remove the directory.
e.g. rm -rf /u01/oracle/agent12c/core/12.1.0.2.0
Comments
Post a Comment