手工配置OEM

1、删除OEM
[oracle@strong ~]$ emca -deconfig dbcontrol db -repos drop 
                              

STARTED EMCA at Jul 30, 2017 6:09:06 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: orcl
Listener port number: 1521
Password for SYS user:  
Password for SYSMAN user:  

----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Jul 30, 2017 6:09:39 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2017_07_30_06_09_05.log.
Jul 30, 2017 6:09:40 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Jul 30, 2017 6:10:03 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Jul 30, 2017 6:11:29 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jul 30, 2017 6:11:32 AM
[oracle@strong ~]$ 
2、重新安装OEM
[oracle@strong ~]$ export ORACLE_UNQNAME=orcl
[oracle@strong ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Sun Jul 30 06:15:39 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> conn / as sysdba
Connected.
SQL> alter user dbsnmp identified by system;

User altered.
[oracle@strong ~]$ emca -config dbcontrol db -repos create;

STARTED EMCA at Jul 30, 2017 6:25:52 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: orcl
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/dbhome_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/dbhome_1

Local hostname ................ strong.oracle.com
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/dbhome_1
Listener port number ................ 1521
Database SID ................ orcl
Email address for notifications ............... 
Outgoing Mail (SMTP) server for notifications ............... 

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Jul 30, 2017 6:26:44 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2017_07_30_06_25_52.log.
Jul 30, 2017 6:26:44 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jul 30, 2017 6:30:15 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Jul 30, 2017 6:30:21 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Jul 30, 2017 6:31:19 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Jul 30, 2017 6:31:22 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Jul 30, 2017 6:32:33 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Jul 30, 2017 6:32:33 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jul 30, 2017 6:33:15 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jul 30, 2017 6:33:15 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://strong.oracle.com:1158/em <<<<<<<<<<<
Jul 30, 2017 6:33:28 AM 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/dbhome_1/strong.oracle.com_orcl/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 Jul 30, 2017 6:33:28 AM
[oracle@strong ~]$ 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://strong.oracle.com:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running. 
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/strong.oracle.com_orcl/sysman/log 
[oracle@strong ~]$ 
3、异常情况下重新安装EM
(1)删除原有信息
SQL> drop role mgmt_user;
drop user mgmt_view cascade;
drop user sysman cascade;

drop public synonym MGMT_TARGET_BLACKOUTS;
drop public synonym SETEMVIEWUSERCONTEXT;
drop public synonym MGMT_AVAILABILITY;
drop public synonym MGMT_CURRENT_AVAILABILITY;
drop public synonym MGMT_SEVERITY_OBJ;
(2)重建EM
[oracle@strong ~]$ emca -config dbcontrol db -repos create
如果失败,用下面的语句:
[oracle@strong ~]$ emca -config dbcontrol db -repos recreate
查看状态
[oracle@strong ~]$ emctl status dbconsole
emca常用命令:
[oracle@strong ~]$ emctl -h

创建一个EM资料库
emca -repos create
 
重建一个EM资料库
emca -repos recreate
 
删除一个EM资料库
emca -repos drop
 
配置数据库的 Database Control
emca -config dbcontrol db
 
删除数据库的 Database Control配置
emca -deconfig dbcontrol db
 
重新配置db control的端口,默认端口在1158
emca -reconfig ports
emca -reconfig ports -dbcontrol_http_port 1160
emca -reconfig ports -agent_port 3940
 
先设置ORACLE_SID环境变量后,启动EM console服务
emctl start dbconsole
先设置ORACLE_SID环境变量后,停止EM console服务
emctl stop dbconsole
先设置ORACLE_SID环境变量后,查看EM console服务的状态
 
 配置dbconsole的步骤
emca -repos create
emca -config dbcontrol db
emctl start dbconsole
 
重新配置dbconsole的步骤
emca -repos drop
emca -repos create
emca -config dbcontrol db
emctl start dbconsole


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值