本帖最后由 zhenjiang412518 于 2014-8-29 18:59 编辑
一、测试环境中遇到的问题:
1、由于EM不能正常访问,于是执行以下语句成功删除EMemca -deconfig dbcontrol db -repos drop
2、执行dbca重建EM,创建结束后提示下面信息
QQ截图20140829165302.png (36.62 KB, 下载次数: 10)
2014-8-29 18:16 上传
3、根据提示配置密钥提示无法访问emkey.ora
[oracle@DG ~]$ emctl config emkey -repos -sysman_pwd 123456
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
The Em Key could not be configured. The Em Key was not found in Management Repository.
[oracle@DG config]$ emctl config emkey -emkeyfile /oracle/product/11.2.0/db_1/DG_prim/sysman/config/emkey.ora
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Please enter repository password:
The Em Key could not be configured. Unable to access file /oracle/product/11.2.0/db_1/DG_prim/sysman/config/emkey.ora.
[oracle@DG config]$
4、系统上不存在emkey.ora这个文件,我手动创建之后再执行emctl config 报错
[oracle@DG config]$ touch emkey.ora
[oracle@DG config]$ emctl config emkey -emkeyfile /oracle/product/11.2.0/db_1/DG_prim/sysman/config/emkey.ora -force
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Please enter repository password:
Exception caught
null
java.lang.NullPointerException
at oracle.sysman.emSDK.conf.ConfigManager.readEmKeyFromFile(ConfigManager.java:444)
at oracle.sysman.eml.sec.rep.EmKeyUtil.configEmKeyFile(EmKeyUtil.java:317)
at oracle.sysman.eml.sec.rep.EmKeyUtil.main(EmKeyUtil.java:518)
[oracle@DG config]$
5、重新配置dbconsole问题依旧
[oracle@DG config]$ emca -config dbcontrol db
STARTED EMCA at Aug 29, 2014 6:02:47 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: prim
Database Control is already configured for the database prim
You have chosen to configure Database Control for managing the database prim
This will remove the existing configuration and the default settings and perform a fresh configuration
Do you wish to continue? [yes(Y)/no(N)]: y
Listener ORACLE_HOME [ /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 ................ /oracle/product/11.2.0/db_1
Local hostname ................ DG
Listener ORACLE_HOME ................ /oracle/product/11.2.0/db_1
Listener port number ................ 1521
Database SID ................ prim
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Aug 29, 2014 6:03:10 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/cfgtoollogs/emca/prim/emca_2014_08_29_18_02_47.log.
Aug 29, 2014 6:03:11 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Aug 29, 2014 6:03:25 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Aug 29, 2014 6:04:58 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Aug 29, 2014 6:05:12 PM oracle.sysman.emcp.util.DBControlUtil copyEmkeyToRepos
SEVERE: Error copying Em Key to Management Repository. The Em Key is not configured properly or is corrupted in the file system and does not exist in the Management Repository. To correct the problem:
1) Copy the emkey.ora file from another OMS or backup machine to the /oracle/product/11.2.0/db_1/sysman/config and run following commands:
i) /oracle/product/11.2.0/db_1/bin/emctl config emkey -emkeyfile /oracle/product/11.2.0/db_1/sysman/config/emkey.ora -force
ii) /oracle/product/11.2.0/db_1/bin/emctl config emkey -copy_to_repos
iii) Run EM Configuration Assistant again
2) If emkey.ora is not available from backup, run /oracle/product/11.2.0/db_1/bin/emca with -repos create option.
Aug 29, 2014 6:05:12 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Error copying Em Key to Management Repository. The Em Key is not configured properly or is corrupted in the file system and does not exist in the Management Repository. To correct the problem:
1) Copy the emkey.ora file from another OMS or backup machine to the /oracle/product/11.2.0/db_1/sysman/config and run following commands:
i) /oracle/product/11.2.0/db_1/bin/emctl config emkey -emkeyfile /oracle/product/11.2.0/db_1/sysman/config/emkey.ora -force
ii) /oracle/product/11.2.0/db_1/bin/emctl config emkey -copy_to_repos
iii) Run EM Configuration Assistant again
2) If emkey.ora is not available from backup, run /oracle/product/11.2.0/db_1/bin/emca with -repos create option.
Refer to the log file at /oracle/cfgtoollogs/emca/prim/emca_2014_08_29_18_02_47.log for more details.
Could not complete the configuration. Refer to the log file at /oracle/cfgtoollogs/emca/prim/emca_2014_08_29_18_02_47.log for more details.
二、生产环境中遇到的问题:
1、重建EM完毕后提示要配置安全密钥
[oracle@DB1 cfgtoollogs]$ emca -config dbcontrol db -repos create
EMCA 开始于 2014-8-28 13:14:11
EM Configuration Assistant, 11.2.0.0.2 正式版
版权所有 (c) 2003, 2005, Oracle。保留所有权利。
输入以下信息:
数据库 SID: orcl
监听程序端口号: 1521
监听程序 ORACLE_HOME [ /opt/oracle/product/11.2.0 ]:
SYS 用户的口令:
DBSNMP 用户的口令:
SYSMAN 用户的口令:
通知的电子邮件地址 (可选):
通知的发件 (SMTP) 服务器 (可选):
-----------------------------------------------------------------
已指定以下设置
数据库 ORACLE_HOME ................ /opt/oracle/product/11.2.0
本地主机名 ................ DB1
监听程序 ORACLE_HOME ................ /opt/oracle/product/11.2.0
监听程序端口号 ................ 1521
数据库 SID ................ orcl
通知的电子邮件地址 ...............
通知的发件 (SMTP) 服务器 ...............
-----------------------------------------------------------------
是否继续? [是(Y)/否(N)]: Y
2014-8-28 13:14:40 oracle.sysman.emcp.EMConfig perform
信息: 正在将此操作记录到 /opt/oracle/cfgtoollogs/emca/DB1/emca_2014_08_28_13_14_10.log。
2014-8-28 13:14:40 oracle.sysman.emcp.EMReposConfig createRepository
信息: 正在创建 EM 资料档案库 (此操作可能需要一段时间)...
2014-8-28 13:19:42 oracle.sysman.emcp.EMReposConfig invoke
信息: 已成功创建资料档案库
2014-8-28 13:19:44 oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
信息: 正在将配置数据上载到 EM 资料档案库 (此操作可能需要一段时间)...
2014-8-28 13:20:53 oracle.sysman.emcp.EMReposConfig invoke
信息: 已成功上载配置数据
2014-8-28 13:20:55 oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
信息: 软件库已配置成功。
2014-8-28 13:20:55 oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
信息: 正在部署预配档案...
2014-8-28 13:20:58 oracle.sysman.emcp.util.PlatformInterface executeCommand
警告: 执行 /opt/oracle/product/11.2.0/bin/PARDeploy -action deploy -parDir /opt/oracle/product/11.2.0/sysman/prov/paf -force 时出错
2014-8-28 13:20:58 oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
信息: 预配档案部署失败。请手动部署预配档案。
2014-8-28 13:20:58 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
信息: 正在保护 Database Control (此操作可能需要一段时间)...
2014-8-28 13:21:00 oracle.sysman.emcp.util.PlatformInterface executeCommand
警告: 执行 /opt/oracle/product/11.2.0/bin/emctl config emkey -repos 时出错
2014-8-28 13:21:00 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
警告: 配置 EM-Key 失败。
2014-8-28 13:21:00 oracle.sysman.emcp.EMDBPostConfig performConfiguration
警告: 保护 Database control 时出错。
2014-8-28 13:21:00 oracle.sysman.emcp.EMDBPostConfig setWarnMsg
信息: 保护 Database Control 时出错, Database Control 已在非安全模式下启动。要保护 Database Control, 请执行以下命令:
1) 将环境变量 ORACLE_SID 设置为 orcl
2) /opt/oracle/product/11.2.0/bin/emctl stop dbconsole
3) /opt/oracle/product/11.2.0/bin/emctl config emkey -repos -sysman_pwd < SYSMAN 用户的口令 >
4) /opt/oracle/product/11.2.0/bin/emctl secure dbconsole -sysman_pwd < SYSMAN 用户的口令 >
5) /opt/oracle/product/11.2.0/bin/emctl start dbconsole
要保护 EM 密钥, 请运行 /opt/oracle/product/11.2.0/bin/emctl config emkey -remove_from_repos -sysman_pwd < SYSMAN 用户的口令 >
2014-8-28 13:21:00 oracle.sysman.emcp.util.DBControlUtil startOMS
信息: 正在启动 Database Control (此操作可能需要一段时间)...
2014-8-28 13:21:11 oracle.sysman.emcp.EMDBPostConfig performConfiguration
信息: 已成功启动 Database Control
2014-8-28 13:21:11 oracle.sysman.emcp.EMDBPostConfig performConfiguration
信息: >>>>>>>>>>> Database Control URL 为 http://DB1:5500/em <<<<<<<<<<<
2、根据提示配置密钥却提示密码无效,但是这密码确实是之前设置的密码啊,使用sqlplus也能正常登陆
[oracle@DB1 cfgtoollogs]$ emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
http://DB1:5500/em/console/aboutApplication
Stopping Oracle Enterprise Manager 11g Database Control ...
... Stopped.
[oracle@DB1 cfgtoollogs]$ emctl config emkey -repos -sysman_pwd 3nManY]
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Invalid Password
[oracle@DB1 cfgtoollogs]$ sqlplus sysman/3nManY]
SQL*Plus: Release 11.2.0.1.0 Production on Thu Aug 28 13:25:25 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
我已经前后重建EM很多次了,真心不知道怎么解决了,百度谷歌许久,也没找到解决方法,请问大家应该怎么解决,谢谢!