feidaodao
作者feidaodao·2011-10-29 23:44
系统运维工程师·GA

do drop and create emcontrol and Repository using emca

字数 8086阅读 7002评论 1赞 0
我的11gr2 RAC某节点的oem无法启动,提示oc4j not issue,于是决定在我的测试环境中drop掉并create controlfile and repos先。

----------
111119补充:可在线重建。在11gr2及后,emctl重建不会在置database到静默模式。
120306补充:emca会创建2个用户:dbsnmp,sysman。
---------------------------------------------------------------------------------------------------
删除
-------------------------------------------------------
当创建时提示如下信息:
ORA-20001: SYSMAN already exists..
说明Repository仍然存在,执行删除即可。
-------------------------------------------------------

[oracle@rac1 testdb]$ emca -deconfig dbcontrol db -repos drop -cluster

STARTED EMCA at Oct 29, 2011 8:09:46 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database unique name: testdb
Service name: testdb
Listener port number: 1158
Listener ORACLE_HOME [ /u01/grid-11.2/grid ]: 
Password for SYS user:  
Password for SYSMAN user:  
Do you wish to continue? [yes(Y)/no(N)]: Y
Oct 29, 2011 8:10:04 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/oracle/cfgtoollogs/emca/testdb/emca_2011_10_29_20_09_46.log.
Oct 29, 2011 8:10:06 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Oct 29, 2011 8:10:12 PM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
WARNING: Error initializing SQL connection. SQL operations cannot be performed
Oct 29, 2011 8:10:12 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Oct 29, 2011 8:15:17 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Oct 29, 2011 8:15:19 PM

------------------------------
创建
[oracle@rac1 testdb]$  emca -config dbcontrol db -repos create                    #single instance
[oracle@rac1 testdb]$  emca -config dbcontrol db -repos create -cluster        #RAC

STARTED EMCA at Oct 29, 2011 8:26:59 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database unique name: testdb
Service name: testdb
Listener port number: 1521
Listener ORACLE_HOME [ /u01/grid-11.2/grid ]: 
Password for SYS user:  
Password for DBSNMP user:  
Password for SYSMAN user:  
Cluster name: rac-cluster
Email address for notifications (optional): 
Outgoing Mail (SMTP) server for notifications (optional): 
ASM ORACLE_HOME [ /u01/grid-11.2/grid ]: 
ASM port [ 1521 ]: 
ASM username [ ASMSNMP ]:        
ASM user password:  
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/oracle/product/11.2

Database instance hostname ................ rac1.daodao.cn
Listener ORACLE_HOME ................ /u01/grid-11.2/grid
Listener port number ................ 1521
Cluster name ................ rac-cluster
Database unique name ................ testdb
Email address for notifications ............... 
Outgoing Mail (SMTP) server for notifications ............... 
ASM ORACLE_HOME ................ /u01/grid-11.2/grid
ASM port ................ 1521
ASM user role ................ SYSDBA
ASM username ................ ASMSNMP

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Oct 29, 2011 8:29:03 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/oracle/cfgtoollogs/emca/testdb/emca_2011_10_29_20_26_59.log.
Oct 29, 2011 8:29:08 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Oct 29, 2011 8:39:44 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Oct 29, 2011 8:40:00 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Oct 29, 2011 8:41:18 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Oct 29, 2011 8:41:18 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /u01/oracle/product/11.2/oc4j/j2ee/OC4J_DBConsole_rac1_testdb to remote nodes ...
Oct 29, 2011 8:41:21 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /u01/oracle/product/11.2/oc4j/j2ee/OC4J_DBConsole_rac2_testdb to remote nodes ...
Oct 29, 2011 8:41:29 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /u01/oracle/product/11.2/rac1_testdb to remote nodes ...
Oct 29, 2011 8:41:32 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /u01/oracle/product/11.2/rac2_testdb to remote nodes ...
Oct 29, 2011 8:41:35 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO:  Location /u01/oracle/product/11.2/EMStagePatches_testdb is not shared. Software library could not be configured. Provisioning archives will not be deployed. Please configure it manually. 
Oct 29, 2011 8:41:35 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Oct 29, 2011 8:42:05 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Oct 29, 2011 8:44:44 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Oct 29, 2011 8:44:44 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://rac1.daodao.cn:1158/em <<<<<<<<<<<
Oct 29, 2011 8:44:51 PM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO: 
****************  Current Configuration  ****************
 INSTANCE            NODE           DBCONTROL_UPLOAD_HOST
----------        ----------        ---------------------

testdb            rac1              rac1.daodao.cn
testdb            rac2              rac1.daodao.cn


Oct 29, 2011 8:44:51 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/oracle/product/11.2/rac1_testdb/sysman/config/emkey.ora.   Please 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 29, 2011 8:44:51 PM

备份emkey.ora吧

创建完成后,oem已经启动了

[oracle@rac1 testdb]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0 
Copyright (c) 1996, 2009 Oracle Corporation.  All rights reserved.
https://rac1.daodao.cn:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running. 
------------------------------------------------------------------
Logs are generated in directory /u01/oracle/product/11.2/rac1_testdb/sysman/log

OK
go https://rac1.daodao.cn:1158/em/console/aboutApplication,and enjory it!
=====================================================================
附:
----------------------------------------------------------
service name:
show parameter service_name;

cluster name:
$CRS_HOME/bin/cemutlo -n 

if u do not remember the dbsnmp,asmsnmp password,do:
su - oracle
sqlplus / as sysdba
alter user dbsnmp identified by dbsnmp;

su - grid
sqlplus / as sysasm
alter user asmsnmp identified by asmsnmp;

The emca log directory:
/u01/oracle/cfgtoollogs/emca/<service name>/
----------------------------------------------------------

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

0

添加新评论1 条评论

myguangzhoumyguangzhou技术经理Uniwise
2012-02-13 22:30
11gr2的还好,换了10GR2.04版本,非得打补丁,否则EM无法启动
Ctrl+Enter 发表

作者其他文章

X社区推广