我们在使用Oracle时, 可以利用Oracle自带的EM(Enterprise Manager)来更方便的管理我们的数据库。但是有时候我们的em却有时候无法连接,造成这个问题的原因有好多,例如没有正确的配置hostname,或者操作系统的防火墙问题等等。如果出现了问题,我们能否快速的重建em呢?答案是肯定的。我们可以通过Oracle官方文档来参照。但是如果我们对于em里面如此多的配置命令和选项比较头大的时候,你就可以参照此文来重新创建EM。

首先需要设置好环境变量ORACLE_HOSTNAME

export ORACLE_HOSTNAME=testbox.localdomain

然后再执行:

emca -config dbcontrol db -repos recreate

如果这个方法不行的话,你可以手动先drop掉你当前的repo

emca -deconfig dbcontrol db -repos drop

然后再重新创建

emca -config dbcontrol db -repos create

此间过程比较长,大概需要十分钟左右来创建。然后你就可以看到如下提示:

[oracle@testbox j2ee]$ emca -config dbcontrol db -repos create

STARTED EMCA at Jul ,  :: PM
EM Configuration Assistant, Version 11.2.0.3. Production
Copyright (c) , , Oracle. All rights reserved. Enter the following information:
Database SID: erin
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2./db_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./db_1 Local hostname ................ testbox.localdomain
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2./db_1
Listener port number ................
Database SID ................ erin
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ............... -----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: yes
Jul , :: PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/erin/emca_2014_07_01_22_50_24.log.
Jul , :: PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ... Jul , :: PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Jul , :: PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ... Jul , :: PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Jul , :: PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Jul , :: PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Jul , :: PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jul , :: PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jul , :: PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://testbox.localdomain:5500/em <<<<<<<<<<<
Jul , :: 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/app/oracle/product/11.2./db_1/testbox.localdomain_erin/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 , :: PM

标注的红色部分就是我们的em的访问地址。

最新文章

  1. 一张图轻松搞懂javascript event对象的clientX,offsetX,screenX,pageX区别
  2. stanford NLP学习笔记3:最小编辑距离(Minimum Edit Distance)
  3. 用Java计算某个日期100天后的日期
  4. PHP 错误与异常 笔记与总结(18 )页面重定向实现
  5. docker居然需要3.10以上的内核
  6. Java基本开发环境搭建
  7. Linux 时间同步配置(转)
  8. AutoMapper2
  9. 使用LINQ的几个小技巧
  10. grub修复
  11. 【java集合框架源码剖析系列】java源码剖析之java集合中的折半插入排序算法
  12. Linux 套接字编程中的 5 个隐患(转)
  13. 了解AutoCAD对象层次结构 —— 6 ——块表记录
  14. c代码片段-注解
  15. Flask的错误日志处理和|ORM操作
  16. bit byte哪些事
  17. 两条Find指令
  18. [PyTorch]PyTorch中反卷积的用法
  19. 云计算之路-阿里云上:原来“黑色0.1秒”发生在socket读取数据时
  20. [Leetcode] The minimum depth of binary tree二叉树的最小深度

热门文章

  1. Mysql 锁粒度
  2. sprintf mfc
  3. JQUERY1.9学习笔记 之基本过滤器(三)偶数选择器
  4. ssh登陆设置快捷方式
  5. CLR via C#字符串和文本处理
  6. Python一路走来 - python基础 数据类型
  7. VS2010安装项目的系统必备中添加.NET 2.0
  8. Android Timer的使用
  9. Cracking the coding interview--Q1.6
  10. 高性能的EMI滤波器及其小型化设计技术