Chinaunix首页 | 论坛 | 博客
  • 博客访问: 273905
  • 博文数量: 20
  • 博客积分: 307
  • 博客等级: 入伍新兵
  • 技术积分: 832
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-03 23:52
文章分类

全部博文(20)

文章存档

2013年(18)

2012年(2)

分类: Oracle

2013-01-08 18:05:20

最近搭了个oracle 11G R2 的单机环境。安装完数据库并建好库后发现EMctl 无法启动,提示OC4J_DBConsole_hostname_ORACLESID not found捣鼓了很久 终于找到原因。
当我们做完一件事情的时候,以为自己全都做好了,全身轻松,就像我,当我去启动em的时候,傻眼了!
 
这这。。什么情况啊。。一屏幕的 错误提示。。。冷静 冷静!做我们这行的除了技术,冷静是第一要素啊,否则什么时候不冷静了,可能就出大事啦!出错不要紧,某大师说过一句话:经验都是从错误中积累起来的
 
注意到提示头尾的dbserver1,是环境变量里面的hostname。而hosts文件里面的hostname是oracl.dba.com,所以在设置环境变量的时候的注意相关参数的对应!把两个地方的hostname改成一致后,重启emctl
 
注:此处建议改.bash_profile里面的hostname环境变量,不要改hosts文件,如果改hosts文件,可能会出现更多问题,有兴趣的可以试试哈!而且.bash_profile改完后运行source .bash_profile即可马上生效。
 
 
改了hostname 后,虽然少了很多提示,但还是出现em的相关配置文件not found
此时需要对emcontrol 进行重建,注意数据库要在startup状态下进行重建,否则创建不成功!
[oracle@oracle ~]$ emca -repos recreate
STARTED EMCA at Jan 8, 2013 5:39:24 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: orcl
Listener port number: 1521
Password for SYS user: 
Password for SYSMAN user: 
Do you wish to continue? [yes(Y)/no(N)]: y
Jan 8, 2013 5:39:48 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2013_01_08_17_39_24.log.
Jan 8, 2013 5:39:48 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Jan 8, 2013 5:42:00 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Jan 8, 2013 5:42:01 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
^C[oracle@oracle ~]$ ^C
[oracle@oracle ~]$ emca -config dbcontrol db
STARTED EMCA at Jan 8, 2013 6:03:16 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: orcl
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/db_1 ]:
Password for SYS user: 
Password for DBSNMP user: 
Password for SYSMAN 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/product/11.2.0/db_1
Local hostname ................ oracle.dba.com
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/db_1
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
Jan 8, 2013 6:03:48 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2013_01_08_18_03_16.log.
Jan 8, 2013 6:03:54 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Jan 8, 2013 6:04:50 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Jan 8, 2013 6:04:51 PM oracle.sysman.emcp.ParamsManager getLocalListener
WARNING: Error retrieving listener for oracle.dba.com
Jan 8, 2013 6:04:53 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Jan 8, 2013 6:04:53 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Jan 8, 2013 6:05:22 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Jan 8, 2013 6:05:22 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Jan 8, 2013 6:06:12 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Jan 8, 2013 6:06:12 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jan 8, 2013 6:07:38 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jan 8, 2013 6:07:38 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is <<<<<<<<<<<
Jan 8, 2013 6:07:47 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/product/11.2.0/db_1/oracle.dba.com_orcl/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 successfully
FINISHED EMCA at Jan 8, 2013 6:07:47 PM
[oracle@oracle ~]$ ^C
[oracle@oracle ~]$ emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation.  All rights reserved.

 - An instance of Oracle Enterprise Manager 11g Database Control is already running.
此过程大概需要5-10分钟。
视服务器性能而定!
完成后即可访问EM管理器!!
阅读(10363) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~