Tuesday, 30 August 2016

Step by Step Migration Document OEM 12c to 13c on RHEL 6.8


 

Step by Step Migration  Document OEM 12c to 13c on RHEL 6.8

 

We will do the OEM migration from OEM12c running on 11203 database as OMR to OEM 13c with 12102 as OMR using two step approach and with minimum downtime

 

1.       PHASE 1 CLONING OF EXISTING OEM

2.       PHASE 2 MIGRATION OF  OEM FROM 12c TO 13c

 

 

So lets get started

 

PHASE 1 CLONING OF EXISTING OEM

 

Take the RMAN backup of OMR



run {

backup incremental level 0 database plus archivelog;

backup current controlfile;

sql 'alter system switch logfile';

backup archivelog all;

}

 

 Take OMS configuration backup



emctl exportconfig oms -sysman_pwd <sysman password>  -dir <directory to take backup>

 

Start preparing the new OEM server

 

Prepare the new server where you want to make a clone of your existing OEM,the directory structure is recommended to be same as the old server

 

Install 11203 database software in new server

 

Install 12102 database software in new server

 

Copy the files from old server to new server

 

  • Copy config backup
  • Copy OEM12c software from old server
  • Copy the RMAN backups
  • Copy software library files
  • Copy tns files

 Unzip the OEM12c software on new server

 

unzip em12103p1_linux64_disk1.zip

unzip em12103p1_linux64_disk2.zip

unzip em12103p1_linux64_disk3.zip

 

Create a new database 11203 on new server (this database would be used by OMS installer to create the configuration)


Check the database password and connection before proceeding further


 

orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID force=y password=<sys_password>

 

 

Create pfile based on the pfile from old server and make necessary changes

Make changes to listener files as well

 

Start the listener

 

Create database

 

Startup nomount

 

 

CREATE DATABASE <DB_NAME>

   USER SYS IDENTIFIED BY <sys password>

   USER SYSTEM IDENTIFIED BY <sysman password>

   LOGFILE GROUP 1 ('/<location>/redo01.log') SIZE 1024M,

           GROUP 2 ('/<location>/redo02.log') SIZE 1024M,

           GROUP 3 ('/<location>/redo03.log') SIZE 1024M

   MAXLOGFILES 5

   MAXLOGMEMBERS 5

   MAXLOGHISTORY 1

   MAXDATAFILES 500

   CHARACTER SET AL32UTF8

   NATIONAL CHARACTER SET AL16UTF16

   EXTENT MANAGEMENT LOCAL

   DATAFILE '/<location>/system01.dbf' SIZE 6G REUSE AUTOEXTEND ON

   SYSAUX DATAFILE '/<location>/sysaux01.dbf' SIZE 5G REUSE AUTOEXTEND ON

   DEFAULT TABLESPACE <tablespace name>

      DATAFILE '/<location>/dbfile.dbf'

      SIZE 1G REUSE AUTOEXTEND ON MAXSIZE UNLIMITED

   DEFAULT TEMPORARY TABLESPACE temp

      TEMPFILE '/<location>/temp01.dbf'

      SIZE 1G REUSE AUTOEXTEND ON

   UNDO TABLESPACE UNDOTBS1

      DATAFILE '/<location>/undo01.dbf'

      SIZE 1G REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

 

@?/rdbms/admin/catalog.sql

@?/rdbms/admin/catproc.sql

 

as system user

  

conn system/<sysman password>

 

@?/sqlplus/admin/pupbld.sql

  

Check the database password and connection before proceeding further

 

orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID force=y password=<sys password>

 

 Install OMS silently only software

  •  Check prerequisites

 

Go to the location where you unzipped the12c software

 

cd /<location>/install/requisites/bin

 

./emprereqkit -executionType install  -prerequisiteXMLLoc /<location>/install/requisites/list  -dbHost <db host name>  -dbPort <listener port> -dbSid <db sid> -dbUser SYS -dbPassword <sys password> -dbRole sysdba -reposUser sysman  -runPrerequisites

 

To run the corrective actions by itself run the above command with the below parameter

 

-runCorrectiveActions

  •  Install 12103 OMS software silently

 

Edit the software_only.rsp response file with the below parameters

 

cd /<location>/response

 

UNIX_GROUP_NAME="dba"

INVENTORY_LOCATION="/opt/oracle/oraInventory" 

SECURITY_UPDATES_VIA_MYORACLESUPPORT=FALSE

DECLINE_SECURITY_UPDATES=TRUE

ORACLE_MIDDLEWARE_HOME_LOCATION="/<location>"

AGENT_BASE_DIR="/<location>"

