In versions prioor to 11g Grid Control we had to update the
emoms.properties file in case we needed to modify the Listener Port
used to connect to the repository database. But in 11g OEM, it has been
changed and we now have to use the emctl command.
After changing the hostname or IP address, EM dbconsole port, instance
SID,
or even TZ settings, EM is going to
fail.
Example to Re-Configure to
another port:
Using "emca" you can
reconfigure eg. the port number to 1150:
Code:
emca -reconfig ports -DBCONTROL_HTTP_PORT 1150
To
change
the
listener
port or the hostname of the Repository Database we
now have to use the emctl config oms command as shown below.
emctl
config oms -store_repos_details -repos_port 1528 -repos_sid emrep
-repos_host wintest01 -repos_user SYSMAN -repos_pwd oracle11g
To check what are the OMS Repository details we can use the emctl
config oms -list_repos_details command.
For example –
D:\Oracle\Product\Middleware\oms11g\BIN>emctl config oms -list_repos_details
Oracle Enterprise Manager 11g Release 1 Grid Control
Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
Repository Connect Descriptor :
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=wintest01)(PORT=1528)))(CONNECT_DATA=(SID=emrep)))
Repository Host : wintest01
Repository Port : 1528
Repository SID : emrep
Repository User : SYSMAN
The emoms.properties file actually has these lines ….
###########################################################################################################
##################################### README
###########################################
###########################################################################################################
#NOTE
#1. EMOMS(LOGGING).PROPERTIES FILE HAS BEEN REMOVED
#2. OMS PROPERTIES / LOGGING PROPERTIES SHOULD BE MODIFIED USING EMCTL
GET/SET/DELETE/LIST PROPERTY COMMANDS
#3. The USAGE OF EMCTL GET/SET/DELETE/LIST PROPERTY IS PROVIDED BELOW,
BUT
# FOR LATEST UPDATED COMMANDS PLEASE CHECK EMCTL HELP MESSAGE
In more serious
cases there's only one solution - reinstallation
Check the status:
emca
-deconfig
dbcontrol
1. Change the %ORACLE_HOME%\network\admin\listener.ora
file from an IP number to machine name.
2. Change the %ORACLE_HOME%\network\admin\tnsnames.ora file from an IP
number 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
10.10.10.10 mybox mybox.acme.com
4. Change the Windows hostname by navigating: Start > Control Panel
> System (classic view) from the random assignment of VMWare.
5. Reboot the machine, and then drop the em configuration with the
following commands:
set ORACLE_SID=OEM
set ORACLE_UNQNAME=OEM
Code:
emca -deconfig dbcontrol db -repos drop
You’ll
receive
the
following prompts, enter the Oracle SID and Port number
without double quotes but you must enter all passwords with double
quotes (at least in Oracle Database 11g):
STARTED EMCA at Jan 25, 2011 8:05:55 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: OEM
Listener port number: 1521
Listener ORACLE_HOME [ C:\oracle\app\product\11.2.0\dbhome_1 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: y
Then delete DB Control Repository Objects
manually from SQLPlus:
Code:
DROP USER sysman CASCADE;
DROP PUBLIC SYNONYM setemviewusercontext;
DROP ROLE mgmt_user;
DROP PUBLIC SYNONYM mgmt_target_blackouts;
DROP USER mgmt_view CASCADE;
Now, you can try again "emca" with create or recreate option.
Code:
emca -config dbcontrol db -repos create
Again, you’ll receive the following prompts, enter the Oracle SID and Port number without double quotes
STARTED EMCA at Jan 26, 2011 2:21:13 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: OEM
Listener port number: 1521
Listener ORACLE_HOME [ C:\oracle\app\product\11.2.0\dbhome_1 ]:
Password for SYS user:
Password for DBSNMP 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:\oracle\app\product\11.2.0\dbhome_1
Local hostname ................ mybox
Listener ORACLE_HOME ................ C:\oracle\app\product\11.2.0\dbhome_1
Listener port number ................ 1521
Database SID ................ OEM
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ..............
Do you wish to continue? [yes(Y)/no(N)]: y
------------------------------------------------------------------
After some time (20 minutes or so), you (may) get:
INFO: Error securing Database Control, Database Control has been brought up in non-secure mode. To secure the Database Control execute the following command(s):
1) Set the environment variable ORACLE_SID to OEM
2) C:\oracle\app\product\11.2.0\dbhome_1\bin\emctl.bat stop dbconsole
3) C:\oracle\app\product\11.2.0\dbhome_1\bin\emctl.bat config emkey -repos -sysman_pwd < Password for SYSMAN user >
4) C:\oracle\app\product\11.2.0\dbhome_1\bin\emctl.bat secure dbconsole -sysman_pwd < Password for SYSMAN user >
5) C:\oracle\app\product\11.2.0\dbhome_1\bin\emctl.bat start dbconsole
To secure Em Key, run C:\oracle\app\product\11.2.0\dbhome_1\bin\emctl.bat config emkey -remove_from_repos -sysman_pwd < Password for SYSMAN user >
Jan 26, 2011 2:37:54 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jan 26, 2011 2:39:10 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jan 26, 2011 2:39:10 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://DAFGWin32bitDBA:1158/em <<<<<<<<<<<
Error securing Database Control, Database Control has been brought up in non-secure mode. To secure the Database Control execute the following command(s):
1) Set the environment variable ORACLE_SID to OEM
2) C:\oracle\app\product\11.2.0\dbhome_1\bin\emctl.bat stop dbconsole
3) C:\oracle\app\product\11.2.0\dbhome_1\bin\emctl.bat config emkey -repos -sysman_pwd < Password for SYSMAN user >
4) C:\oracle\app\product\11.2.0\dbhome_1\bin\emctl.bat secure dbconsole -sysman_pwd < Password for SYSMAN user >
5) C:\oracle\app\product\11.2.0\dbhome_1\bin\emctl.bat start dbconsole
To secure Em Key, run C:\oracle\app\product\11.2.0\dbhome_1\bin\emctl.bat config emkey -remove_from_repos -sysman_pwd < Password for SYSMAN user >
Software library configuration failed. Provisioning archives are deployed. Please configure it manually.
Checking which port is correct:
Code:
cat $ORACLE_HOME/install/portlist.ini
# eg.
# Enterprise Manager Console HTTP Port (orcl) = 1158
or
c:\> type C:\Oracle\app\product\11.2.0\dbhome_1\install\portlist.ini
Enterprise Manager Console HTTP Port (OEM) = 1158
Enterprise Manager Agent Port (OEM) = 3938
Calling EM in browser:
Code:
http://[hostname]:1158/em