1-Introduction:
One for the client requirement, is to configure 2 networks.
One connects to the application and the second for db console,and database connections.
The first needs to be configured on the listener_1 on port 1521 and IP: 192.168.1.10.
The second needs to be configured on the listener_2 on port 1522, and IP: 192.168.1.11.
I installed the software and the 11gR2 database using DBA method. I have choose to get DB console configured automatically.
But, now i need to reconfigure DB console with the new IP and the port 1522.
In this post, I will show how to get this modified in 2 minutes.
2- Reconfigure OEM DB console to listen to LISTENER_2, port 1522, and Network 2 IP:
First, I am purging the logs, to get a clean log file:
You will get the log file located under :
/opt/app/oracle/product/11.2.0/db_1/HOSTNAME_SID/sysman/log
-bash-3.2$ cd /opt/app/oracle/product/11.2.0/db_1/srv05_db01/sysman/log -bash-3.2$ ls -rtl total 4144 -rw-r----- 1 oracle oinstall 0 Jun 25 14:30 emdctl.log -rw-r----- 1 oracle oinstall 0 Jun 25 14:31 patchAgtStPlugin.log -rw-r----- 1 oracle oinstall 0 Jun 25 14:31 emagentfetchlet.trc -rw-r----- 1 oracle oinstall 0 Jun 25 14:31 emagentfetchlet.log drwxr----- 2 oracle oinstall 4096 Jun 25 14:31 pafLogs -rw-r----- 1 oracle oinstall 10124 Jun 25 14:31 secure.log -rw-r----- 1 oracle oinstall 0 Jun 25 14:31 nfsPatchPlug.log -rw-r----- 1 oracle oinstall 435 Jun 25 15:47 emctl.msg -rw-r----- 1 oracle oinstall 7988 Jun 30 15:13 emagent.log -rw-r----- 1 oracle oinstall 579802 Jun 30 15:13 emagent.trc -rw-r----- 1 oracle oinstall 4256 Jun 30 15:13 emdctl.trc -rw-r----- 1 oracle oinstall 134341 Jun 30 15:13 emdb.nohup -rw-r----- 1 oracle oinstall 59969 Jun 30 15:14 emagent_perl.trc -rw-r----- 1 oracle oinstall 1701336 Jun 30 15:14 emoms.trc -rw-r----- 1 oracle oinstall 1701336 Jun 30 15:14 emoms.log -bash-3.2$ mv emagent.log emagent.log.OLD
Stop the DB console:
-bash-3.2$ emctl stop dbconsole Oracle Enterprise Manager 11g Database Control Release 11.2.0.2.0 Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved. https://srv05:1158/em/console/aboutApplication Stopping Oracle Enterprise Manager 11g Database Control ... ... Stopped. -bash-3.2$
Change the file: $ORACLE_HOME/HOSTNAME_SID/sysman/emd/targets.xml and replace the occurences of the port 1521 to 1522.
Modify the machine name by the new IP of the Network 2.
<Targets AGENT_TOKEN="c45bffd82bb3662d9b30f8f6ca31da0670dd6da3">
<Target TYPE="oracle_emd" NAME="srv05:3938"/>
<Target TYPE="host" NAME="srv05"/>
<Target TYPE="oracle_database" NAME="db01.example.com">
<Property NAME="MachineName" VALUE="192.168.1.11"/>
<Property NAME="Port" VALUE="1522"/>
<Property NAME="SID" VALUE="db01"/>
<Property NAME="OracleHome" VALUE="/opt/app/oracle/product/11.2.0/db_1"/>
<Property NAME="UserName" VALUE="e78983969c2f9cac" ENCRYPTED="TRUE"/>
<Property NAME="password" VALUE="21b1b88f5c4bae752368b96a217e61e6" ENCRYPTED="TRUE"/>
</Target>
<Target TYPE="oracle_listener" NAME="LISTENER_srv05">
<Property NAME="Machine" VALUE="192.168.1.11"/>
<Property NAME="LsnrName" VALUE="LISTENER_2"/>
<Property NAME="Port" VALUE="1522"/>
<Property NAME="OracleHome" VALUE="/opt/app/oracle/product/11.2.0/db_1"/>
<Property NAME="ListenerOraDir" VALUE="/opt/app/oracle/product/11.2.0/db_1/network/admin"/>
</Target>
</Targets>
Do the same, and change the occurences of port 1521, and the emdRepConnectDescriptor with the new IP, in the file:
$ORACLE_HOME/HOSTNAME_SID/sysman/config/emoms.properties
#Thu Jun 30 15:13:55 CEST 2011 oracle.sysman.emSDK.svlt.ConsoleServerName=srv05\:1158_Management_Service oracle.sysman.eml.mntr.emdRepPwd=57a0d040eeb1de8e45253050517d2140 emdrep.ping.pingCommand=/bin/ping -c 3 -w 30 <hostname> em_oob_shutdown=false LargeRepository=false oracle.sysman.eml.mntr.emdRepPort=1522 oracle.sysman.eml.mntr.emdRepDBName=db01.example.com EMD_URL=https\://srv05\:3938/emd/main em_email_address=%EM_EMAIL_ADDRESS% oracle.sysman.eml.mntr.emdRepPwdSeed=7079198600277698400 oracle.sysman.emSDK.svlt.ConsoleMode=standalone em_oob_crash=false em.oms.dumpModules=omsThread,repos oracle.sysman.emRep.dbConn.statementCacheSize=50 oracle.sysman.db.isqlplusUrl=http\://srv05.example.com\:/isqlplus/dynamic em_oob_startup=false oracle.sysman.emSDK.svlt.ConsoleServerPort=1158 oracle.sysman.eml.mntr.emdRepRAC=FALSE em_from_email_address=%EM_FROM_EMAIL_ADDRESS% oracle.sysman.eml.mntr.emdRepPwdEncrypted=TRUE oracle.sysman.emSDK.svlt.ConsoleServerHost=srv05 oracle.sysman.db.isqlplusWebDBAUrl=http\://srv05.example.com\:/isqlplus/dba/dynamic oracle.sysman.emSDK.svlt.ConsoleServerHTTPSPort=1158 oracle.sysman.eml.mntr.emdRepDBID=773190290 em_email_gateway=%EM_EMAIL_GATEWAY% oracle.sysman.eml.mntr.emdRepSID=db01 oracle.sysman.eml.mntr.emdRepServer=srv05 oracle.sysman.emSDK.sec.ReuseLogonPassword=true oracle.sysman.eml.mntr.emdRepConnectDescriptor=(DESCRIPTION\=(ADDRESS_LIST\=(ADDRESS\=(PROTOCOL\=TCP)(HOST\=192.168.1.11)(PORT\=1522)))(CONNECT_DATA\=(SERVICE_NAME\=db01.example.com))) oracle.sysman.emkeyfile=/opt/app/oracle/product/11.2.0/db_1/srv05_db01/sysman/config/emkey.ora oracle.sysman.eml.mntr.emdRepUser=SYSMAN em.ip.ui.enable=true oracle.sysman.emSDK.svlt.PublicServletEnabled=true ~
Now let’s start the DB Console:
-bash-3.2$ emctl start dbconsole Oracle Enterprise Manager 11g Database Control Release 11.2.0.2.0 Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved. https://srv05:1158/em/console/aboutApplication Starting Oracle Enterprise Manager 11g Database Control .... started. ------------------------------------------------------------------ Logs are generated in directory /opt/app/oracle/product/11.2.0/db_1/srv05_db01/sysman/log -bash-3.2$
We check the status of the DBconsole:
-bash-3.2$ emctl status dbconsole Oracle Enterprise Manager 11g Database Control Release 11.2.0.2.0 Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved. https://srv05:1158/em/console/aboutApplication Oracle Enterprise Manager 11g is running. ------------------------------------------------------------------ Logs are generated in directory /opt/app/oracle/product/11.2.0/db_1/srv05_db01/sysman/log -bash-3.2$
When we check the emagent.log file, we see that the EMAgent is started successfully.
-bash-3.2$ cat emagent.log ….. ….. … 2011-06-30 15:22:17,433 Thread-3753176448 EMAgent started successfully (00702)
Finally, try to connect to the URL. In my case:
https://srv05:1158/em/console/aboutApplication
Hope it helps,
Wissem
This is awesome! Thank you so much!