Thursday, March 3, 2016

OMS Movement and Configuration Agent to New Host


OMS Migration to NEW HOST and
Configure and Re-pointing Agent


Before installation I have create the same directory structure on new server.  

Unzip the OEM-12c-R5 and then run ./runInstaller  

for installing the OEM12c (Software Only) follow the below link.

OMS Migration : Moving/Migrating OEM 12c R5 to new server

Following the self explanatory blog till binary installation.

Once OEM12c Binary Installation then follow below.

·         SOURCE OEM HOST : oem254.ora.com
·         TARGET OEM HOST : oem253.ora.com
·         Repository Database : 12c (12.1.0.2) OCT 2015 PSU
       OS                            : OEL-6.5 x64

[oracle@oem254 ~]$ emctl status emkey
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Enter Enterprise Manager Root (SYSMAN) Password :
The EMKey is configured properly.


Get the list of plugins installed on existing OMS.  This plugins must be required in order to complete OMS migration.  If you have below listed plugins then move to newly created OMS Server (oem253.ora.com) else you can download from Oracle Support.

[oracle@oem254 ~]$ . oraenv
ORACLE_SID = [oms] ? REPDB
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/DB_1 is /u01/app/oracle
[oracle@oem254 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Mar 3 10:42:11 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> conn sysman/********
col url for a40
col display_name for a35
col plugin_id for a20
col version for a20
set lin200 pages 200

SELECT epv.display_name, epv.plugin_id, epv.version, epv.rev_version,decode(su.aru_file, null, 'Media/External', 'https://updates.oracle.com/Orion/Services/download/'||aru_file||'?aru='||aru_id||chr(38)||'patch_file='||aru_file) URL
  FROM EM_PLUGIN_VERSION epv, EM_CURRENT_DEPLOYED_PLUGIN ecp, EM_SU_ENTITIES su
  WHERE epv.plugin_type NOT IN ('BUILT_IN_TARGET_TYPE', 'INSTALL_HOME')
  AND ecp.dest_type='2'
  AND epv.plugin_version_id = ecp.plugin_version_id
  AND su.entity_id = epv.su_entity_id ;

DISPLAY_NAME                    PLUGIN_ID            VERSION     REV_VERSION URL
------------------------------- -------------------- ----------- ----------- --------------
Oracle MOS (My Oracle Support)  oracle.sysman.mos    12.1.0.6.0            0 Media/External
Oracle Cloud Framework          oracle.sysman.cfw    12.1.0.3.0            0 Media/External
Oracle Fusion Middleware        oracle.sysman.emas   12.1.0.8.0            0 Media/External
Oracle Database                 oracle.sysman.db     12.1.0.8.0            0 Media/External
Oracle Exadata                  oracle.sysman.xa     12.1.0.6.0            0 Media/External

SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options



From above query we have list of installed plugins.  Now it's high time to installed plugins into new host.



[oracle@oem254 ~]$ . oraenv
ORACLE_SID = [REPDB] ? oms
The Oracle base for ORACLE_HOME=/u02/app/oracle/Middleware/oms is /u01/app/oracle
[oracle@oem254 ~]$ emctl config emkey -copy_to_repos
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 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".


Since here we are moving the OMS to new host then we will take the OMS configuration backup

[oracle@oem254 ~]$ emctl exportconfig oms
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Enter Enterprise Manager Root (SYSMAN) Password :
ExportConfig started...
Backup directory is /u02/app/oracle/gc_inst/em/EMGC_OMS1/sysman/backup
Machine is Admin Server host. Performing Admin Server backup...
Exporting emoms properties...
Exporting secure properties...

Export has determined that the OMS is not fronted
by an SLB. The local hostname was NOT exported.
The exported data can be imported on any host but
resecure of all agents will be required. Please
see the EM Advanced Configuration Guide for more
details.

Warning: Could not export files for module bip: Unable to read file /u02/app/oracle/gc_inst/em/EMGC_OMS1/embip.properties for exporting
Exporting configuration for pluggable modules...
Preparing archive file...
Backup has been written to file: /u02/app/oracle/gc_inst/em/EMGC_OMS1/sysman/backup/opf_ADMIN_20160303_105032.bka

The export file contains sensitive data.
 You must keep it secure.

ExportConfig completed successfully!

Copy OMS configuration backup file to New Host

[oracle@oem254 ~]$ cp /u02/app/oracle/gc_inst/em/EMGC_OMS1/sysman/backup/opf_ADMIN_20160303_105032.bka /ora_global_nfs/BACKUP/REPDB_BACKUP/
[oracle@oem254 ~]$ emctl stop oms -all
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Stopping WebTier...
WebTier Successfully Stopped
Stopping Oracle Management Server...
Oracle Management Server Successfully Stopped
AdminServer Successfully Stopped
Oracle Management Server is Down
[oracle@oem254 ~]$

SOFTWARE LIBRARY PREPERATION on NEW HOST

Coping software library to old host to new host

[oracle@oem254 ~]$ cd /u02/app/oracle/
[oracle@oem254 oracle]$ ls
Agent12c  gc_inst  Middleware  swlib
[oracle@oem254 oracle]$ scp -r swlib oracle@oem253:/u02/app/oracle/
oracle@oem253's password:
2D015A1C815E1483E053FE01A8C0BF16           100% 1126     1.1KB/s   00:00
2D01642A570415A6E053FE01A8C07765           100% 2837     2.8KB/s   00:00
2D015A1C83701483E053FE01A8C0BF16           100% 6562     6.4KB/s   00:00
2D01523E0A9F1371E053FE01A8C0F47F           100% 5855     5.7KB/s   00:00
2D01642A55B815A6E053FE01A8C07765           100% 3254     3.2KB/s   00:00
2D01642A57E815A6E053FE01A8C07765           100% 3191     3.1KB/s   00:00
2D01642A597E15A6E053FE01A8C07765           100%   32KB  31.9KB/s   00:00
2D01642A5ACC15A6E053FE01A8C07765           100% 1743     1.7KB/s   00:00
.....          

Recovering/recreating  OMS using backup configuration via omsca on new host

oms:/u02/app/oracle/Middleware/oms:N
REPDB:/u01/app/oracle/product/12.1.0.2/DB_1:N

[oracle@oem253 ~]$ omsca recover -as -ms -nostart -backup_file /ora_global_nfs/BACKUP/REPDB_BACKUP/opf_ADMIN_20160303_105032.bka
Oracle Enterprise Manager Cloud Control 12c Release 12.1.0.5.0
Copyright (c) 1996, 2015, Oracle. All rights reserved.

OS check passed.
OMS version check passed.
Performing Admin Server Recovery...
Retrieved Admin Server template.
Source Instance Host name where configuration is exported : oem254.ora.com
instHost name retrieved from local host name : oem253.ora.com
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:
Confirm 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 ......
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

Securing OMS ......
EM Key is secured and is backed up at /u02/app/oracle/Middleware/oms/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, 81 warnings. 0 entities imported.
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://oem253.ora.com:7802/em

Add OMS finished successfully
Recovery of server EMGC_OMS1 completed successfully
OMSCA Recover completed successfully

GET THE EM_UPLOAD_PORT

Get the status of oms to know the EM_UPLOAD port.

[oracle@oem253 ~]$ . oraenv
ORACLE_SID = [oracle] ? oms

Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Enter Enterprise Manager Root (SYSMAN) Password :
Console Server Host        : oem253.ora.com
HTTP Console Port          : 7788
HTTPS Console Port         : 7802
HTTP Upload Port           : 4889
HTTPS Upload Port          : 4903
EM Instance Home           : /u02/app/oracle/gc_inst/em/EMGC_OMS1
OMS Log Directory Location : /u02/app/oracle/gc_inst/em/EMGC_OMS1/sysman/log
OMS is not configured with SLB or virtual hostname
Agent Upload is locked.
OMS Console is locked.
Active CA ID: 1
Console URL: https://oem253.ora.com:7802/em
Upload URL: https://oem253.ora.com:4903/empbs/upload

WLS Domain Information
Domain Name            : GCDomain
Admin Server Host      : oem253.ora.com
Admin Server HTTPS Port: 7102
Admin Server is RUNNING

Oracle Management Server Information
Managed Server Instance Name: EMGC_OMS1
Oracle Management Server Instance Host: oem253.ora.com
WebTier is Up
Oracle Management Server is Up

BI Publisher is not configured to run on this host.


Configure Central Agent on New Host

[oracle@oem253 agent_inst]$ /u02/app/oracle/Agent12c/core/12.1.0.5.0/sysman/install/agentDeploy.sh
AGENT_BASE_DIR=/u02/app/oracle/Agent12c AGENT_INSTANCE_HOME=/u02/app/oracle/Agent12c/agent_inst AGENT_PORT=3872 -configOnly OMS_HOST=oem253.ora.com EM_UPLOAD_PORT=4903 AGENT_REGISTRATION_PASSWORD=********

Executing command : /u02/app/oracle/Agent12c/core/12.1.0.5.0/jdk/bin/java -classpath /u02/app/oracle/Agent12c/core/12.1.0.5.0/oui/jlib/OraInstaller.jar:/u02/app/oracle/Agent12c/core/12.1.0.5.0/oui/jlib/xmlparserv2.jar:/u02/app/oracle/Agent12c/core/12.1.0.5.0/oui/jlib/srvm.jar:/u02/app/oracle/Agent12c/core/12.1.0.5.0/oui/jlib/emCfg.jar:/u02/app/oracle/Agent12c/core/12.1.0.5.0/jlib/agentInstaller.jar:/u02/app/oracle/Agent12c/core/12.1.0.5.0/oui/jlib/share.jar oracle.sysman.agent.installer.AgentInstaller /u02/app/oracle/Agent12c/core/12.1.0.5.0 /u02/app/oracle/Agent12c/core/12.1.0.5.0/sysman/install /u02/app/oracle/Agent12c /u02/app/oracle/Agent12c/agent_inst AGENT_BASE_DIR=/u02/app/oracle/Agent12c

Executing command: /u02/app/oracle/Agent12c/core/12.1.0.5.0/oui/bin/runConfig.sh ORACLE_HOME=/u02/app/oracle/Agent12c/core/12.1.0.5.0 RESPONSE_FILE=/u02/app/oracle/Agent12c/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
 /u02/app/oracle/Agent12c/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.



Run the root.sh script to complete the central agent creation part.


[oracle@oem253 agent_inst]$ sudo /u02/app/oracle/Agent12c/core/12.1.0.5.0/root.sh
Finished product-specific root actions.
/etc exist

Login to oms using emcli and sync the repository

[oracle@oem253 agent_inst]$ emcli login -username=sysman -password=********
Login successful


[oracle@oem253 agent_inst]$ emcli sync
Synchronized successfully

Relocate the repository target to the new OMS host.

[oracle@oem253 agent_inst]$ emctl config emrep -agent oem253.ora.com:3872
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Please enter repository password:     Enter password :      Login successful
Moved all targets from oem254.ora.com:3872 to oem253.ora.com:3872
Command completed successfully!       Enter password :      Login successful
Moved all targets from oem254.ora.com:3872 to oem253.ora.com:3872
Command completed successfully!

Reconfiguring deployed target from old host to new host

Status before re-pointing to new OMS host

[oracle@vm212 bin]$ ./emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.5.0
OMS Version            : (unknown)
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/app/oracle/eu/agent_inst
Agent Log Directory    : /u01/app/oracle/eu/agent_inst/sysman/log
Agent Binaries         : /u01/app/oracle/eu/core/12.1.0.5.0
Agent Process ID       : 21126
Parent Process ID      : 21074
Agent URL              : https://vm212.ora.com:3892/emd/main/
Local Agent URL in NAT : https://vm212.ora.com:3892/emd/main/
Repository URL         : https://oem254.ora.com:4903/empbs/upload
Started at             : 2016-03-03 17:45:33
Started by user        : oracle
Operating System       : Linux version 2.6.39-400.209.1.el5uek (amd64)
Last Reload            : (none)
Last successful upload                       : (none)
Last attempted upload                        : (none)
Total Megabytes of XML files uploaded so far : 0
Number of XML files pending upload           : 57
Size of XML files pending upload(MB)         : 0.09
Available disk space on upload filesystem    : 53.27%
Collection Status                            : Collections enabled
Heartbeat Status                             : OMS is unreachable
Last attempted heartbeat to OMS              : 2016-03-03 18:08:01
Last successful heartbeat to OMS             : (none)
Next scheduled heartbeat to OMS              : 2016-03-03 18:08:31

---------------------------------------------------------------
Agent is Running and Ready

Reconfigure existing agents to re-secure them against the new OMS.  Execute below command and enter the agent registration password when prompted

[oracle@vm212 bin]$ ./emctl secure agent -emdWalletSrcUrl "http://oem253.ora.com:4903/em"
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Agent successfully stopped...   Done.
Securing agent...   Started.
Enter Agent Registration Password :
Agent successfully restarted...   Done.
Securing agent...   Failed.
[oracle@vm212 bin]$ ./emctl secure agent -emdWalletSrcUrl "https://oem253.ora.com:4903/em"
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Agent successfully stopped...   Done.
Securing agent...   Started.
Enter Agent Registration Password :


Agent successfully restarted...   Done.
Securing agent...   Successful.

Step through each of your existing agents to re-secure them against the new OMS.  If you have large environment the this can be done via shall script in one go.


Verifying the agent status after the re-pointing to new host.

[oracle@vm212 bin]$ ./emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.5.0
OMS Version            : 12.1.0.5.0
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/app/oracle/eu/agent_inst
Agent Log Directory    : /u01/app/oracle/eu/agent_inst/sysman/log
Agent Binaries         : /u01/app/oracle/eu/core/12.1.0.5.0
Agent Process ID       : 25215
Parent Process ID      : 25166
Agent URL              : https://vm212.ora.com:3892/emd/main/
Local Agent URL in NAT : https://vm212.ora.com:3892/emd/main/
Repository URL         : https://oem253.ora.com:4903/empbs/upload
Started at             : 2016-03-03 18:18:46
Started by user        : oracle
Operating System       : Linux version 2.6.39-400.209.1.el5uek (amd64)
Last Reload            : (none)
Last successful upload                       : 2016-03-03 18:19:56
Last attempted upload                        : 2016-03-03 18:19:56
Total Megabytes of XML files uploaded so far : 0.14
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 53.27%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2016-03-03 18:19:49
Last successful heartbeat to OMS             : 2016-03-03 18:19:49
Next scheduled heartbeat to OMS              : 2016-03-03 18:20:51

---------------------------------------------------------------
Agent is Running and Ready



Finally its looks good. Now agent is pointing to new host.  Also verify the details on EM web console.

In the below snap you will see the updated details.  Few of them need to re-pointing. 




Also verify the migrated Administration group from OLD OMS to NEW OMS.





Hope this help :)

No comments:

Post a Comment