Database Reference
In-Depth Information
Failover of the management repository using Data Guard is similar to a switchover, except the command issued
using DGMGRL would be failover to <standby_db_name> .
In addition to using the preceding manual steps, you can automate the failover of the OMS and management
repository by using Data Guard fast-start failover:
Fast-start failover determines when a failover to a standby is necessary by using an Observer
process that runs on another host independent of both primary and standby servers. If
the Observer cannot contact the primary site after a certain configurable period, it will
automatically fail over to the standby database.
After failover occurs, a database event called
DB_ROLE_CHANGE is fired.
The
DB_ROLE_CHANGE event causes a trigger to be fired, which in turn starts up the Enterprise
Manager Application tier.
A script can be created that will automate these steps. Using the sample script provided in the <OMS_HOME>/
sysman/ha directory, create a script that will configure the OMS to point to a new primary database and start up
all management services. Listing 13-1 is an example of a script that will start up the standby OMS and reconfigure
the OMS with the new primary management repository database that has been switched over in a Data Guard
configuration.
Listing 13-1. Sample Script to Start EM Tier on Standby Site
#!/bin/sh
LOGFILE="/oms_swlib/em/failover/em_failover.log"
OMS_ORACLE_HOME="/u01/app/oracle/Middleware/oms"
CENTRAL_AGENT="oem2.example.com:3872"
SYSMAN_PWD="oracle12c"
#log message
echo "###############################" >> $LOGFILE
date >> $LOGFILE
echo $OMS_ORACLE_HOME >> $LOGFILE
id >> $LOGFILE 2>&1
#switch all OMS to point to new primary and startup all OMS
$OMS_ORACLE_HOME/bin/emctl config oms -store_repos_details -repos_conndesc
"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oem1)(PORT=1521)))
(CONNECT_DATA=(SID=emrep2)))" \
-repos_user sysman -repos_pwd $SYSMAN_PWD >> $LOGFILE 2>&1
$OMS_ORACLE_HOME/bin/emctl sync_opss_policy_store \
-sysman_pwd oracle12c >> $LOGFILE 2>&1
$OMS_ORACLE_HOME/bin/emctl stop oms >> $LOGFILE 2>&1
$OMS_ORACLE_HOME/bin/emctl start oms >> $LOGFILE 2>&1
#relocate Management Services and Repository target
#to be done only once in a multiple OMS setup
#allow time for OMS to be fully initialized
$OMS_ORACLE_HOME/bin/emctl config emrep -agent $CENTRAL_AGENT \
-conn_desc -sysman_pwd $SYSMAN_PWD >> $LOGFILE 2>&1
#always return 0 so that dbms scheduler job completes successfully
exit 0
 
Search WWH ::




Custom Search