ORACLE_HOSTNAME="<db server name>"

 

 

Install the software silently

 

cd /<location>

 

./runInstaller -silent -responseFile /<location>/software_only.rsp

 

 

  •  Configure OMS with OMR

 

Before configuring make the following changes in staticports.ini file and make sure that the ports are free

 

 

Enterprise Manager Upload Http Port=4889

Enterprise Manager Upload Http SSL Port=4900

Enterprise Manager Central Console Http SSL Port=7799

Node Manager Http SSL Port=7403

Managed Server Http Port=7202

Enterprise Manager Central Console Http Port=7788

Oracle Management Agent Port=3872

Admin Server Http SSL Port=7101

Managed Server Http SSL Port=7301

 

Change the new_install.rsp file with correct values as follows

 

  

UNIX_GROUP_NAME="dba"

INVENTORY_LOCATION="/opt/oracle/oraInventory"

SECURITY_UPDATES_VIA_MYORACLESUPPORT=FALSE

DECLINE_SECURITY_UPDATES=TRUE

ORACLE_MIDDLEWARE_HOME_LOCATION="/<location>"

AGENT_BASE_DIR="/<location>"

ORACLE_HOSTNAME="<hostname>"

WLS_ADMIN_SERVER_USERNAME="weblogic"

WLS_ADMIN_SERVER_PASSWORD="<weblogic password>"

WLS_ADMIN_SERVER_CONFIRM_PASSWORD="<weblogic password>"

NODE_MANAGER_PASSWORD="<nodemanager password>"

NODE_MANAGER_CONFIRM_PASSWORD="<nodemanager password>"

ORACLE_INSTANCE_HOME_LOCATION="/<location>" CONFIGURE_ORACLE_SOFTWARE_LIBRARY=false

DATABASE_HOSTNAME="<hostname>"

LISTENER_PORT="<listener port>"

SERVICENAME_OR_SID="<service name>"

SYS_PASSWORD="<sys password>”

SYSMAN_PASSWORD="<sysman password>"

SYSMAN_CONFIRM_PASSWORD="<sysman password>"

MANAGEMENT_TABLESPACE_LOCATION="/<location>/mgmt.dbf"

CONFIGURATION_DATA_TABLESPACE_LOCATION="/<location>/mgmt_ecm_depot1.dbf"

JVM_DIAGNOSTICS_TABLESPACE_LOCATION="/<location>/mgmt_deepdive.dbf"

AGENT_REGISTRATION_PASSWORD="<agent password>"

AGENT_REGISTRATION_CONFIRM_PASSWORD="<agent password>"

STATIC_PORTS_FILE="/<location>/staticports.ini"

 

Now configure the OMS with OMR

 

cd /$OMS_HOME/sysman/install

 

sh ConfigureGC.sh -silent -responseFile /<location>/response/new_install.rsp

 

After installation secure the oms

 

emctl secure oms

 

emctl stop oms -all –force

 

emctl start oms

 

After the successful securing of OMS check the details

 

emctl status oms -details

 

emctl config oms -list_repos_details

 

 

now at this stage you will get OEM12 on new server which will be a clean slate OEM

 

Make new OMS a clone of old

  •  Clone the database using RMAN backup—in simple words do a refresh of the OMR from the RMAN backup taken above

 

After the successful refresh you will get a functional cloned OMR

 

  •  Reconfigure the oms with the backup

  

omsca recover -as -ms -nostart -backup_file /<location>/opf_ADMIN_<OMSBACKUP>.bka

 

at this stage you may get these errors

 

1.       Instance directory not empty:-Clean the OMS instance home directory

2.       There is another configuration which we just installed:-follow the below steps

 

rename emInstanceMapping.properties in <OMS_HOME>/sysman/config/

 

mv emInstanceMapping.properties emInstanceMapping.propertiesbak

 

and retry the reconfiguration..again you will get plugin related errors so follow these steps

 

  •  Install the plugins before reconfiguring OMS with the backup

  

cd /<OMS_HOME>/sysman/install

 

sh PluginInstall.sh -silent -pluginLocation /<downloaded location>/plugins

 

You can also install the missing plugins by this way

  

sh PluginInstall.sh -silent PLUGIN_SELECTION="{<plugin 1>,<plugin 2>}"

 

After every plugin was installed fire the below command

 

omsca recover -as -ms -nostart -backup_file /<location>/opf_ADMIN_<OMSBACKUP>.bka

  

After the successful configuration just resecure oms

 

$OMS_HOME/bin/emctl secure oms

 

Restart the OMS (Secure OMS requires to restart the OMS)

 

$OMS_HOME/bin/emctl stop oms -all -force

 $OMS_HOME/bin/emctl start oms

 

