2018-09-04

Moving Oracle EM 12c OMR to another host

Environment

Oracle Enterprise Manager 12c (12.1.0.5, OEM12c), Oracle database 11.2.0.4, Oracle Linux 5.7

Solution

Moving Oracle Management Repository to another host.

On OMS host, Set ORACLE_HOME to OMS oracle home, test:

which emctl

Check the OMS repository configuration on the old host

emctl config oms -list_repos_details

Oracle Enterprise Manager Cloud Control 12c Release 5

Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved.

Repository Connect Descriptor : (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dtooem2)(PORT=1521)))(CONNECT_DATA=(SID=OEMDB)))

Repository User : SYSMAN



Make sure that no EM jobs are running.

Stop the OMS instances using the command emctl stop oms

emctl stop oms

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

Oracle Management Server is Down



Duplicate database with RMAN

Prepare INIT file. Check parameters with any directories.

Create SPFILE! Or DUPLICATE will fail:

RMAN-11001: Oracle Error:

ORA-32001: write to SPFILE requested but no SPFILE is in use


Create password file for the auxiliary instance as you must connect with a net service name:

RMAN-06217: not connected to auxiliary database with a net service name


Check and update TNSNAMES for BOTH target and auxiliary instances or you get:

ORA-17629: Cannot connect to the remote database server

ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified


RMAN script

rman log=$LOG append << EOF

connect auxiliary SYS/xxx@OEMDB_new

connect target SYS/xxx@OEMDB_old

run {

ALLOCATE CHANNEL tgt10 TYPE DISK;

ALLOCATE AUXILIARY CHANNEL dup1 TYPE DISK;

duplicate target database to '${ORACLE_SID}' from active database nofilenamecheck

logfile

group 1 ('/data001/oradata/${ORACLE_SID}/redo01.log') size 256M reuse,

group 2 ('/data001/oradata/${ORACLE_SID}/redo02.log') size 256M reuse,

group 3 ('/data001/oradata/${ORACLE_SID}/redo03.log') size 256M reuse,

group 4 ('/data001/oradata/${ORACLE_SID}/redo04.log') size 256M reuse;

}

exit;

EOF



Shutdown the old OMR database.

Correct the connect descriptor for the repository by running the following command on each OMS.

emctl config oms -store_repos_details -repos_conndesc "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=upooem1)(PORT=1521)))(CONNECT_DATA=(SID=OEMDB)))" -repos_user SYSMAN

Oracle Enterprise Manager Cloud Control 12c Release 5

Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved.

Enter Repository User's Password :

Successfully updated datasources and stored repository details in Credential Store.

If there are multiple OMSs in this environment, run this store_repos_details command on all of them.

And finally, restart all the OMSs using 'emctl stop oms -all' and 'emctl start oms'.


[oracle@dtooem2 ~]$ 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 Already Stopped

AdminServer Successfully Stopped

Oracle Management Server is Down

[oracle@dtooem2 ~]$ emctl start oms

Oracle Enterprise Manager Cloud Control 12c Release 5

Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved.

Starting Oracle Management Server...

Starting WebTier...

WebTier Successfully Started

Oracle Management Server Successfully Started

Oracle Management Server is Up


Do not do the next step

[dtooem2:ora] /home/oracle # emctl config repos -host upooem1 -oh /opt/oracle/product/11.2.0.4/ee_2 -conn_desc "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=upooem1)(PORT=1521)))(CONNECT_DATA=(SID=OEMDB)))"

Oracle Enterprise Manager Cloud Control 12c Release 5

Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved.

Please enter repository password:

No valid repository target found! Please enter the repository name:

OEMDB

Enter password :

Login successful

Target "OEMDB:oracle_database" modified successfully

Command completed successfully!


And it updated “Monitoring Configuration” of the old database target.

The Oracle Documentation says: “No database on host "B" has been discovered.”. The opposite worked well for me.

Discover the new database target first. Then

emctl config repos -host upooem1 -oh /opt/oracle/product/11.2.0.4/ee_2 -conn_desc "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=upooem1)(PORT=1521)))(CONNECT_DATA=(SID=OEMDB)))"

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

Target "OEMDB1:oracle_database" modified successfully

Command completed successfully!


Go to “Management Services and Repository” and update “Target Setup” > “Monitoring Configuration”

Configure backups for the new OMR database.

Oracle Documentation

Enterprise Manager Cloud Control Advanced Installation and Configuration Guide -> 19 Backing Up and Recovering Enterprise Manager

https://docs.oracle.com/cd/E24628_01/install.121/e24089/ha_backup_recover.htm#EMADV10745



No comments:

Post a comment