Archive

Posts Tagged ‘oem’

Oracle – Reconfigure Oracle Enterprise Manager

November 18, 2010 2 comments

If you have already created your database and not configured it with Enterprise Manager, or you have configured your database with Enterprise Manager but for some reason need to reconfigure, you can do this from the command line using EMCA.

If you have already configured Enterprise Manager before and wish to reconfigure then you need to drop a couple of public synonyms, roles and users on the database first.

Drop Users

SQL>  drop user mgmt_view cascade;
User dropped
SQL>  drop user sysman cascade;
User dropped

NB.  If you don’t drop the sysman user you receive the following error in the log file:

CONFIG: ORA-20001: SYSMAN already EXISTS..
ORA-06512: at line 17 oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-20001: SYSMAN already EXISTS..
ORA-06512: at line 17

Drop Public Synonyms

SQL>  drop public synonym setenviewusercontext;
Public synonym dropped
SQL>  drop public synonym mgmt_target_blackouts;
Public synonym dropped

Drop Roles

SQL>  drop role mgmt_user; Role dopped

Create the Enterprise Manager environment

The enterprise manager environment can then be created using EMCA –config

$  emca –config dbcontrol db –repos create

EMCA will prompt for the following information:

Database SID: Listener port number:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notification (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME:
ASM SID:
ASM port:
ASM user role:
ASM username:
ASM user password:

It is possible to use an input file for the EMCA parameters using the –respFile argument to specify an input file. The input file must be in a format similar to:

PORT=1510 SID=OASPRAC DBSNMP_PWD=password SYSMAN_PWD=password

An example of using an input file can be seen below:

./emca -config dbcontrol db -respFile input_file_path

EMCA and RAC Databases

If you have a RAC database then dbconsole needs to be configured on each instance of the cluster. By default Database Control Console is only configured on the local node, however the Enterprise Manager agent is started on all other nodes.

-cluster nodename

arguments should be used for RAC databases

Sample Output for Reconfiguring DBControl for a Single-Node RAC

merlin:oracle@OASPRAC1 > emca -config dbcontrol db -repos create
STARTED EMCA at Nov 18, 2010 4:02:25 PM EM Configuration Assistant, Version 10.2.0.1.0 Production Copyright (c) 2003, 2005, Oracle.
All rights reserved.
Enter the following information:
Database SID:
OASPRAC1 Database Control is already configured for the database OASPRAC1
You have chosen to configure Database Control for managing the database OASPRAC1
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: 1510
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /u01/oracle/ora102 ]: /u01/oracle/asm102
ASM SID [ +ASM ]:
ASM port [ 1510 ]:
ASM user role [ SYSDBA ]:
ASM username [ SYS ]:
ASM user password: -----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /u01/oracle/ora102
Database hostname ................ merlin.smhsct.local
Listener port number ................ 1510
Database SID ................ OASPRAC1
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
ASM ORACLE_HOME ................ /u01/oracle/asm102
ASM SID ................ +ASM
ASM port ................ 1510
ASM user role ................ SYSDBA
ASM username ................ SYS -----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Nov 18, 2010 4:02:59 PM
oracle.sysman.emcp.EMConfig perform INFO:
This operation is being logged at /u01/oracle/ora102/cfgtoollogs/emca/OASPRAC/emca_2010-11-18_04-02-25-PM.log.
Nov 18, 2010 4:02:59 PM
oracle.sysman.emcp.util.DBControlUtil stopOMS INFO:
Stopping Database Control (this may take a while) ...
Nov 18, 2010 4:03:01 PM
oracle.sysman.emcp.EMReposConfig createRepository INFO:
Creating the EM repository (this may take a while) ...
Nov 18, 2010 4:04:33 PM oracle.sysman.emcp.EMReposConfig invoke INFO:
Repository successfully created Nov 18, 2010 4:04:36 PM
oracle.sysman.emcp.util.DBControlUtil secureDBConsole INFO:
Securing Database Control (this may take a while) ...
Nov 18, 2010 4:13:14 PM
oracle.sysman.emcp.util.DBControlUtil secureDBConsole INFO:
Database Control secured successfully.
Nov 18, 2010 4:13:14 PM
oracle.sysman.emcp.util.DBControlUtil startOMS INFO:
Starting Database Control (this may take a while) ...
Nov 18, 2010 4:14:49 PM
oracle.sysman.emcp.EMDBPostConfig performConfiguration INFO:
Database Control started successfully
Nov 18, 2010 4:14:49 PM
oracle.sysman.emcp.EMDBPostConfig performConfiguration INFO:
>>>>>>>>>>>
The Database Control URL is https://merlin.smhsct.local:5501/em
<<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at Nov 18, 2010 4:14:49 PM

Advertisements