ORACLE重建EM

之前,由于数据库是静默安装的,没有安装EM,导致EM无法启用,所以要重建EM。

  1. --查看EM状态
  2. [oracle@localhost ~]$ emctl status dbconsole
  3. OC4J Configuration issue. /u01/app/oracle/oc4j/j2ee/OC4J_DBConsole_localhost.localdomain_orcl not found.


重建EM资料库

  1. [oracle@localhost ~]$ emca -repos recreate
  2.   
  3. STARTED EMCA at Feb 9, 2015 11:49:56 AM
  4. EM Configuration Assistant, Version 11.2.0.3.0 Production
  5. Copyright (c) 2003, 2011, Oracle. All rights reserved.
  6.   
  7. Enter the following information:
  8. Database SID: orcl
  9. Listener port number: 1521
  10. Password for SYS user:
  11. Password for SYSMAN user:
  12.   
  13. ----------------------------------------------------------------------
  14. WARNING : While repository is dropped the database will be put in quiesce mode.
  15. ----------------------------------------------------------------------
  16. Do you wish to continue? [yes(Y)/no(N)]: y
  17. Feb 9, 2015 11:50:25 AM oracle.sysman.emcp.EMConfig perform
  18. INFO: This operation is being logged at /u01/app/cfgtoollogs/emca/orcl/emca_2015_02_09_11_49_55.log.
  19. Feb 9, 2015 11:50:26 AM oracle.sysman.emcp.EMReposConfig invoke
  20. INFO: Dropping the EM repository (this may take a while) ...
  21. Feb 9, 2015 11:53:14 AM oracle.sysman.emcp.EMReposConfig invoke
  22. INFO: Repository successfully dropped
  23. Feb 9, 2015 11:53:15 AM oracle.sysman.emcp.EMReposConfig createRepository
  24. INFO: Creating the EM repository (this may take a while) ...
  25. Feb 9, 2015 12:01:44 PM oracle.sysman.emcp.EMReposConfig invoke
  26. INFO: Repository successfully created
  27. Enterprise Manager configuration completed successfully
  28. FINISHED EMCA at Feb 9, 2015 12:01:44 PM

看到上面的内容,代表配置成功

配置数据库的dbcontrol

  1. [oracle@localhost ~]$ emca -config dbcontrol db
  2.   
  3. STARTED EMCA at Feb 9, 2015 1:12:37 PM
  4. EM Configuration Assistant, Version 11.2.0.3.0 Production
  5. Copyright (c) 2003, 2011, Oracle. All rights reserved.
  6.   
  7. Enter the following information:
  8. Database SID: orcl
  9. Listener port number: 1521
  10. Listener ORACLE_HOME [ /u01/app/oracle ]:
  11. Password for SYS user:
  12. Password for DBSNMP user:
  13. Password for SYSMAN user:
  14. Email address for notifications (optional):
  15. Outgoing Mail (SMTP) server for notifications (optional):
  16. -----------------------------------------------------------------
  17.   
  18. You have specified the following settings
  19.   
  20. Database ORACLE_HOME ................ /u01/app/oracle
  21.   
  22. Local hostname ................ localhost.localdomain
  23. Listener ORACLE_HOME ................ /u01/app/oracle
  24. Listener port number ................ 1521
  25. Database SID ................ orcl
  26. Email address for notifications ...............
  27. Outgoing Mail (SMTP) server for notifications ...............
  28.   
  29. -----------------------------------------------------------------
  30. Do you wish to continue? [yes(Y)/no(N)]: y
  31. Feb 9, 2015 1:13:47 PM oracle.sysman.emcp.EMConfig perform
  32. INFO: This operation is being logged at /u01/app/cfgtoollogs/emca/orcl/emca_2015_02_09_13_12_37.log.
  33. Feb 9, 2015 1:13:53 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
  34. INFO: Uploading configuration data to EM repository (this may take a while) ...
  35. Feb 9, 2015 1:15:51 PM oracle.sysman.emcp.EMReposConfig invoke
  36. INFO: Uploaded configuration data successfully
  37. Feb 9, 2015 1:15:54 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
  38. INFO: Securing Database Control (this may take a while) ...
  39. Feb 9, 2015 1:16:54 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
  40. INFO: Database Control secured successfully.
  41. Feb 9, 2015 1:16:54 PM oracle.sysman.emcp.util.DBControlUtil startOMS
  42. INFO: Starting Database Control (this may take a while) ...
  43. Feb 9, 2015 1:17:31 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
  44. INFO: Database Control started successfully
  45. Feb 9, 2015 1:17:31 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
  46. INFO: >>>>>>>>>>> The Database Control URL is https://localhost.localdomain:1158/em <<<<<<<<<<<
  47. Feb 9, 2015 1:17:36 PM oracle.sysman.emcp.EMDBPostConfig invoke
  48. WARNING:
  49. ************************ WARNING ************************
  50.   
  51. 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/localhost.localdomain_orcl/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.
  52.   
  53. ***********************************************************
  54. Enterprise Manager configuration completed successfully
  55. FINISHED EMCA at Feb 9, 2015 1:17:36 PM
em已经配置成功,在来看看em是否已经启动
  1. [oracle@localhost ~]$ emctl status dbconsole
  2. Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
  3. Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
  4. https://localhost.localdomain:1158/em/console/aboutApplication
  5. Oracle Enterprise Manager 11g is running.
  6. ------------------------------------------------------------------
  7. Logs are generated in directory /u01/app/oracle/localhost.localdomain_orcl/sysman/log


查看监听端口
  1. [root@localhost oracle]# netstat -tpln|grep 1158
  2. tcp 0 0 :::1158 :::* LISTEN 13380/java  


相关的命令

  1. emca -repos recreate --重建一个EM资料库
  2. emca -repos drop --删除一个EM资料库
  3. emca -repos create --创建一个EM资料库
  4. emca -config dbcontrol db --配置数据库的 Database Control
  5.    
  6. 重新配置EM后端口号可能会改变,注意看命令的提示信息
  7. 端口号是根据配置文件来的
  8. $ORACLE_HOME/sysman/config/emca.properties
  9. DBCONTROL_HTTP_PORT_MIN=5500
  10. DBCONTROL_HTTP_PORT_MAX=5519
  11. DBCONTROL_HTTP_PORT_DEFAULT=1158
  12.     
  13. emca -reconfig ports -dbcontrol_http_port 1158 --配置EM的端口号
  14.   
  15. emca -reconfig ports -agent_port 3938 --配置代理端口号
  16.   
  17. 配置好的文件在
  18. $ORACLE_HOME/install/portlist.ini
  19.    
  20. 查看EM console服务的状态
  21. emctl status dbconsole
  22. 启动EM console服务
  23. emctl start dbconsole
  24. 停止EM console服务
  25. emctl stop dbconsole


参考文档:http://www.2cto.com/database/201302/189363.html


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30150152/viewspace-1452052/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30150152/viewspace-1452052/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值