---
title: "如何重新配置Oracle的EM Database Control"
author: "blueyanghualong"
date: "2011-05-30T17:59:00Z"
tags: ["AIX", "HP", "Linux", "Oracle", "Solaris"]
categories: ["数据库"]
slug: "oracle-em-database-control"
draft: false
lastmod: "2011-09-11T01:02:45Z"
id: 1064908
url: "https://smalltalllong.iteye.com/blog/1064908"
---

### 如何重新配置Oracle的EM Database Control

作者：[eygle](http://www.eygle.com/) |[English Version](http://translate.google.com/translate?langpair=zh-CN%7Cen&hl=zh-CN&ie=UTF8&u=http%3A%2F%2Fwww.eygle.com%2Farchives%2F2007%2F09%2Fem_database_control_config.html) [](http://www.eygle.com/ "By eygle.com")【转载时请以超链接形式标明文章[出处](http://www.eygle.com/archives/2007/09/em_database_control_config.html)和作者信息及[本声明](http://www.eygle.com/archives/2006/12/eygle_copyright.html)】  
链接：[http://www.eygle.com/archives/2007/09/em\_database\_control\_config.html](http://www.eygle.com/archives/2007/09/em_database_control_config.html)

**站内相关文章|Related Articles**

[Oracle 11g默认用户密码增强-default\_pwd$](http://www.eygle.com/archives/2010/09/oracle_11g_default_pwd.html)  
[Oracle Database 11g Release 2 HP/AIX](http://www.eygle.com/archives/2009/12/11gr2_hp_aix_release.html)  
[Oracle 11gR2 Solaris x86-64 发布](http://www.eygle.com/archives/2009/12/11gr2_solaris_x8664.html)  
[Oracle 11gR2 Solaris (SPARC) (64-bit) 发布](http://www.eygle.com/archives/2009/11/oracle_11gr2_so.html)  
[11gR2新特性之- 并行DBMS\_PARALLEL\_EXECUTE](http://www.eygle.com/archives/2009/11/11gr2_dbms_parallel_execute.html)

今天打算启用一下Oracle Database 11g的Database Control，发现初始并未安装:

> \[oracle@test126 ~]$ emctl start  
> EM Configuration issue. /opt/oracle/product/11.1.0/test126.hurray.com.cn\_dodd not found.

 

遇到这类问题，可以通过重新配置，来创建EM的配置文件：

> \[oracle@test126 11.1.0]$ emca -config dbcontrol db -repos recreate
> 
>  
> 
> STARTED EMCA at Aug 28, 2007 11:54:40 AM  
> EM Configuration Assistant, Version 11.1.0.5.0 Production  
> Copyright (c) 2003, 2005, Oracle. All rights reserved.
> 
> Enter the following information:  
> Database SID: dodd  
> Listener port number: 1521  
> Password for SYS user:  
> Password for DBSNMP user:  
> Password for SYSMAN user:  
> Password for SYSMAN user: Email address for notifications (optional): eygle@eygle.com  
> Outgoing Mail (SMTP) server for notifications (optional):  
> -----------------------------------------------------------------
> 
> You have specified the following settings
> 
> Database ORACLE\_HOME ................ /opt/oracle/product/11.1.0
> 
> Local hostname ................ test126.hurray.com.cn  
> Listener port number ................ 1521  
> Database SID ................ dodd  
> Email address for notifications ............... eygle@eygle.com  
> Outgoing Mail (SMTP) server for notifications ...............
> 
> -----------------------------------------------------------------  
> Do you wish to continue? \[yes(Y)/no(N)]: Y  
> Aug 28, 2007 11:56:58 AM oracle.sysman.emcp.EMConfig perform  
> INFO: This operation is being logged at /opt/oracle/cfgtoollogs/emca/dodd/emca\_2007\_08\_28\_11\_54\_40.log.  
> Aug 28, 2007 11:57:01 AM oracle.sysman.emcp.EMReposConfig invoke  
> INFO: Dropping the EM repository (this may take a while) ...  
> Aug 28, 2007 11:57:16 AM oracle.sysman.emcp.EMReposConfig invoke  
> INFO: Repository successfully dropped  
> Aug 28, 2007 11:57:16 AM oracle.sysman.emcp.EMReposConfig createRepository  
> INFO: Creating the EM repository (this may take a while) ...
> 
> Aug 28, 2007 12:08:35 PM oracle.sysman.emcp.EMReposConfig invoke  
> INFO: Repository successfully created  
> Aug 28, 2007 12:08:47 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository  
> INFO: Uploading configuration data to EM repository (this may take a while) ...  
> Aug 28, 2007 12:11:45 PM oracle.sysman.emcp.EMReposConfig invoke  
> INFO: Uploaded configuration data successfully  
> Aug 28, 2007 12:11:51 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib  
> INFO: Software library configured successfully.  
> Aug 28, 2007 12:11:51 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary  
> INFO: Deploying Provisioning archives ...  
> Aug 28, 2007 12:12:13 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary  
> INFO: Provisioning archives deployed successfully.  
> Aug 28, 2007 12:12:13 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole  
> INFO: Securing Database Control (this may take a while) ...  
> Aug 28, 2007 12:12:39 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole  
> INFO: Database Control secured successfully.  
> Aug 28, 2007 12:12:39 PM oracle.sysman.emcp.util.DBControlUtil startOMS  
> INFO: Starting Database Control (this may take a while) ...  
> Aug 28, 2007 12:14:04 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration  
> INFO: Database Control started successfully  
> Aug 28, 2007 12:14:04 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration  
> INFO: &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; The Database Control URL is https://test126.hurray.com.cn:1158/em &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;  
> Aug 28, 2007 12:14:16 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: /opt/oracle/product/11.1.0/test126.hurray.com.cn\_dodd/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 Aug 28, 2007 12:14:16 PM

 

Oracle 10g中，配置方法与此相同。  
配置完成之后就可以启动EM了：

> \[oracle@test126 11.1.0]$ emctl start dbconsole  
> Oracle Enterprise Manager 11g Database Control Release 11.1.0.6.0  
> Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.  
> https://test126.hurray.com.cn:1158/em/console/aboutApplication  
> Starting Oracle Enterprise Manager 11g Database Control ........ started.  
> ------------------------------------------------------------------  
> Logs are generated in directory /opt/oracle/product/11.1.0/test126.hurray.com.cn\_dodd/sysman/log

 

如果是Linux环境，你可能还需要在iptables中开放1158端口，增加如下一行:  
**-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1158 -j ACCEPT**

重新启动防火墙之后就可以通过IE在远端连接EM的Database Control了：

> \[root@test126 sysconfig]# service iptables restart  
> Flushing firewall rules: \[ OK ]  
> Setting chains to policy ACCEPT: filter \[ OK ]  
> Unloading iptables modules: \[ OK ]  
> Applying iptables firewall rules: \[ OK ]  
> Loading additional iptables modules: ip\_conntrack\_netbios\_ns \[ OK ]