Home > Oracle, RDBMS > How to (re)configure Oracle Enterprise Manager.

How to (re)configure Oracle Enterprise Manager.

When you’ve installed Oracle Database 10g or 11g, you can’t change the Windows hostname and/or IP address without reinstalling Oracle Enterprise Manager.
These are the steps to reconfigure Oracle EM:

1. Change the %ORACLE_HOME%\network\admin\listener.ora file from an IP address to a machine name.

2. Change the %ORACLE_HOME%\network\admin\tnsnames.ora file from an IP address to a machine name.

3. Change the C:\WINDOWS\System32\drivers\etc\hosts file by adding this line beneath the default localhost line (for the new hostname value):

127.0.0.1       localhost
192.168.111.11  new-hostname

Don’t forget to add the empty line after the last line (sometimes Windows can’t read the last line).

4. Change the Windows hostname.

5. Reboot the machine, and then drop the Oracle EM configuration with the following commands:

set ORACLE_SID=orcl
emca -deconfig dbcontrol db -repos drop

6. You’ll receive the following prompts, enter the Oracle SID, port number and all passwords:

STARTED EMCA at Jul 13, 2008 8:26:42 AM
EM Configuration Assistant, Version 11.1.0.5.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
 
Enter the following information:
Database SID: orcl
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: y

7. You should then drop the SYSMAN user manually just in case. If the SYSMAN schema hasn’t been droped, then you’ll raise an error when you try to recreate the EM:

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 the user and dependent on version a few other objects, like:

DROP USER sysman CASCADE;
DROP PUBLIC SYNONYM setemviewusercontext;
DROP ROLE mgmt_user;
DROP PUBLIC SYNONYM mgmt_target_blackouts;
DROP USER mgmt_view;

8. You can then create the EM environment with the following command:

emca -config dbcontrol db -repos create

9. Again, you’ll receive the following prompts, enter the Oracle SID, port number and all passwords:

STARTED EMCA at Jul 13, 2008 8:28:48 AM
EM Configuration Assistant, Version 11.1.0.5.0 Production
Copyright (c) 2003, 2005, Oracle.  ALL rights reserved.
 
Enter the following information:
DATABASE SID: orcl
Listener port NUMBER: 1521
Password FOR SYS USER:
Password FOR DBSNMP USER:
Password FOR SYSMAN USER:
Password FOR SYSMAN USER: Email address FOR notifications (optional):
Outgoing Mail (SMTP) server FOR notifications (optional):
-----------------------------------------------------------------
 
You have specified the following settings
 
DATABASE ORACLE_HOME ................ C:\app\Administrator\product\11.1.0\db_1
 
LOCAL hostname ................ new-hostname
Listener port NUMBER ................ 1521
DATABASE SID ................ orcl
Email address FOR notifications ...............
Outgoing Mail (SMTP) server FOR notifications ...............
 
-----------------------------------------------------------------
 
Do you wish TO continue? [yes(Y)/no(N)]: y

When you have a problem with creating the Oracle EM via command line (you’ve got the insufficient privileges error) try to use the Database Configuration Assistant.

That’s should be all.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: