Upgrading EM12c Agents using EMCLI

Note to self on how to upgrade EM Agents using EMCLI

Find upgradeable agents:
$ emcli get_upgradable_agents
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
Upgrade agents using an input file 
$ emcli upgrade_agents -input_file="agents_file:/tmp/oradba_agents.txt" -job_name="labrac_agent_upgrade" -stage_location=/u02/tmp
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
Check Status of agent upgrade
$ emcli get_agent_upgrade_status -job_name=LABRAC_AGENT_UPGRADE

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 -
Detailed steps are not available from the command-line. Use the GUI to get the exact steps that are being executed.
$ emcli get_agent_upgrade_status -job_name=LABRAC_AGENT_UPGRADE

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
Remove old agents. First check which agents have been successfully upgraded.
$ emcli get_signoff_agents

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            
                       
The output can be re-directed to a file which can then be used as the input file for the signoff.
$ emcli get_signoff_agents -output_file="/tmp/signoff_agents.txt"

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           
                        
View output of file
$ cat /tmp/signoff_agents.txt

lnxvmorat01:3872
smoora01:3872
oradba10t:3872
pocora30d:3872
pocora31d:3872
oem1:3872
pocora10d:3872
oradba11t:3872
pocora11d:3872
Remove agents matching string oradba%
$ emcli signoff_agents -agents="oradba%" -job_name=CLEANUP_12cR2_AGNTS

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
Check status of signoff job
$ 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

Popular posts from this blog

Viewing ASM trace files and alert logs in Unix/Linux

ORA-00020: maximum number of processes (%s) exceeded

Troubleshooting RAC Public Network Failure