配置oracle11g EM db control创建一个EM资料库emca -repos create重建一个EM资料库emca -repos recreate删除一个EM资料库emca -repos drop配置数据库的Database Controlemca -config dbcontrol db删除数据库的Database Control配置emca -deconfig dbcontrol db重新配置db control的端口,默认端口在1158emca -reconfig portsemca -reconfig ports -dbcontrol_http_port 1160emca -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 createemca -config dbcontrol dbemctl start dbconsole重新配置dbconsole的步骤emca -repos dropemca -repos createemca -config dbcontrol dbemctl start dbconsole-------------oracle从10g以来一直大力推荐dba通过EM来进行管理,不管个人的喜好如何,都不能否认EM还是具有很强的易用性的。
前阵子装好了11g后,发现oracle11g文档很多快速管理指南的内容都是通过EM来进行的,但我在文档上并没找到EM的安装说明,于是试着通过10g的说明来对其进行配置。
从安装软件上看,我并没找到grid control部分,不知道是不是还没有推出,下面简单描述一下db control的配置过程以及遇到的几个问题。
跟10g的方法相仿,oracle11g也可以通过EMCA来配置db control(在装数据库时候用dbca 可以同时创建em)登陆oracle用户,执行emca -h命令后可以看到emca的各种配置参数及选项,具体参数的说明可以参考10g中的说明(可在Introduction to Enterprise Manager Advanced Configuration中找到)。
执行emca -config dbcontrol db -repos create,按提示输入一些配置后,创建过程开始,可惜建到一半后,SYSAUX空间不足,报错退出了。
看来自10G以后SYSAUX空间的要求越来越大了,这里要注意,不光是sysaux表空间,system表空间也要有足够的空闲。
扩展表空间后执行emca -config dbcontrol db -repos recreate准备重新开始创建,结果刚一开始就报错退出了,竟然是报没有tns监听,lsnrctl status检查监听是启的,用配置的tnsnames连接数据库也能连上,想了很久后怀疑跟监听没有采用动态注册方式有关,可按道理在一些缺省条件达成的情况的下,动态注册是自动生效的。
lsnrctl status命令再看了一下,动态注册果然没有启动,没办法只能试试强制指定了,tnsnames里增加listener1=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oratest)(PORT=1521)))并指定local_listener=listener1后,动态注册立即生效了。
至于为啥,我不知道,新特性还是bug?以后再说吧(10G没怎么玩过,不知道有没这个问题)重新执行emca -config dbcontrol db -repos recreate,成功,开始drop以前的配置了,之后一切顺利,执行过程及结果消息如下:$ emca -config dbcontrol db -repos recreateSTARTED EMCA at Aug 29, 2007 8:40:57 AMEM Configuration Assistant, Version 11.1.0.5.0 ProductionCopyright (c) 2003, 2005, Oracle. All rights reserved.Enter the following information:Database SID: test11gListener port number: 1521Password for SYS user:Password for SYSMAN user: Email address for notifications (optional): Outgoing Mail (SMTP) server for notifications (optional):-----------------------------------------------------------------You have specified the following settingsDatabase ORACLE_HOME ................ /oracle11g/product/11gLocal hostname ................ oratestListener port number (1521)Database SID ................ test11gEmail address for notifications ...............Outgoing Mail (SMTP) server for notifications ...............-----------------------------------------------------------------Do you wish to continue? [yes(Y)/no(N)]: YAug 29, 2007 8:41:20 AM oracle.sysman.emcp.EMConfig performINFO: 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.EMReposConfig invoke INFO: Dropping the EM repository (this may take a while) ...Aug 29, 2007 8:50:26 AM oracle.sysman.emcp.EMReposConfig invoke INFO: Repository successfully droppedAug 29, 2007 8:50:28 AM oracle.sysman.emcp.EMReposConfig createRepositoryINFO: Creating the EM repository (this may take a while) ...Aug 29, 2007 9:16:21 AM oracle.sysman.emcp.EMReposConfig invoke INFO: Repository successfully createdAug 29, 2007 9:17:05 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepositoryINFO: Uploading configuration data to EM repository (this may take a while) ... Aug 29, 2007 9:20:57 AM oracle.sysman.emcp.EMReposConfig invoke INFO: Uploaded configuration data successfullyAug 29, 2007 9:21:22 AM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLibINFO: Software library configured successfully.Aug 29, 2007 9:21:22 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibraryINFO: Deploying Provisioning archives ...Aug 29, 2007 9:26:27 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibraryINFO: Provisioning archives deployed successfully.Aug 29, 2007 9:26:27 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsoleINFO: Securing Database Control (this may take a while) ...Aug 29, 2007 9:27:34 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsoleINFO: Database Control secured successfully.Aug 29, 2007 9:27:34 AM oracle.sysman.emcp.util.DBControlUtil startOMS INFO: Starting Database Control (this may take a while) ...Aug 29, 2007 9:36:05 AM oracle.sysman.emcp.EMDBPostConfig performConfigurationINFO: Database Control started successfullyAug 29, 2007 9:36:08 AM oracle.sysman.emcp.EMDBPostConfig performConfigurationINFO: >>>>>>>>>>> The Database Control URL is https://oratest:1158/em <<<<<<<<<<<Aug 29, 2007 9:37:50 AM 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: /oracle11g/product/11g/oratest_test11g/sysman/config/emkey.ora. Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.*********************************************************** Enterprise Manager configuration completed successfullyFINISHED EMCA at Aug 29, 2007 9:37:51 AMemkey.ora是密钥的所在地所以如果在生成系统上还是需要备份好的。