在RAC中重建EM(转)
??? 今天一項目要求對數據庫進行巡檢,在巡檢的過程中發現EM不能使用,之前雖然在這個項目上也動過幾次手,但沒想過要去用EM,用戶一直都是用9i下的OEM工具進行數據庫管理的。用戶在樓下的一家單位看人家用了WEB的EM后感覺不錯,希望我順便弄一下。
??? 之前也在其它項目中弄過,于是大膽的開始做,但做了兩次才成功,第一次是集群名錄入錯了,數據庫是別人裝的,用了默認的CRS當集群名,而我錄成了數據庫名,結果是很奇怪,用emctl status dbconsole檢查老說EM沒啟動起來,但實際上又可以登錄,但注意到實例那里一個都沒顯示,但管理頁的的表空間管理、用戶管理等這些好像又正常。后來懷疑到會不會是集群名錄錯了,于是又去查怎么查集群名,ocrconfig -showbackup就可以查到,最后的CRS就是集群名。但后面發現端口都被占用了,只好改了端口,改成1159了。
??? 參考資料:http://space.itpub.net/17997/viewspace-616938
??? 詳細過程如下
$ ocrconfig -showbackup
acc02???? 2011/08/04 12:03:01???? /oracle/product/10.2.0/crs_1/cdata/crs
acc02???? 2011/08/04 08:03:01???? /oracle/product/10.2.0/crs_1/cdata/crs
acc02???? 2011/08/04 04:03:01???? /oracle/product/10.2.0/crs_1/cdata/crs
acc02???? 2011/08/02 20:02:59???? /oracle/product/10.2.0/crs_1/cdata/crs
acc02???? 2011/07/27 08:02:52???? /oracle/product/10.2.0/crs_1/cdata/crs
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Aug 4 13:26:27 2011
Copyright (c) 1982, 2007, Oracle.? All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
sys@ACC> drop user sysman cascade;
User dropped.
sys@ACC> drop user MGMT_VIEW cascade;
User dropped.
sys@ACC> drop role MGMT_USER;
Role dropped.
sys@ACC> drop public synonym MGMT_TARGET_BLACKOUTS;
Synonym dropped.
sys@ACC> drop public synonym SETEMVIEWUSERCONTEXT;
Synonym dropped.
sys@ACC> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
$ emca -config dbcontrol db -repos create -cluster
STARTED EMCA at Aug 4, 2011 1:28:55 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: acc
Database Control is already configured for the database acc
You have chosen to configure Database Control for managing the database acc
This will remove the existing configuration and the default settings and perform a fresh configuration
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 ................ /oracle/product/10.2.0/db_1
Database instance hostname ................ acc01
Listener port number ................ 1521
Cluster name ................ crs
Database unique name ................ acc
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Aug 4, 2011 1:29:52 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/product/10.2.0/db_1/cfgtoollogs/emca/acc/emca_2011-08-04_01-28-55-PM.log.
Aug 4, 2011 1:29:53 PM oracle.sysman.emcp.util.PortManager isPortInUse
WARNING: Specified port 5540 is already in use.
Aug 4, 2011 1:29:53 PM oracle.sysman.emcp.util.PortManager isPortInUse
WARNING: Specified port 5520 is already in use.
Aug 4, 2011 1:29:53 PM oracle.sysman.emcp.util.PortManager isPortInUse
WARNING: Specified port 1158 is already in use.
Aug 4, 2011 1:29:53 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Aug 4, 2011 1:30:04 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 4, 2011 1:31:54 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Aug 4, 2011 1:31:58 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_acc01_acc1 to remote nodes ...
Aug 4, 2011 1:31:59 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_acc02_acc2 to remote nodes ...
Aug 4, 2011 1:32:03 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /oracle/product/10.2.0/db_1/acc01_acc1 to remote nodes ...
Aug 4, 2011 1:32:05 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /oracle/product/10.2.0/db_1/acc02_acc2 to remote nodes ...
Aug 4, 2011 1:32:06 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Cannot start Database Control. The following ports are already in use: [EM agent port:3938].
Refer to the log file at /oracle/product/10.2.0/db_1/cfgtoollogs/emca/acc/emca_2011-08-04_01-28-55-PM.log for more details.
Could not complete the configuration. Refer to the log file at /oracle/product/10.2.0/db_1/cfgtoollogs/emca/acc/emca_2011-08-04_01-28-55-PM.log for more details.
$ emctl stop dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0?
Copyright (c) 1996, 2007 Oracle Corporation.? All rights reserved.
http://acc01:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
Cannot determine Oracle Enterprise Manager 10g Database Control process. /oracle/product/10.2.0/db_1/acc01_acc1/emctl.pid does not exist.
$ ps -ef|grep dbconsole | awk ' { print $2} ' | xargs kill -9
kill: 193128: 0509-015 The specified process does not exist.
$ ps -ef|grep emagent (selectively remove the dbconsole's emagent process)
ksh: 0403-057 Syntax error: `(' is not expected.
$ emca -reconfig ports -cluster -DBCONTROL_HTTP_PORT 1159 -AGENT_PORT 3939 -RMI_PORT 5522 -JMS_PORT 5542
STARTED EMCA at Aug 4, 2011 1:35:21 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: acc
Do you wish to continue? [yes(Y)/no(N)]: y
Aug 4, 2011 1:35:29 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/product/10.2.0/db_1/cfgtoollogs/emca/acc/emca_2011-08-04_01-35-21-PM.log.
Aug 4, 2011 1:35:31 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Aug 4, 2011 1:36:17 PM oracle.sysman.emcp.EMDBCConfig performReconfiguration
INFO: Propagating /oracle/product/10.2.0/db_1/acc01_acc1/sysman/config/emoms.properties,/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_acc01_acc1/config/http-web-site.xml,/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_acc01_acc1/config/rmi.xml,/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_acc01_acc1/config/jms.xml to remote nodes ...
Aug 4, 2011 1:36:18 PM oracle.sysman.emcp.EMDBCConfig performReconfiguration
INFO: Propagating /oracle/product/10.2.0/db_1/acc02_acc2/sysman/config/emoms.properties,/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_acc02_acc2/config/http-web-site.xml,/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_acc02_acc2/config/rmi.xml,/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_acc02_acc2/config/jms.xml to remote nodes ...
Aug 4, 2011 1:36:20 PM oracle.sysman.emcp.EMAgentConfig performReconfiguration
INFO: Propagating /oracle/product/10.2.0/db_1/acc01_acc1/sysman/config/emd.properties to remote nodes ...
Aug 4, 2011 1:36:20 PM oracle.sysman.emcp.EMAgentConfig performReconfiguration
INFO: Propagating /oracle/product/10.2.0/db_1/acc02_acc2/sysman/config/emd.properties to remote nodes ...
Aug 4, 2011 1:36:21 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Aug 4, 2011 1:38:32 PM oracle.sysman.emcp.EMDBPostConfig performReconfiguration
INFO: Database Control started successfully
Aug 4, 2011 1:38:32 PM oracle.sysman.emcp.EMDBPostConfig performReconfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://acc01:1159/em <<<<<<<<<<<
Aug 4, 2011 1:38:32 PM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO:
****************? Current Configuration? ****************
INSTANCE??????????? NODE?????????? DBCONTROL_UPLOAD_HOST
----------??????? ----------??????? ---------------------
acc1????????????? acc01???????????? acc01
acc2????????????? acc02???????????? acc01
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 4, 2011 1:38:32 PM
$ emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0?
Copyright (c) 1996, 2007 Oracle Corporation.? All rights reserved.
http://acc01:1159/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory /oracle/product/10.2.0/db_1/acc01_acc1/sysman/log
轉載于:https://blog.51cto.com/rainzl/1139860
總結
以上是生活随笔為你收集整理的在RAC中重建EM(转)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql 设置编码
- 下一篇: 杭哥试用过的精品软件推荐:PDF转pow