emctl config oms -list_repos_details

 

 

At this moment you can see that this OEM is pointing to OMR of new server..hence from console you will get 2 OMS servers running from single OMR..this is actualy the HA of OMS

 

  •  Pointing new OMS to point to newly refreshed database running from new server

 

emctl config oms -store_repos_details -repos_conndesc "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<hostname>)(PORT=<port>)))(CONNECT_DATA=(SID=<sid>)))" -repos_user sysman

 

 

Now again follow the resecuring of OMS

 

$OMS_HOME/bin/emctl secure oms

 

Restart the OMS (Secure OMS requires to restart the OMS)

 

$OMS_HOME/bin/emctl stop oms -all -force

 $OMS_HOME/bin/emctl start oms

 

 also check the details of OMS and OMR

 

emctl status oms -details

 

 

At this moment just check the details from both old and new OEM..they should ideally be pointing to different OMR..if not then make sure OEM in old server should connect to the database of old server and also check the jobs..if jobs are getting in scheduled state then just restart the OEM of old server

 

 

At this stage if you check OEM console you can see that all the targets in new OEM is unreachable..this is because the targets are still pointing to old OEM and that is still running fine

 

At this stage the cloning of existing OEM is complete and we can move to the migration phase

 

PHASE 2 MIGRATION OF  OEM FROM 12c TO 13c

 

Migration of OMR from 11203 to 12102

 

Do the migration of database as a simple 12c migration and do the following



  • Check patch status and make sure all the latest patches are installed
  • enable autoextention on all the tablespaces
  • And add sufficient space in each DBFIELE
  • Attach the oracle home if needed

  

After the successful DB migration just restart OMS and at this point the OMS is 12103 and OMR is 12102





Migration of OMS to 13100



 Copy the 13c software to the server and give desired permissions

 

 Change the following DB settings/parameters

 

NOTE:-BEFORE CHANGING DB PARAMTER MAKE A NOTE OF OLDER PARAMTERS

 

show parameter adaptive;
grant execute on dbms_random to dbsnmp;
alter system set optimizer_adaptive_features=false scope=both;
alter system set compatible='12.1.0.2.0' scope=spfile;
alter system set job_queue_processes=0 scope=spfile;
alter system set parallel_max_servers=8 scope=spfile;
alter system set parallel_min_servers=0 scope=spfile;


shu immediate;
startup
show parameter adaptive;


show parameter compat;

BEFORE STARTING THE MIGRATION JUST CHANGE THE PASSWORDS OF ALL THE USERS

Refer the following doc

12c , 13c Cloud Control: Steps for Modifying the Password for Weblogic and Nodemanager User Accounts in the Enterprise Manager Installation (Doc ID 1450798.1)

Changing sysman password :

alter user sysman identified by "<new password>";



emctl config oms -change_repos_pwd -use_sys_pwd -sys_pwd <sys password> -new_pwd <new password>

Again restart oms

Take backup of OMR and OMS

•Take RMAN backup for OMR

run {

backup incremental level 0 database plus archivelog;

backup current controlfile;

sql 'alter system switch logfile';

backup archivelog all;

}

  • Taking configuration backup of OMS

 emctl exportconfig oms -sysman_pwd <sysman password>  -dir <directory to take backup>



Seting REPO key in the repository



emctl config emkey -copy_to_repos



emctl status emkey



Run prerequisites

 Run the prereq script and solve the pending issues



./em13100_linux64.bin -silent EMPREREQ_KIT=true EMPREREQKIT_PROPERTY_FILE=/<location to file>/emprereqkit.rsp



installerMode=emprereqkit

connectString=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<hostname>)(PORT=<port>)))(CONNECT_DATA=(SERVICE_NAME=<Service name>)))

dbPassword=<sys password>

dbRole=sysdba

dbUser=SYS

executionType=upgrade

logLoc=/<location of log>

prereqResultLoc=/<location of loc>

reposUser=SYSMAN

runPrerequisites=true

runCorrectiveActions=true



Rerun the above script without corrective action to check the final status



Stop all the components of OMS which includes WebTier, OMS and AdminServer before migrating the OMS.



emctl stop oms –all



emctl stop agent





Generating the Response File for Silent Installation



Invoke the installer and generate the response file you need to use for performing a silent upgrade:



./em13100_linux64.bin -getResponseFileTemplates -outputLoc <location of response files>



If you are installing this on RHEL 6.8 then there is another BUG..Installer dsnt support 6.8

You can overcome this by looking in /etc for any files named *release*. Then use vi to modify it to an OS on the approved list. For example, /etc/redhat-release will contain that version number. Modify it to be an approved version, install, then change the file back.



