来源:http://blog.itpub.net/9034054/viewspace-1973418/
静默安装完Oracle 11g R2后,发现EM无法启用,检查后发现原来EM还未安装…....没办法,只好手动安装。
首先用emca命令清除em的相关配置:
1、使用emca删除配置
[oracle@redhat ~]$ emca -deconfig dbcontrol db
2、使用emca删除repository
[oracle@redhat ~]$ emca -repos drop
清除步骤一定要做,否则可能会遇到各种奇怪的报错,如ORA-20001: SYSMAN already exists..
如果发现有ORA-12541: TNS:no listener,一定要检查lsnrctl是否启动,如果不能启动,检查$ORACLE_HOME/network/admin下的lisener.ora和tnsnames.ora是否正确。
查看监听程序的状态:
[oracle@redhat ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0- Production on 21-JUL-2010 18:18:19
Copyright (c) 1991, 2009, Oracle. Allrights reserved.
Connecting to(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
StartDate 21-JUL-2010 00:49:58
Uptime 0 days 17 hr. 28 min. 20 sec
TraceLevel off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/redhat/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status READY, has 1 handler(s) for thisservice...
Service "ORCLXDB" has 1 instance(s).
Instance "ORCL", status READY, has 1 handler(s) for thisservice...
The command completed successfully
3、配置EM
使用emca创建Database Control
[oracle@redhat ~]$ emca -config dbcontrol db -repos create
输入以下信息:
数据库 SID: ORCL
监听程序端口号: 1521
SYS 用户的口令:
DBSNMP 用户的口令:
SYSMAN 用户的口令:
通知的电子邮件地址 (可选):
通知的发件 (SMTP) 服务器 (可选):
-----------------------------------------------------------------
已指定以下设置
数据库 ORACLE_HOME ................ F:/oracle/product/10.2.0/db_1
数据库主机名 ................ redhat
监听程序端口号 ................ 1521
数据库 SID ................ ORCL
通知的电子邮件地址 ...............
通知的发件 (SMTP) 服务器...............
-----------------------------------------------------------------
启动em:
[oracle@redhat ~]$ emctl start dbconsole
还是报错,发现是因为密码文件不存在,于是重建密码文件:
[oracle@redhat ~]$ orapwd file=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwORCL password=oracle entries=10
给SYS赋予权限:
SQL> grant sysdba to sys;
查看权限是否正常:
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS
------------------------------ ---------- --------- ----------
SYS TRUE TRUE FALSE
再次启动EM。OK,成功了:
[oracle@redhat ~]$ emctl start dbconsole
Oracle Enterprise Manager 11gDatabase Control Release 11.2.0.4.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
https://redhat:1158/em/console/aboutApplication
- An instance of Oracle Enterprise Manager 11g Database Control is already running
接下来就可以通过https访问em:
https://redhat:1158/em/console //Oracle 11g R2必须用https
接下来又有问题了,按钮是乱码。根本原因是:安装产品时没有额外增加简体中文支持。谷歌了一下,里有两种解决办法:
1、将windows中的字体导入到java中。
2、打开IE浏览器,选择'工具"-->Internet选项-->常规
选择“语言”,默认只有“中文”,选择“添加”,加入英语(美国),调整顺序,把”英语(美国)“放到最上面。
我选择的后者。
这样,久违的em终于出来了: