emca -deconfig/config dbcontrol db (二) for rac

As a reminder, DB Control 10.x.x.x includes 3 components:
- the dbconsole Management Service
- the dbconsole Management Agent
- the dbconsole Management Repository

集群环境的dbconsole重建和单机的不太一样,在“圣人”的指导下,终于做成功了:
1.检查RAC状态
[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.devdb.db   application    ONLINE    ONLINE    rac1       
ora....b1.inst application    ONLINE    ONLINE    rac1       
ora....b2.inst application    ONLINE    ONLINE    rac2       
ora....SM1.asm application    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora....SM2.asm application    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2  

2.Display dbcontrol删除前的状态
[oracle@rac1 ~]$ emca -displayConfig dbcontrol -cluster
****************  Current Configuration  ****************
 INSTANCE            NODE           DBCONTROL_UPLOAD_HOST
----------        ----------        ---------------------
devdb1            rac1              rac1.domain.com
devdb2            rac2              rac1.domain.com

3.删除dbconsole和repository FOR RAC
[oracle@rac1 ~]$ emca -deconfig dbcontrol db -repos drop -cluster
STARTED EMCA at Jun 3, 2009 3:13:23 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Enter the following information:
Database unique name: devdb
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
Jun 3, 2009 3:13:33 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/devdb/emca_2009-06-03_03-13-23-PM.log.
Jun 3, 2009 3:14:47 PM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Jun 3, 2009 3:39:29 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully

4.Display dbcontrol删除后的状态
[oracle@rac1 ~]$ emca -displayConfig dbcontrol -cluster
STARTED EMCA at Jun 3, 2009 11:22:53 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Enter the following information:
Database unique name: devdb
Do you wish to continue? [yes(Y)/no(N)]: y
Jun 3, 2009 11:22:56 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/devdb/emca_2009-06-03_11-22-53-AM.log.
Jun 3, 2009 11:23:02 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Database Control is not configured for this database.
Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/devdb/emca_2009-06-03_11-22-53-AM.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/devdb/emca_2009-06-03_11-22-53-AM.log for more details.

5.重建dbcontrol和资料库
[oracle@rac1 ~]$ emca -config dbcontrol db -repos create -cluster
STARTED EMCA at Jun 3, 2009 3:41:03 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Enter the following information:
Database unique name: devdb
The database devdb is already being monitored by central agent(s)
Database Control will monitor the exisiting targets
Do you wish to continue? [yes(Y)/no(N)]: y
Listener port number: 1521
Cluster name: crs
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/10.2.0/db_1
Database instance hostname ................ rac1.domain.com
Listener port number ................ 1521
Cluster name ................ crs
Database unique name ................ devdb
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ............... 
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Jun 3, 2009 3:41:27 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/devdb/emca_2009-06-03_03-41-03-PM.log.
Jun 3, 2009 3:41:36 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jun 3, 2009 4:31:00 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Jun 3, 2009 4:31:41 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_rac1_devdb1 to remote nodes ...
Jun 3, 2009 4:31:44 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_rac2_devdb2 to remote nodes ...
Jun 3, 2009 4:32:01 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /u01/app/oracle/product/10.2.0/db_1/rac1_devdb1 to remote nodes ...
Jun 3, 2009 4:33:18 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /u01/app/oracle/product/10.2.0/db_1/rac2_devdb2 to remote nodes ...
Jun 3, 2009 4:33:21 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Jun 3, 2009 4:36:35 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jun 3, 2009 4:41:51 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jun 3, 2009 4:41:57 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is
https://rac1.domain.com:1158/em <<<<<<<<<<<
Jun 3, 2009 4:42:07 PM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO:
****************  Current Configuration  ****************
 INSTANCE            NODE           DBCONTROL_UPLOAD_HOST
----------        ----------        ---------------------
 
devdb1            rac1              rac1.domain.com
devdb2            rac2              rac1.domain.com 
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jun 3, 2009 4:42:07 PM

6.em dbconsole的检查
[oracle@rac1 bdump]$ emctl status dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0 
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
https://rac1.domain.com:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/rac1_devdb1/sysman/log

漂亮的https://rac1.domain.com:1158/em/console界面就出来啦啦啦啦。。。

参考文献:
Subject:  How to manage DB Control 10.2 for RAC Database with emca
  Doc ID:  395162.1 Type:  BULLETIN
  Modified Date :  21-JUL-2008 Status:  PUBLISHED

请使用浏览器的分享功能分享到微信等