emctl start dbconsole遇到错误:OC4J Configuration issue

本文记录了解决emctl startdbconsole启动时出现OC4J Configuration issue错误的过程。通过删除原有配置并重新配置的方式成功启动了DB Console,并提供了详细的步骤说明。

emctl start dbconsole遇到错误

在虚拟机的测试数据库上,启动emctl start dbconsole的时候,报如下错误:

[oracle@QL ~]$ emctl start dbconsole
OC4J Configuration issue. /u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_test_orcl not found.

 

网上查找过的资料:

Thread: Issues with DBConsole not starting

https://forums.oracle.com/forums/thread.jspa?threadID=2332536

 

emctl start dbconsole遇到错误:OC4J Configuration issue

http://space.itpub.net/8183550/viewspace-678624

 

emca和emctl的日常用法

http://blog.youkuaiyun.com/hproc/article/details/6588766

 

整理过程:

1. 启动失败后先尝试emca重建服务;

2. emca重建失败,经查需要先删除之前的设置再创建服务

Please perform deconfig and config:
emca -deconfig dbcontrol db -repos drop
emca -config dbcontrol db -repos create

/-----------------------------------------------------/

删除数据库的 Database Control配置

emca -deconfig dbcontrol db

删除一个EM资料库

emca -repos drop

/-----------------------------------------------------/

删除Database Control配置及EM资料库

[oracle@QL ~]$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Apr 23, 2013 2:27:28 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

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

Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 23, 2013 2:27:41 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2013_04_23_14_27_28.log.
Apr 23, 2013 2:27:41 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Apr 23, 2013 2:27:42 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Apr 23, 2013 2:27:43 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /u01/app/oracle/product/11.2.0/db_1/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=orcl))) -repos_user SYSMAN -action drop -verbose -output_file /u01/app/oracle/cfgtoollogs/emca/orcl/emca_repos_drop_2013_04_23_14_27_42.log
Apr 23, 2013 2:27:43 PM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error dropping the repository
Apr 23, 2013 2:27:43 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_repos_drop_<date>.log for more details.
Apr 23, 2013 2:27:43 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Error dropping the repository
Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2013_04_23_14_27_28.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2013_04_23_14_27_28.log for more details.

——出了点错误。

 

/-----------------------------------------------------/

配置数据库的 Database Control

emca -config dbcontrol db

创建一个EM资料库

emca -repos create

/-----------------------------------------------------/

配置数据库的Database Control 并创建一个EM资料库

[oracle@QL ~]$ emca -config dbcontrol db -repos create

STARTED EMCA at Apr 23, 2013 2:28:10 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, 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/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.0/db_1

Local hostname ................ localhost
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/db_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
Apr 23, 2013 2:28:26 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2013_04_23_14_28_09.log.
Apr 23, 2013 2:28:27 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Apr 23, 2013 2:34:45 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Apr 23, 2013 2:34:52 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Apr 23, 2013 2:35:35 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Apr 23, 2013 2:35:42 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Apr 23, 2013 2:35:42 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Apr 23, 2013 2:36:30 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Apr 23, 2013 2:36:30 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Apr 23, 2013 2:37:44 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Apr 23, 2013 2:37:44 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Apr 23, 2013 2:38:34 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Apr 23, 2013 2:38:34 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://localhost:5500/em <<<<<<<<<<<
Apr 23, 2013 2:38:41 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.0/db_1/localhost_orcl/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 Apr 23, 2013 2:38:42 PM

 

/----------------------------------------------------------------/

https://127.0.0.1:5500/em

测试访问成功。

但是只能本机访问EM,换到客户端上还是无法通过https://Linux系统IP:5500/em访问EM。

待查。

