posts - 495,comments - 227,trackbacks - 0

OEM 控制台是运行在HTTP服务器上的web页面(非常方便,可以远程管理),该HTTP服务器将作为Grid Control 安装的一部分安装和配置,没有任何客户端安装。 将中心 Console、多个代理、公共服务以及工具结为一体,提供一个集成的综合性系统管理平台,管理 Oracle 数据库环境,因此Oracle公司大力推荐DBA们使用EM来进行管理Oracle。

使用 Oracle Enterprise Manager Console,可以执行以下任务:

·管理、诊断和调整多个远程系统。
·在多个节点上,按不同的时间间隔调度作业。
·监视整个网络范围内的服务和事件。
·管理管理员,实现 Oracle Enterprise Manager 管理员间的信息共享。
·将远程系统分组组织,便于管理和监视。
·管理 Oracle Parallel Server。
·从任何一个授权位置上通过 Management Server 管理您的数据库网络。
·管理集成使用的 Oracle 和第三方工具。 

使用命令行工具emca可以创建,修改,重建或者删除dbcontrol的配置。

SQL > select * from v$version                                             
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

 

由于要在数据库中建EM资料库,数据库和监听都必须已经启动并正常工作。

配置dbcontrol(如果你提前配置的话,启动emctl 等命令会出现错误DB Console start error:OC4J Configuration issue滴)

[oracle~]$ emca -config dbcontrol db

STARTED EMCA at Aug 16, 2010 3:50:49 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: blogbench
Listener port number: 1521
Listener ORACLE_HOME [ /mnt/ddb/1/app/oracle/product/11.2.0/dbhome_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 ................ /mnt/ddb/1/app/oracle/product/11.2.0/dbhome_1

Local hostname ................ %%%

Listener ORACLE_HOME ................ /mnt/ddb/1/app/oracle/product/11.2.0/dbhome_1
Listener port number ................ 1521
Database SID ................ ceshi

Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Aug 16, 2010 3:51:35 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /mnt/ddb/1/app/oracle/cfgtoollogs/emca/blogbench/emca_2010_08_16_15_50_48.log.
Aug 16, 2010 3:51:36 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Aug 16, 2010 3:52:18 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Aug 16, 2010 3:52:20 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Aug 16, 2010 3:52:20 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Aug 16, 2010 3:52:42 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Aug 16, 2010 3:52:42 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Aug 16, 2010 3:52:56 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Aug 16, 2010 3:52:56 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Aug 16, 2010 3:53:13 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Aug 16, 2010 3:53:13 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://%%%:1158/em <<<<<<<<<<<
Aug 16, 2010 3:53:15 PM oracle.sysman.emcp.EMDBPostConfig invoke

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 16, 2010 3:53:15 PM

 

配置完毕后就可以登录https://%%%:1158/em(这个我记得以前Oracle 10g的时候支持的可是http协议,看来11g在安全性上又做了相应的提升)进行管理数据库了,可以查看数据库的很多运行状态。

 

其他常用的命令语法:

emca -repos create创建一个EM资料库

emca -repos recreate重建一个EM资料库 (可以解决OracleService*、OracleDBConsole*无法启动的问题)

emca -repos drop删除一个EM资料库

emca -config dbcontrol db配置数据库的Database Control

emca -deconfig dbcontrol db删除数据库的Database Control配置

emca -reconfig ports重新配置db control和agent的端口

emctl start console启动EM console服务,使用前需要先设置ORACLE_SID环境变量

emctl stop console停止EM console服务,使用前需要先设置ORACLE_SID环境变量

emctl status console查看EM console的服务状态,使用前需要先设置ORACLE_SID环境变量

注:通过查看$ORACLE_HOME/install/readme文件可以知道当前dbcontrol正在使用的端口,默认dbcontrol http端口1158,agent端口3938。如果要重新配置端口,可以使用如下命令:

emca -reconfig ports -dbcontrol_http_port 1159

emca -reconfig ports -agent_port 3939

使用命令行工具emctl可以启动/停止console服务,察看服务状态等。

配置dbconsole的步骤
emca -repos create
emca -config dbcontrol db
emctl start dbconsole

重新配置dbconsole的步骤
emca -repos drop
emca -repos create
emca -config dbcontrol db
emctl start dbconsole

posted on 2011-07-19 18:50 SIMONE 阅读(5740) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: