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



Creating a file system for Oracle database

Environment: Oracle Linux 7.5

Steps:

1. Create Virtual Disk on VM.

List all disks.

lsblk

lsblk -o name,mountpoint,label,size,uuid,partlabel,partuuid,serial,wwn,fstype


2. Create a partition table and a GPT partition: mkpart <PART-LABEL> <START> <END>

parted /dev/xvdc

(parted) mktable gpt

(parted) mkpart OMR 0% 100%

(parted) quit


3. Create EXT4 file system

mkfs.ext4 -T largefile4 /dev/xvdc1

lsblk -o name,mountpoint,label,size,uuid,partlabel,partuuid,serial,wwn,fstype


4. Mount and set permissions

mkdir -p /data001/oradata/OEMDB

vi /etc/fstab

add the following:

UUID=xxxx /data001/oradata/OEMDB ext4 noatime,nodiratime,nobarrier 1 2


mount /data001/oradata/OEMDB

df -h

chown oracle:oinstall /data001/oradata/OEMDB

ls -ld /data001/oradata/OEMDB


5. Reducing reserved blocks

By default 5% of the space to be usable only by root. E.g. You can reduce it to 0.5% by doing:

tune2fs -m 0.5 /dev/xvdc1

tune2fs -l /dev/xvdc1


Documentation

Improve I/O Performance On ext3/ext4 File Systems With The "noatime" Mount Option (Doc ID 1561740.1)

Available Mount Options to Improve ext4 Filesystem Performance (Doc ID 1476869.1)

Supported and Recommended File Systems on Linux (Doc ID 236826.1)

Oracle Database - Filesystem & I/O Type Supportability on Oracle Linux 6 (Doc ID 1601759.1)


Create XFS file system

In similar way, create FRA 30GiB, XFS file system, /data001/oradata/fast_recovery_area

mkfs.xfs /dev/xvde1

mkdir -p /data001/oradata/fast_recovery_area

lsblk -o name,mountpoint,label,size,uuid,partlabel,partuuid,serial,wwn,fstype

vi /etc/fstab

UUID=xxxx /data001/oradata/fast_recovery_area  xfs  defaults 0 0

mount /data001/oradata/fast_recovery_area

chown oracle:oinstall /data001/oradata/fast_recovery_area

ls -ld /data001/oradata/fast_recovery_area