今天在搞数据库, 要想打开OEM的web管理程序,必须先启动Database listener,再启动Datebase Control端口监控程序,但是碰到下面的情况 ,启动时报错:
oracle:/home/oracle>emctl start dbconsole
TZ set to PRC
EM Configuration issue. /opt/oracle/product/10.2.0/db_1/localhost.localdomain_orcl not found.
oracle:/home/oracle>
解决办法:
1. 重建em资料
oracle:/home/oracle>emca -repos recreate
STARTED EMCA at Dec 11, 2013 6:51:49 PM
EM Configuration Assistant, Version 10.2.0.1.0 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
Dec 11, 2013 6:52:03 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/oracle/product/10.2.0/db_1/cfgtoollogs/emca/orcl/emca_2013-12-11_06-51-49-PM.log.
Dec 11, 2013 6:52:03 PM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Dec 11, 2013 6:53:11 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Dec 11, 2013 6:53:11 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Dec 11, 2013 6:55:34 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Enterprise Manager configuration completed successfully
FINISHED EMCA at Dec 11, 2013 6:55:34 PM
oracle:/home/oracle>
上面操作为重新创建 EM 资料档案库
2. 然后是配置控制台
oracle:/home/oracle>emca -config dbcontrol db
STARTED EMCA at Dec 11, 2013 7:01:22 PM
EM Configuration Assistant, Version 10.2.0.1.0 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 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 ................ /opt/oracle/product/10.2.0/db_1
Database hostname ................ localhost.localdomain
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
Dec 11, 2013 7:01:53 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/oracle/product/10.2.0/db_1/cfgtoollogs/emca/orcl/emca_2013-12-11_07-01-22-PM.log.
Dec 11, 2013 7:01:58 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
oracle:/home/oracle>emctl start dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
http://localhost.localdomain:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control .......................... started.
------------------------------------------------------------------
Logs are generated in directory /opt/oracle/product/10.2.0/db_1/localhost.localdomain_orcl/sysman/log
oracle:/home/oracle>emctl status dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
http://localhost.localdomain:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory /opt/oracle/product/10.2.0/db_1/localhost.localdomain_orcl/sysman/log
oracle:/home/oracle>
然后直接进入http://localhost.localdomain:1158/em/,输入账户sys和密码******,选择sysdba权限,就能正常看到基于WEB的EM了
Oracle10G的EM采用了web方式,并且分成了2个产品,database control和grid control。Grid control需要下载单独的光盘安装。在用DBCA建库的时候,可以选择是否启用dbcontrol,启用的话需要在数据库中建立一个sysman的 schema,用于保存EM的一些数据,这个就是EM的资料库(repository)。使用命令行工具emca可以创建,修改,重建或者删除 dbcontrol的配置。
emca -repos create: 创建新的 Database Control 资料档案库
emca -repos drop: 删除当前的 Database Control 资料档案库
emca -repos recreate: 删除当前的 Database Control 资料档案库并重新创建一个
emca -config dbcontrol db:配置数据库的 Database Control
emca -deconfig dbcontrol db:取消数据库的 Database Control
注:(1)如果服务器上存在多个数据库,必须在启动Database control之前设置ORACLE_SID环境变量
(2)最好使用静态IP地址来配置服务器