After everything is done just change /etc/redhat-release with correct values



Perform silent installation of oem13c software only

Edit the software_only.rsp with the below parameters



UNIX_GROUP_NAME="dba"

INVENTORY_LOCATION="/opt/oracle/oraInventory"

ORACLE_MIDDLEWARE_HOME_LOCATION="<MW_HOME> "

AGENT_BASE_DIR="<AGENT_BASE_DIRECTORY>"

ORACLE_HOSTNAME="<hostname>"



./em13100_linux64.bin -silent -responseFile /<location of response files>/software_only.rsp



Follow the below steps to overcome a bug



 1. Restore the OEM environment from backup prior to starting the 13c upgrade process.

 2. Perform the 13c software-only installation.

 3  Take a backup of the file <13c_MIDDLEWARE_HOME>/sysman/admin/emdrep/sql/core/13.1.0.0/cost_center/cost_center_data_upgrade.sql.

 4. Remove following line from the file <13c_MIDDLEWARE_HOME>/sysman/admin/emdrep/sql/core/13.1.0.0/cost_center/cost_center_data_upgrade.sql:

        Rem drv: <migrate type="data_upgrade" version="13.1.0.0" />

   Save the file.

5. Start the 13c upgrade by running:

<13c_MIDDLEWARE_HOME>/sysman/install/ConfigureGC.sh



Configure the OMS for the upgrade on new server

Edit the upgrade.rsp with the below parameters (note the # parameters)

 

UNIX_GROUP_NAME="dba"

INVENTORY_LOCATION="/opt/oracle/oraInventory"

DECLINE_SECURITY_UPDATES=true

#MYORACLESUPPORT_USERNAME=<string>

#MYORACLESUPPORT_PASSWORD=<string>

#STAGE_LOCATION=<string>

#MYORACLESUPPORT_USERNAME_FOR_SOFTWAREUPDATES=<string>

#MYORACLESUPPORT_PASSWORD_FOR_SOFTWAREUPDATES=<string>

ORACLE_MIDDLEWARE_HOME_LOCATION="<MW_HOME> "

ORACLE_INSTANCE_HOME_LOCATION="<MW_HOME> /gc_inst"

OLD_BASE_DIR="<OLD_MW_HOME> "

ORACLE_HOSTNAME="<hostname>"

AGENT_BASE_DIR="<AGENT_BASE_DIRECTORY>"

#OLD_DATABASE_CONNECTION_DESCRIPTION=<string>

#OLD_DATABASE_SYSMAN_PASSWORD=<string>

WLS_ADMIN_SERVER_USERNAME="Weblogic"

WLS_ADMIN_SERVER_PASSWORD="<Weblogic password>"

WLS_ADMIN_SERVER_CONFIRM_PASSWORD="<Weblogic password>"

NODE_MANAGER_PASSWORD="<nodemanager password>"

NODE_MANAGER_CONFIRM_PASSWORD="<nodemanager password>"

WLS_ADMIN_SERVER_PASSWORD="<Weblogic password>"

#JVM_DIAGNOSTICS_TABLESPACE_LOCATION=<string>

DATABASE_HOSTNAME="<hostname>"

LISTENER_PORT="<port>"

SERVICENAME_OR_SID="<sid>"

SYS_PASSWORD="<sys password>"

SYSMAN_PASSWORD="<Sysman password>"

REPOSITORY_BACKUP_DONE=true

CONFIGURE_SHARED_LOCATION_BIP=true

CONFIG_LOCATION="<location>/config"

CLUSTER_LOCATION="<location>/cluster"

ENABLE_BI_PUBLISHER=TRUE



cd /<OMS HOME>/sysman/install/



ConfigureGC.sh -silent -responseFile /<location>/upgrade.rsp

 



Installing Agent



Logon to your OEM Server and issue the following commands to generate the agentdeploy script



emcli login -username=sysman -password=<sysman password>

emcli sync

emcli get_supported_platforms



emcli get_agentimage -destination=/<location>/agentimage  -platform="Linux x86-64" -version=13.1.0.0.0



./agentDeploy.sh AGENT_BASE_DIR=<AGENT_BASE_DIRECTORY> OMS_HOST=<hostname>  EM_UPLOAD_PORT=4900 AGENT_REGISTRATION_PASSWORD=<password> AGENT_PORT=3872

Now copy these image files to each target server and install the OEM13c agent..at this stage one by one all of your targets start pointing to new OEM13c and after migrating all targtes to point to 13c you can stop and say good bye to your old OEM i.e good old friend 12c

 

No comments:

Post a Comment