之前,由于数据库是静默安装的,没有安装EM,导致EM无法启用,所以要重建EM。
-
--查看EM状态
-
[oracle@localhost ~]$ emctl status dbconsole
-
OC4J Configuration issue. /u01/app/oracle/oc4j/j2ee/OC4J_DBConsole_localhost.localdomain_orcl not found.
重建EM资料库
-
[oracle@localhost ~]$ emca -repos recreate
-
-
STARTED EMCA at Feb 9, 2015 11:49:56 AM
-
EM Configuration Assistant, Version 11.2.0.3.0 Production
-
Copyright (c) 2003, 2011, Oracle. All rights reserved.
-
-
Enter the following information:
-
Database SID: orcl
-
Listener port number: 1521
-
Password for SYS user:
-
Password for SYSMAN user:
-
-
----------------------------------------------------------------------
-
WARNING : While repository is dropped the database will be put in quiesce mode.
-
----------------------------------------------------------------------
-
Do you wish to continue? [yes(Y)/no(N)]: y
-
Feb 9, 2015 11:50:25 AM oracle.sysman.emcp.EMConfig perform
-
INFO: This operation is being logged at /u01/app/cfgtoollogs/emca/orcl/emca_2015_02_09_11_49_55.log.
-
Feb 9, 2015 11:50:26 AM oracle.sysman.emcp.EMReposConfig invoke
-
INFO: Dropping the EM repository (this may take a while) ...
-
Feb 9, 2015 11:53:14 AM oracle.sysman.emcp.EMReposConfig invoke
-
INFO: Repository successfully dropped
-
Feb 9, 2015 11:53:15 AM oracle.sysman.emcp.EMReposConfig createRepository
-
INFO: Creating the EM repository (this may take a while) ...
-
Feb 9, 2015 12:01:44 PM oracle.sysman.emcp.EMReposConfig invoke
-
INFO: Repository successfully created
-
Enterprise Manager configuration completed successfully
-
FINISHED EMCA at Feb 9, 2015 12:01:44 PM
看到上面的内容,代表配置成功
配置数据库的dbcontrol
-
[oracle@localhost ~]$ emca -config dbcontrol db
-
-
STARTED EMCA at Feb 9, 2015 1:12:37 PM
-
EM Configuration Assistant, Version 11.2.0.3.0 Production
-
Copyright (c) 2003, 2011, Oracle. All rights reserved.
-
-
Enter the following information:
-
Database SID: orcl
-
Listener port number: 1521
-
Listener ORACLE_HOME [ /u01/app/oracle ]:
-
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
-
-
Local hostname ................ localhost.localdomain
-
Listener ORACLE_HOME ................ /u01/app/oracle
-
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
-
Feb 9, 2015 1:13:47 PM oracle.sysman.emcp.EMConfig perform
-
INFO: This operation is being logged at /u01/app/cfgtoollogs/emca/orcl/emca_2015_02_09_13_12_37.log.
-
Feb 9, 2015 1:13:53 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
-
INFO: Uploading configuration data to EM repository (this may take a while) ...
-
Feb 9, 2015 1:15:51 PM oracle.sysman.emcp.EMReposConfig invoke
-
INFO: Uploaded configuration data successfully
-
Feb 9, 2015 1:15:54 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
-
INFO: Securing Database Control (this may take a while) ...
-
Feb 9, 2015 1:16:54 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
-
INFO: Database Control secured successfully.
-
Feb 9, 2015 1:16:54 PM oracle.sysman.emcp.util.DBControlUtil startOMS
-
INFO: Starting Database Control (this may take a while) ...
-
Feb 9, 2015 1:17:31 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
-
INFO: Database Control started successfully
-
Feb 9, 2015 1:17:31 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
-
INFO: >>>>>>>>>>> The Database Control URL is https://localhost.localdomain:1158/em <<<<<<<<<<<
-
Feb 9, 2015 1:17:36 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/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.
-
-
***********************************************************
-
Enterprise Manager configuration completed successfully
-
FINISHED EMCA at Feb 9, 2015 1:17:36 PM
em已经配置成功,在来看看em是否已经启动
-
[oracle@localhost ~]$ emctl status dbconsole
-
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
-
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
-
https://localhost.localdomain:1158/em/console/aboutApplication
-
Oracle Enterprise Manager 11g is running.
-
------------------------------------------------------------------
-
Logs are generated in directory /u01/app/oracle/localhost.localdomain_orcl/sysman/log
查看监听端口
-
[root@localhost oracle]# netstat -tpln|grep 1158
-
tcp 0 0 :::1158 :::* LISTEN 13380/java
相关的命令
-
emca -repos recreate --重建一个EM资料库
-
emca -repos drop --删除一个EM资料库
-
emca -repos create --创建一个EM资料库
-
emca -config dbcontrol db --配置数据库的 Database Control
-
-
重新配置EM后端口号可能会改变,注意看命令的提示信息
-
端口号是根据配置文件来的
-
$ORACLE_HOME/sysman/config/emca.properties
-
DBCONTROL_HTTP_PORT_MIN=5500
-
DBCONTROL_HTTP_PORT_MAX=5519
-
DBCONTROL_HTTP_PORT_DEFAULT=1158
-
-
emca -reconfig ports -dbcontrol_http_port 1158 --配置EM的端口号
-
-
emca -reconfig ports -agent_port 3938 --配置代理端口号
-
-
配置好的文件在
-
$ORACLE_HOME/install/portlist.ini
-
-
查看EM console服务的状态
-
emctl status dbconsole
-
启动EM console服务
-
emctl start dbconsole
-
停止EM console服务
-
emctl stop dbconsole
参考文档:http://www.2cto.com/database/201302/189363.html
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30150152/viewspace-1452052/
,如需转载,请注明出处,否则将追究法律责任。