Database Control简介。
在Oracle10g开始,Oracle提供了网页形式的管理工具,Database Control。我们可以使用dbca在建库的时候指定安装Database Control。也可以在安装完数据库以后,通过调用emca来创建Database Control。个人认为Database Control的使用一方面方便了DBA对数据库的管理,另一方面由于消耗系统资源,而且大部分在Oracle提供的选项上进行选择,灵活度不够。可以算是好坏摻半把。
利用emca创建Database Control
所谓 repository是存放Database Control在数据库所用到的信息的多个表。在使用emca时必须先创建repository。注意在利用emca传教Database Control前必须确保监听程序能正常使用。
[oracle@db1 ~]$ emca -repos create
STARTED EMCA at May 23, 2011 4:35:44 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 //数据库SID
Listener port number: 1521 //监听的端口号
Password for SYS user: //sys密码
Password for SYSMAN user: //sysman密码
Do you wish to continue? [yes(Y)/no(N)]: y
May 23, 2011 4:35:52 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ORCL/emca_2011-05-23_04-35-44-PM.log.
May 23, 2011 4:35:53 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
May 23, 2011 4:39:30 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Enterprise Manager configuration completed successfully //命令执行成功
FINISHED EMCA at May 23, 2011 4:39:30 PM
创建Database Control
[oracle@db1 ~]$ emca -config dbcontrol db
STARTED EMCA at May 23, 2011 4:43:04 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 //数据库SID
Listener port number: 1521 //监听的端口号
Password for SYS user: //sys密码
Password for DBSNMP user: //DBSNMP用户的密码
Password for SYSMAN user: //sysman密码
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/10.2.0/db_1
Database hostname ................ db1
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
May 23, 2011 4:43:21 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ORCL/emca_2011-05-23_04-43-04-PM.log.
May 23, 2011 4:43:40 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
May 23, 2011 4:45:27 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
May 23, 2011 4:45:27 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://db1:1158/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully //命令执行成功
FINISHED EMCA at May 23, 2011 4:45:27 PM
利用emca删除Database Control
先删除Database Control
[oracle@db1 ~]$ emca -deconfig dbcontrol db
STARTED EMCA at May 23, 2011 4:35:28 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 //数据库的SID
Do you wish to continue? [yes(Y)/no(N)]: y
May 23, 2011 4:35:31 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ORCL/emca_2011-05-23_04-35-27-PM.log.
May 23, 2011 4:35:32 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Enterprise Manager configuration completed successfully //命令执行成功
FINISHED EMCA at May 23, 2011 4:35:32 PM
删除repository
[oracle@db1 ~]$ emca -repos drop
STARTED EMCA at May 23, 2011 4:33:08 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 //数据库SID
Listener port number: 1521 //监听的端口号
Password for SYS user: //sys密码
Password for SYSMAN user: //sysman密码
Do you wish to continue? [yes(Y)/no(N)]: y
May 23, 2011 4:33:16 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ORCL/emca_2011-05-23_04-33-08-PM.log.
May 23, 2011 4:33:16 PM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
May 23, 2011 4:34:42 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully //命令执行成功
FINISHED EMCA at May 23, 2011 4:34:42 PM
其他Database Control相关命令
emca -reconfig ports -dbcontrol_http_port 1160 //修改EM登录端口为1160
emca -reconfig ports -agent_port 3940 //修改agent登录端口为3940
emctl start dbconsole //启动Database Control
emctl status dbconsole //查看Database Control 状态
emctl stop dbconsole //关闭Database Control
参考至:《教你如何成10gOCP》
http://oracle.chinaitlab.com/optimize/757535.html
本文原创,转载请注明出处、作者
如有错误,欢迎指正
在Oracle 10g 中,我们可能会经常遇到OEM不能正常使用的问题,但导致问题的原因不尽相同,最后绝大多数问题可以通过emca 这个命令来解决,详细的说明可以查看联机帮助,下面给出一些常用的命令及实例步骤.
创建一个EM资料库
emca -repos create |
重建一个EM资料库
emca -repos recreate |
删除一个EM资料库
emca -repos drop |
配置数据库的 Database Control
emca -config dbcontrol db |
删除数据库的 Database Control配置
emca -deconfig dbcontrol db |
重新配置db control的端口,默认端口在1158
emca -reconfig ports emca -reconfig ports -dbcontrol_http_port 1160 emca -reconfig ports -agent_port 3940 |
先设置ORACLE_SID环境变量后,启动EM console服务
emctl start dbconsole |
先设置ORACLE_SID环境变量后,停止EM console服务
emctl stop dbconsole |
先设置ORACLE_SID环境变量后,查看EM console服务的状态
emctl status dbconsole |
配置dbconsole的步骤
emca -repos create emca -config dbcontrol db emctl start dbconsole |
重新配置dbconsole的步骤
emca -repos drop |