原文地址: 配置oracle11g EM dbcontrol 作者: 兰博wk
oracle从10g以来一直大力推荐dba通过EM来进行管理,不管个人的喜好如何,都不能否认EM还是具有很强的易用性的。
  前阵子装好了11g后,发现oracle11g文档很多快速管理指南的内容都是通过EM来进行的,但我在文档上并没找到EM的安装说明,于是试着通过10g的说明来对其进行配置。
  从安装软件上看,我并没找到gridcontrol部分,不知道是不是还没有推出,下面简单描述一下db control的配置过程以及遇到的几个问题。
 跟10g的方法相仿,oracle11g也可以通过EMCA来配置dbcontrol(在装数据库时候用dbca可以同时创建em)
 登陆oracle用户,执行emca-h命令后可以看到emca的各种配置参数及选项,具体参数的说明可以参考10g中的说明(可在Introduction toEnterprise Manager Advanced Configuration中找到)。执行emca -configdbcontrol db -reposcreate,按提示输入一些配置后,创建过程开始,可惜建到一半后,SYSAUX空间不足,报错退出了。看来自10G以后SYSAUX空间的要求越来越大了,这里要注意,不光是sysaux表空间,system表空间也要有足够的空闲。
  扩展表空间后执行emca -config dbcontrol db -reposrecreate准备重新开始创建,结果刚一开始就报错退出了,竟然是报没有tns监听,lsnrctlstatus检查监听是启的,用配置的tnsnames连接数据库也能连上,想了很久后怀疑跟监听没有采用动态注册方式有关,可按道理在一些缺省条件达成的情况的下,动态注册是自动生效的。lsnrctlstatus命令再看了一下,动态注册果然没有启动,没办法只能试试强制指定了,tnsnames里增加
listener1=
  (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=oratest)(PORT=1521))
   )
并指定local_listener=listener1后,动态注册立即生效了。至于为啥,我不知道,新特性还是bug?以后再说吧(10G没怎么玩过,不知道有没这个问题)
重新执行emca -config dbcontrol db -reposrecreate,成功,开始drop以前的配置了,之后一切顺利,执行过程及结果消息如下:
$ emca -config dbcontrol db -repos recreate
STARTED EMCA at Aug 29, 2007 8:40:57 AM
EM Configuration Assistant, Version 11.1.0.5.0 Production
Copyright (c) 2003, 2005, Oracle.  All rightsreserved.
Enter the following information:
Database SID: test11g
Listener port number: 1521
Password for SYS 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 ................/oracle11g/product/11g
Local hostname ................ oratest
Listener port number ................ 1521
Database SID ................ test11g
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Aug 29, 2007 8:41:20 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at/oracle11g/cfgtoollogs/emca/test11g/emca_2007_08_29_08_40_56.log.
Aug 29, 2007 8:41:30 AM oracle.sysman.emcp.EMReposConfiginvoke
INFO: Dropping the EM repository (this may take a while) ...
Aug 29, 2007 8:50:26 AM oracle.sysman.emcp.EMReposConfiginvoke
INFO: Repository successfully dropped
Aug 29, 2007 8:50:28 AM oracle.sysman.emcp.EMReposConfigcreateRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 29, 2007 9:16:21 AM oracle.sysman.emcp.EMReposConfiginvoke
INFO: Repository successfully created
Aug 29, 2007 9:17:05 AM oracle.sysman.emcp.EMReposConfiguploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may takea while) ...
Aug 29, 2007 9:20:57 AM oracle.sysman.emcp.EMReposConfiginvoke
INFO: Uploaded configuration data successfully
Aug 29, 2007 9:21:22 AM oracle.sysman.emcp.util.DBControlUtilconfigureSoftwareLib
INFO: Software library configured successfully.
Aug 29, 2007 9:21:22 AM oracle.sysman.emcp.EMDBPostConfigconfigureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Aug 29, 2007 9:26:27 AM oracle.sysman.emcp.EMDBPostConfigconfigureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Aug 29, 2007 9:26:27 AM oracle.sysman.emcp.util.DBControlUtilsecureDBConsole
INFO: Securing Database Control (this may take a while) ...
Aug 29, 2007 9:27:34 AM oracle.sysman.emcp.util.DBControlUtilsecureDBConsole
INFO: Database Control secured successfully.
Aug 29, 2007 9:27:34 AM oracle.sysman.emcp.util.DBControlUtilstartOMS
INFO: Starting Database Control (this may take a while) ...
Aug 29, 2007 9:36:05 AM oracle.sysman.emcp.EMDBPostConfigperformConfiguration
INFO: Database Control started successfully
Aug 29, 2007 9:36:08 AM oracle.sysman.emcp.EMDBPostConfigperformConfiguration
INFO:>>>>>>>>>>>The Database Control URL is https://oratest:1158/em<<<<<<<<<<<
Aug 29, 2007 9:37:50 AM oracle.sysman.emcp.EMDBPostConfiginvoke
WARNING:
************************ WARNING  ************************
Management Repository has been placed in secure mode whereinEnterprise Manager data will be encrypted.  Theencryption key has been placed in the file:/oracle11g/product/11g/oratest_test11g/sysman/config/emkey.ora.  Please ensure this file is backed up as the encrypted data willbecome unusable if this file is lost.
***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 29, 2007 9:37:51 AM
  emkey.ora是密钥的所在地所以如果在生成系统上还是需要备份好的。
$ more/oracle11g/product/11g/oratest_test11g/sysman/config/emkey.ora
KEY=056790FE22685160158605895E3E62FC06D7C153C224D99BAA82236AD677DD962B974B3BDA0A678E9D8278C75662EFEB5A8EB793695A79C131F79B8F8BDBBD03
80955F67D1BFBE675F5E20B9DC6B710A92
都完成之后,执行emctl status dbconsole可以查看状态,emctl startdbconsole和emctl stop dbconsole可以对Database Control ConsoleProcess进行启停。缺省端口依然跟10G一样是1158,不过似乎不在支持http,只能用https登陆。我从远程用ie7登陆的时候会警告证书是错误的(linux本地上没有问题),不用管它,继续就可以看到em的登陆界面了,呵呵。
 界面看起来挺友好的,具体功能有待日后研究。