VirtualObjectives

Reinitialise Oracle Enterprise Manager (OEM)

After a restore of a database to another RAC environment, the SYSMAN schema will contain references to the original server environment. You can reinitialize the OEM Database Control on the RAC nodes.

The following example is for Windows based installations of Oracle using Oracle Enterprise Manager (OEM) Database Control (not Grid Control).
In all cases, you only need to run the following from one node only in your RAC.
It will not reinitialise the SYSMAN schema so you won't lose configurations.
This will set up OEM services\agents on all RAC nodes.

The example below is for a two node RAC with the following configuration:

  • The database is called dbname running on cluster db_cluster
  • The server names are SVRODBP01 and SVRODBP02
  • The instance dbname1 runs on SVRODBP01
  • The instance dbname2 runs on SVRODBP02

First off, set your Oracle Home....

Or even better use oraenv and then run EMCA as shown below...

STARTED EMCA
EM Configuration Assistant, Version 10.2.0.5.0 Production
Copyright (c) 2003, 2009, Oracle.  All rights reserved.

Enter the following information:
Database unique name: dbname
NOTE: Enter your database name. 
Database Control is already configured for the database dbname
You have chosen to configure Database Control for managing the database dbname
This will remove the existing configuration and the default settings and perform
 a fresh configuration
Do you wish to continue? [yes(Y)/no(N)]: y
Listener port number: 1521
NOTE: The port number may be different in your environment.
Cluster name: db_cluster
NOTE: cluster name can be obtained from DOS command "cemutlo -n"
Password for SYS user: sys_password
Password for DBSNMP user: dbsnmp_password
Password for SYSMAN user: sysman_password
Password for SYSMAN user: Email address for notifications (optional): [Enter]
Outgoing Mail (SMTP) server for notifications (optional): smtpserver
ASM ORACLE_HOME [ E:\oracle\1020\database ]: e:\oracle\1020\asm
ASM port [ 1521 ]: [Enter]
ASM user role [ SYSDBA ]: [Enter]
ASM username [ SYS ]: [Enter]
ASM user password: sys_password
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ E:\oracle\1020\database

Database instance hostname ................ SVRODBP01
Listener port number ................ 1521
Cluster name ................ db_cluster
Database unique name ................ dbname
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ............... smtpserver
ASM ORACLE_HOME ................ e:\oracle\1020\asm
ASM port ................ 1521
ASM user role ................ SYSDBA
ASM username ................ SYS

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
30/08/2012 13:29:57 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at E:\oracle\1020\database\cfgtoollogs\emca
\dbname\emca_2012-08-30_01-21-00-PM.log.
30/08/2012 13:30:09 oracle.sysman.emcp.util.PortManager isPortInUse
WARNING: Specified port 5540 is already in use.
30/08/2012 13:30:11 oracle.sysman.emcp.util.PortManager isPortInUse
WARNING: Specified port 5520 is already in use.
30/08/2012 13:30:13 oracle.sysman.emcp.util.PortManager isPortInUse
WARNING: Specified port 1158 is already in use.
30/08/2012 13:30:15 oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
30/08/2012 13:30:20 oracle.sysman.emcp.EMReposConfig createOutOfBoxJobs
WARNING: ORA-20401: A job with the specified name already exists
ORA-06512: at "SYSMAN.MGMT_JOBS", line 196
ORA-06512: at "SYSMAN.MGMT_JOBS", line 78
ORA-06512: at line 16

30/08/2012 13:30:23 oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating E:\oracle\1020\database\oc4j\j2ee\OC4J_DBConsole_svrodbp01_db
name1 to remote nodes ...
30/08/2012 13:30:23 oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating E:\oracle\1020\database\oc4j\j2ee\OC4J_DBConsole_svrodbp02_db
name2 to remote nodes ...
30/08/2012 13:30:46 oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating E:\oracle\1020\database\svrodbp01_dbname1 to remote nodes ...
30/08/2012 13:31:00 oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating E:\oracle\1020\database\svrodbp02_dbname2 to remote nodes ...
30/08/2012 13:31:09 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
30/08/2012 13:33:05 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
30/08/2012 13:34:27 oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
30/08/2012 13:34:27 oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://SVRODBP01:1158/em <<<<<<<
<<<<
30/08/2012 13:34:27 oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage

INFO:
****************  Current Configuration  ****************
 INSTANCE            NODE           DBCONTROL_UPLOAD_HOST
----------        ----------        ---------------------

dbname1           svrodbp01         SVRODBP01
dbname2           svrodbp02         SVRODBP02

Enterprise Manager configuration completed successfully
FINISHED EMCA

DOS>	 

Test by accessing OEM from all nodes using the URL.

If OEM does not run at all on any node:

If the above does not work then run the following using the same responses shown in the example above.
This will recreate not only the clients but re initialise the SYSMAN schema which means you will lose all configurations.

If OEM is only running on one node:

Notice that in the example above DBCONTROL_UPLOAD_HOST is on each node which is what we want.

 INSTANCE            NODE           DBCONTROL_UPLOAD_HOST
----------        ----------        ---------------------

dbname1           svrodbp01         SVRODBP01
dbname2           svrodbp02         SVRODBP02

You can test by running the following on the newly added node:

Also, the following will display the current configuration:

Setting OEM to run on each node:

If OEM does not run from all desired nodes, then you will need to do the following.
In the following example, OEM was only configured to run from SVRODBP01 where it should also run from SVRODBP02
This was confirmed by running the following...

 INSTANCE            NODE           DBCONTROL_UPLOAD_HOST
----------        ----------        ---------------------

dbname1           svrodbp01         SVRODBP01
dbname2           svrodbp02         SVRODBP01

To fix this, run the following substituting your server name(s)...

STARTED EMCA
EM Configuration Assistant, Version 10.2.0.5.0 Production
Copyright (c) 2003, 2009, Oracle.  All rights reserved.

Enter the following information:
Database unique name: dbname
Agent SID list [comma separated] (optional): dbname2

Do you wish to continue? [yes(Y)/no(N)]: y
30/08/2012 15:39:41 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at E:\oracle\1020\database\cfgtoollogs\emca
\dbname\emca_2012-08-30_03-39-32-PM.log.
30/08/2012 15:40:37 oracle.sysman.emcp.util.GeneralUtil initSQLEngine
WARNING: ORA-01017: invalid username/password; logon denied

30/08/2012 15:40:37 oracle.sysman.emcp.ParamsManager checkListenerStatusForDBCon
trol
WARNING: Error initializing SQL connection. SQL operations cannot be performed
30/08/2012 15:40:37 oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
30/08/2012 15:41:08 oracle.sysman.emcp.EMAgentConfig performDbcReconfiguration
INFO: Propagating E:\oracle\1020\database\svrodbp02_dbname2\sysman\config\emd.pr
operties to remote nodes ...
30/08/2012 15:41:08 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
30/08/2012 15:41:56 oracle.sysman.emcp.EMDBPostConfig performDbcReconfiguration
INFO: Database Control started successfully
30/08/2012 15:41:56 oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage

INFO:
****************  Current Configuration  ****************
 INSTANCE            NODE           DBCONTROL_UPLOAD_HOST
----------        ----------        ---------------------

dbname1           svrodbp01         SVRODBP01
dbname2           svrodbp02         SVRODBP02

Enterprise Manager configuration completed successfully
FINISHED EMCA

DOS>	 

Notice that DBCONTROL_UPLOAD_HOST is on each node which is what we want.
Test by running OEM from each node using the appropriate URL.