將Oracle DB主機 hostname and ip address 修改之後,database and listener可以正常啟動。
但是 DB Control/DB Console (OEM) 無法啟動,錯誤訊息如下:
[oracle@testdb88 ~]$ emctl start dbconsole
OC4J Configuration issue. /u01/app/oracle/product/11.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_testdb88_DB11G not found.
1) Set $ORACLE_HOSTNAME to the old hostname:
[oracle@testdb88 ~]$ export ORACLE_HOSTNAME=oradb02
2) De-configure the old DB Console:
[oracle@testdb88 ~]$ $ORACLE_HOME/bin/emca -deconfig dbcontrol db
STARTED EMCA at Oct 18, 2019 4:39:26 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Enter the following information:
Database SID: DB11G
Do you wish to continue? [yes(Y)/no(N)]: Y
Oct 18, 2019 4:39:33 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/DB11G/emca_2019_10_18_16_39_26.log.
Oct 18, 2019 4:39:33 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
Enterprise Manager configuration completed successfully
FINISHED EMCA at Oct 18, 2019 4:39:36 PM
3) Un-set $ORACLE_HOSTNAME:
4) Create the new DB Console:
[oracle@testdb88 ~]$ $ORACLE_HOME/bin/emca -config dbcontrol db -repos recreate
STARTED EMCA at Oct 18, 2019 4:42:21 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Enter the following information:
Database SID: DB11G
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/db_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 ................ /u01/app/oracle/product/11.2.0/db_1
Local hostname ................ testdb88
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/db_1
Listener port number ................ 1521
Database SID ................ DB11G
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Oct 18, 2019 4:43:34 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/DB11G/emca_2019_10_18_16_42_21.log.
Oct 18, 2019 4:43:35 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Oct 18, 2019 4:44:36 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Oct 18, 2019 4:44:37 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Oct 18, 2019 4:48:05 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Oct 18, 2019 4:48:07 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Oct 18, 2019 4:48:53 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Oct 18, 2019 4:48:55 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Oct 18, 2019 4:49:01 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Oct 18, 2019 4:49:01 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Oct 18, 2019 4:49:34 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Oct 18, 2019 4:49:34 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://testdb88:1158/em <<<<<<<<<<<
Oct 18, 2019 4:49:36 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************ WARNING ************************
Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted. The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0/db_1/testdb88_DB11G/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.
***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Oct 18, 2019 4:49:36 PM
4) 確認 dbconsole已經正常啟動:
[oracle@testdb88 ~]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved.
https://testdb88:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/testdb88_DB11G/sysman/log