<think>嗯,用户让我介绍一下“emctl start dbconsole”这个命令。首先,我需要确定这个命令的具体用途和相关背景。 我记得Oracle Enterprise Manager(OEM)是一个管理工具,而dbconsole应该是其中的数据库控制台组件。emctl是Oracle提供的管理工具命令行接口,用来控制各种服务,比如启动、停止状态检查等。所以“emctl start dbconsole”应该用于启动OEM的数据库控制台服务。 接下来,我需要确认这个命令的使用场景。通常,当用户安装完Oracle数据库后,可能需要启动dbconsole来通过Web界面管理数据库。用户可能会在需要远程管理或者使用图形化工具时使用这个命令。 然后,我应该考虑用户可能遇到的常见问题。比如,服务无法启动,端口冲突,或者环境变量未正确设置。这时候需要检查日志文件,确认错误信息,并给出相应的解决步骤。例如,检查EM配置文件,确认数据库实例状态,或者重新配置dbconsole。 另外,用户权限也是一个需要注意的地方。执行这个命令可能需要特定的操作系统用户权限,比如oracle用户,否则可能会提示权限不足。所以在步骤中需要提醒用户使用正确的账户运行命令。 还有,启动后的访问方式是通过浏览器访问特定的URL,比如https://localhost:1158/em,这里需要确认端口是否正确,以及防火墙是否允许该端口的访问。如果用户无法访问,可能需要检查防火墙设置或者端口是否被其他应用占用。 最后,考虑到不同Oracle版本可能会有差异,比如11g和12c的配置步骤可能不同,是否需要提醒用户注意版本兼容性?或者是否需要重新配置dbconsole,如果第一次启动失败的话? 总结一下,回答的结构应该包括命令的作用、使用步骤、常见问题及解决方法,以及访问方式。需要确保用户能够按照步骤操作,并理解可能遇到的问题该如何排查。同时,保持语言简洁明了,避免使用过于专业的术语,让不同水平的用户都能理解。</think>以下是对 `emctl start dbconsole` 命令的逐步说明: --- ### **1. 命令作用** `emctl start dbconsole` 是 Oracle 数据库中用于启动 **Database Control Console** 的命令。Database Control 是 Oracle 提供的基于 Web 的图形化管理工具,用于监控和管理数据库实例。 --- ### **2. 使用前提** - **Oracle 环境变量已配置** 需确保 `ORACLE_HOME`(Oracle 安装目录)和 `ORACLE_SID`(数据库实例名)已正确设置。 - **dbconsole 已配置** 若首次使用,需先通过 `emca -config dbcontrol db` 完成配置。 --- ### **3. 操作步骤** #### **步骤 1:切换到 Oracle 用户** ```bash su - oracle ``` #### **步骤 2:设置环境变量** ```bash export ORACLE_SID=你的实例名(如 ORCL) export ORACLE_HOME=你的Oracle安装路径(如 /u01/app/oracle/product/11.2.0/dbhome_1) ``` #### **步骤 3:执行启动命令** ```bash $ORACLE_HOME/bin/emctl start dbconsole ``` **正常输出示例**: ``` Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0 Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. https://localhost:1158/em/console/aboutApplication Starting Oracle Enterprise Manager 11g Database Control ...... started. ``` --- ### **4. 验证启动** - **检查状态** ```bash $ORACLE_HOME/bin/emctl status dbconsole ``` - **访问 Web 控制台** 浏览器输入: $$ \text{https://<服务器IP或主机名>:1158/em} $$ 默认端口为 `1158`,使用安装时配置的 `sys` 用户密码登录。 --- ### **5. 常见问题** #### **问题 1:端口冲突** - **表现**:启动失败,日志提示端口被占用。 - **解决**: 1. 修改 `$ORACLE_HOME/install/portlist.ini` 中的端口号。 2. 重新配置 dbconsole: ```bash emca -config dbcontrol db -repos recreate ``` #### **问题 2:未配置 dbconsole** - **表现**:提示 `Environment variable ORACLE_SID not defined` 或 `Database Control is not configured`。 - **解决**: 运行配置命令: ```bash emca -config dbcontrol db -repos create ``` #### **问题 3:防火墙限制** - **表现**:无法通过浏览器访问。 - **解决**: 开放防火墙端口 `1158`: ```bash firewall-cmd --zone=public --add-port=1158/tcp --permanent firewall-cmd --reload ``` --- ### **6. 停止命令** ```bash $ORACLE_HOME/bin/emctl stop dbconsole ``` --- 通过以上步骤,你可以启动 Oracle Database Control Console 并使用 Web 界面管理数据库。如仍存在问题,可检查 `$ORACLE_HOME/主机名_实例名/sysman/log` 下的日志文件。
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值