It is a good idea to use virtual hostname when EMCC is configured with a active/passive configuration.
There steps are documented in the MOS 2602135.1 for emcc 13.3 and beyond.
#1 Stop all OMS but the primary OMS
Only the primary OMS must be running.
#2 Export the key
$ORACLE_HOME/bin/emctl config emkey -copy_to_repos
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
Enter Enterprise Manager Root (SYSMAN) Password :
The EMKey has been copied to the Management Repository. This operation will cause the EMKey to become unsecure.
After the required operation has been completed, secure the EMKey by running "emctl config emkey -remove_from_repos".
#3 Export the oms config
$ORACLE_HOME/bin/emctl exportconfig oms -sysman_pwd welcome1 -dir /tmp/oms20230906.cfg
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
ExportConfig started...
Backup directory is /tmp/oms20230906.cfg
Machine is Admin Server host. Performing Admin Server backup...
Exporting emoms properties...
Exporting secure properties...
Exporting configuration for pluggable modules...
Preparing archive file...
Backup has been written to file: /tmp/oms20230906.cfg/opf_ADMIN_20230906_095550.bka
The export file contains sensitive data.
You must keep it secure.
ExportConfig completed successfully!
#4 Stop the OMS
Stop the OMS on the first/primary node, here using my scripts:
stop_all.sh
#5 Save old configuration files
cd /u01/app/oracle/
mv gc_inst gc_inst.old
cd /u01/app/oracle/emagent
mv agent_inst agent_inst.old
cd /u01/app/oracle/gc/sysman/config
mv emInstanceMapping.properties emInstanceMapping.properties.old
#6 Configure the virtualhost
Configure /etc/hosts or the DNS for the new virtual host to evaluate
#7 Restore the configuration with the new hostname
export ORACLE_HOSTNAME=emdev13c01
export HOSTNAME=emdev13c01
$ORACLE_HOME/bin/omsca recover -BACKUP_FILE /tmp/oms20230906.cfg/opf_ADMIN_20230906_095550.bka -AS -MS -NOSTART -EM_INSTANCE_HOST emdev13c01 -AS_USERNAME "weblogic" -AS_HOST emdev13c01 -NM_USER "nodemanager"
Oracle Enterprise Manager Cloud Control 13c Release 13.5.0.0.0
Copyright (c) 1996, 2021, Oracle. All rights reserved.
Recovered Instance Host name used from command line argument : emdev13c01
OS check passed.
OMS version check passed.
Performing Admin Server Recovery...
Retrieved Admin Server template.
Source Instance Host name where configuration is exported : emdev13c01p.uk.osc.oracle.com
Recovered Instance Host name retrieved from ORACLE_HOSTNAME environment variable : emdev13c01u
Populated install params from backup...
Enter Administration Server user password:
Confirm Password:
Enter Node Manager Password:
Confirm Password:
Enter Repository database user password:
Enter Agent Registration password:
Doing pre requisite checks ......
Pre requisite checks completed successfully
Checking Plugin software bits
Proceed to recovery
Setting up domain from template...
Setup EM infrastructure succeeded!
Admin Server recovered from backup.
Now performing cleanup of OMS EMGC_OMS1...
Now launching DeleteOMS...
OMS Deleted successfully
Delete finished successfully
Now launching AddOMS...
Infrastructure setup of EM completed successfully.
Doing pre deployment operations ......
Pre deployment of EM completed successfully.
Deploying EM ......
Creating Data source first !!
Deployment of EM completed successfully.
Configuring webtier ......
Configuring webTier completed successfully.
Importing OMS configuration from recovery file...
If you have software library configured
please make sure it is functional and accessible
from this OMS by visiting:
Setup->Provisioning and Patching->Software Library
Importing configuration for pluggable modules...
Securing OMS ......
EM Key is secured and is backed up at /u01/app/oracle/gc/sysman/config/emkey.ora
Adapter already exists: emgc_USER
Adapter created successfully: emgc_GROUP
Post "Deploy and Repos Setup" operations completed successfully.
Performing Post deploy operations ....
Total 0 errors, 90 warnings. 0 entities imported.
pluginID:oracle.sysman.core
Done with csg import
pluginID:oracle.sysman.core
Done with csg import
pluginID:oracle.sysman.core
Done with csg import
pluginID:oracle.sysman.core
Done with csg import
No logging has been configured and default agent logging support is unavailable.
Post deploy operations completed successfully.
EM configuration completed successfully.
EM URL is:https://emdev13c01:7803/em
Add OMS finished successfully
Recovery of server EMGC_OMS1 completed successfully
OMSCA Recover completed successfully
$
Configure the central agent
export ORACLE_HOSTNAME=emdev13c01u
export HOSTNAME=emdev13c01u
/u01/app/oracle/emagent/agent_13.5.0.0.0/sysman/install/agentDeploy.sh AGENT_BASE_DIR=/u01/app/oracle/emagent AGENT_INSTANCE_HOME=/u01/app/oracle/emagent/agent_inst ORACLE_HOSTNAME=emdev13c01 AGENT_PORT=3879 OMS_HOST=emdev13c01 EM_UPLOAD_PORT=4903 AGENT_REGISTRATION_PASSWORD=welcome1 -configOnly -ignorePrereqs
Validating the OMS Host and Port completed.
-configOnly
-ignorePrereqs
/u01/app/oracle/emagent/agent_13.5.0.0.0/oracle_common/jdk/jre/bin/java -classpath /u01/app/oracle/emagent/agent_13.5.0.0.0/oui/modules/OraInstaller.jar:/u01/app/oracle/emagent/agent_13.5.0.0.0/oui/modules/emCfg.jar:/u01/app/oracle/emagent/agent_13.5.0.0.0/jlib/agentInstaller.jar oracle.sysman.agent.installer.AgentFreshInstaller /u01/app/oracle/emagent/agent_13.5.0.0.0 /u01/app/oracle/emagent/agent_inst /u01/app/oracle/emagent RESPONSE_FILE=/u01/app/oracle/emagent/agentInstall.rsp $args
The AgentFreshInstaller is starting now
Oraclehome : ../u01/app/oracle/emagent/agent_13.5.0.0.0
InstanceHome : /u01/app/oracle/emagent/agent_inst
Agent Base Directory : /u01/app/oracle/emagent
The oraclehome /u01/app/oracle/emagent/agent_13.5.0.0.0
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: /u01/app/oracle/emagent/agent_13.5.0.0.0
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: /u01/app/oracle/emagent/agent_inst
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: /u01/app/oracle/emagent
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: RESPONSE_FILE=/u01/app/oracle/emagent/agentInstall.rsp
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: AGENT_BASE_DIR=/u01/app/oracle/emagent
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: AGENT_INSTANCE_HOME=/u01/app/oracle/emagent/agent_inst
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: ORACLE_HOSTNAME=emdev13c01
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: AGENT_PORT=3879
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: OMS_HOST=emdev13c01
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: EM_UPLOAD_PORT=4903
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: ORACLE_HOME=/u01/app/oracle/emagent/agent_13.5.0.0.0
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: AGENT_PORT=3879
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: EM_UPLOAD_PORT=4903
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: OMS_HOST=emdev13c01
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: AGENT_INSTANCE_HOME=/u01/app/oracle/emagent/agent_inst
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: AGENT_BASE_DIR=/u01/app/oracle/emagent
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: b_doDiscovery=true
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: START_AGENT=true
startAgent is:true
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: b_forceConfigure=false
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: b_sharedAgents=false
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: b_secureAgent=true
seci is :true
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: b_noUpgrade=true
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: b_agentupgrade=false
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: PLUGIN_RSPFILE=/u01/app/oracle/emagent/agent_13.5.0.0.0/sysman/install/plugins.txt
Sep 06, 2023 1:19:18 PM oracle.sysman.agent.installer.AgentInstaller parseResponseFile
INFO: ORACLE_HOSTNAME=emdev13c01
log loction is setlog
Writing the following contents into /u01/app/oracle/emagent/agent_13.5.0.0.0/install/oragchomelist
/u01/app/oracle/emagent/agent_13.5.0.0.0:/u01/app/oracle/emagent/agent_inst
Both /etc/oragchomelist and /var/opt/oracle/oragchomelist does not exist.
The value of chainInstall : false forceConfigure : false skipValidation : false
Validating oms host & port with url: https://emdev13c01:4903/empbs/genwallet
Validating oms host & port with url: http://emdev13c01:4903/empbs/genwallet
The status is 0
Validated the oms host and port :- emdev13c01----4903
Getting Inet Addresses for host emdev13c01u.osc.uk.oracle.com
** Agent Port Check completed successfully.**
Validated the agent port :- ----3879
shared agent value is :false
chain install is :false
Agent Configuration completed successfully
The following configuration scripts need to be executed as the "root" user. Root script to run : /u01/app/oracle/emagent/agent_13.5.0.0.0/root.sh
/u01/app/oracle/emagent/agent_13.5.0.0.0/cfgtoollogs/agentDeploy/agentDeploy_2023-09-06_13-19-18-PM.log
Waiting for agent targets to get promoted...
Waiting for agent targets to get promoted...
Waiting for agent targets to get promoted...
Successfully Promoted agent and its related targets to Management Agent
[oracle@emdev13c01u oracle]$ cat g
export ORACLE_HOSTNAME=emdev13c01u
export HOSTNAME=emdev13c01u
#$ORACLE_HOME/bin/omsca recover -BACKUP_FILE /tmp/oms20230906.cfg/opf_ADMIN_20230906_095550.bka -AS -MS -NOSTART -EM_INSTANCE_HOST emdev13c01 -AS_USERNAME "weblogic" -AS_HOST emdev13c01 -NM_USER "nodemanager"
/u01/app/oracle/emagent/agent_13.5.0.0.0/sysman/install/agentDeploy.sh AGENT_BASE_DIR=/u01/app/oracle/emagent AGENT_INSTANCE_HOME=/u01/app/oracle/emagent/agent_inst ORACLE_HOSTNAME=emdev13c01 AGENT_PORT=3879 OMS_HOST=emdev13c01 EM_UPLOAD_PORT=4903 AGENT_REGISTRATION_PASSWORD=welcome1 -configOnly -ignorePrereqs
#8 Move the target to the new agent
$ORACLE_HOME/bin/emcli logout
$ORACLE_HOME/bin/emcli login -username=sysman
$ORACLE_HOME/bin/emcli sync
$ORACLE_HOME/bin/emctl config emrep -agent emdev13c01:3879
Logout successful
Enter password :
Login successful
Synchronized successfully
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
Please enter repository password:
Enter password :
Login successful
Moved all targets from emdev13c01p.uk.osc.oracle.com:3872 to emdev13c01:3879
Command completed successfully!
Enter password :
Login successful
Moved all targets from emdev13c01p.uk.osc.oracle.com:3872 to emdev13c01:3879
Command completed successfully!
#9 Update the hostname of agent monitoring the GCDomain
Login to the OMS, navigate to the “Target Setup=>Modify Agents” to assign the new agent to all GCDomain targets.
#10 Refresh the GCDomain
Refresh the WLS Domain, eliminate the old agent target if asked.
Remove the old NodeManager target
#11 Remove the old primary central agent
Remove the old agent target
#12
1. After Enterprise Manager(EM) Cloud Control migration to a new Host(or hostname change), Oracle Http Server(OHS) and Nodemanager showing down in EM console. OHS,Nodemanager Targets information is showing old EM hostname instead of new.
2. Refreshing WLS domain following warning is reported in EM console.
“Warning:1 targets required a local agent,but no local agent was found”
3. In Agent <AGENT_INST>/sysman/emd/targets.xml also we can see old OMS hostname for OHS,Nodemanager targets
4. As per domain <gc_inst>/user_projects/domains/GCDomain/config/config.xml file also, OHS and Nodemanager targets pointing to old host
5. In <gc_inst>/user_projects/domains/GCDomain/config/fmwconfig/components/OHS/instances/<OHS Name>/httpd.conf file also ServerName pointing to old host name
6. In <gc_inst>/user_projects/domains/GCDomain/init-info/startscript.xml file old OMS host name is displayed for NODEMGR_HOST environment element.
<setenv name=”NODEMGR_HOST” scope=”global”>
<value><OLD HOST NAME></value>
</setenv>
#12 Enrol the all other OMS
Enrol the other OSM still running on their former hostname/virtualhostnames
$ORACLE_HOME/bin/emctl enroll oms -as_host emdev13c01 -as_port 7102 -as_pwd welcome1 -nm_pwd welcome1
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
Enrolling Managed Server with Admin Server ... emdev13c01:7102
Enroll OMS completed successfully!
#13 Export the second OMS config
$ $ORACLE_HOME/bin/emctl exportconfig oms -sysman_pwd welcome1 -dir /tmp/oms20230906
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
ExportConfig started...
Backup directory is /tmp/oms20230906
***This host is not the Administration Server host, only OMS specific properties will be exported***
***Please execute this command on the Administration Server host to take a full export***
Performing OMS backup...
Exporting emoms properties...
Exporting secure properties...
Exporting configuration for pluggable modules...
Preparing archive file...
Backup has been written to file: /tmp/oms20230906/opf_OMS_20230907_122325.bka
The export file contains sensitive data.
You must keep it secure.
ExportConfig completed successfully!
#14 Stop the second OMs and agent
stop_all.sh
#15 Remove legacy directories on the second OMS
cd /u01/app/oracle/
mv gc_inst gc_inst.old
cd /u01/app/oracle/emagent
mv agent_inst agent_inst.old
cd /u01/app/oracle/gc/sysman/config
mv emInstanceMapping.properties emInstanceMapping.properties.old
#16 Configure the virtualhost
Configure /etc/hosts or the DNS for the new virtual host to evaluate
#7 Restore the configuration with the new hostname
export ORACLE_HOSTNAME=emdev13c02
export HOSTNAME=emdev13c02
dev13$ORACLE_HOME/bin/omsca recover -BACKUP_FILE /tmp/oms20230906/opf_OMS_20230907_122325.bka -MS -NOSTART -EM_INSTANCE_HOST emdev13c02 -AS_USERNAME "weblogic" -AS_HOST emdev13c01 -AS_PASSWORD welcome1 -REP_CONN_STR "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ngcdb01-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=ngcdb02-vip)(PORT=1521)))(LOAD_BALANCE=ON)(CONNECT_DATA=(SERVICE_NAME=omrdev13c_srv)))" -CONFIG_HOME /u01/app/oracle/gc_inst -OMSNAME EMGC_OMS2
Oracle Enterprise Manager Cloud Control 13c Release 13.5.0.0.0
Copyright (c) 1996, 2021, Oracle. All rights reserved.
emInstanceMapping.properties