Decode360's Blog

业精于勤而荒于嬉 QQ:150355677 MSN:decode360@hotmail.com

  BlogJava :: 首页 :: 新随笔 :: 联系 ::  :: 管理 ::
  397 随笔 :: 33 文章 :: 29 评论 :: 0 Trackbacks
Oracle10g中OEM相关问题

    最近要用到OEM,发现在Linux下面装的Oracle默认没有打开console,所以需要手动开启一下。找了点资料,也遇到了一些困难,就顺便学习一下相关的知识。把要记录的东西都记下来,也把错误贴出来,希望可以对别人有所帮助。
 
 
一、启动和关闭

以下是启动过程:

[oracle@wxq ~]$ emctl start dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.3.0 
Copyright (c) 1996, 2006 Oracle Corporation.  All rights reserved.
http://wxq.mydomain:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ................................. started.
------------------------------------------------------------------
Logs are generated in directory /opt/oracle/product/10.2.0/db_1/wxq.mydomain_devMISowb/sysman/log

 
以下是关闭过程:
 
[oracle@wxq ~]$ emctl stop dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.3.0 
Copyright (c) 1996, 2006 Oracle Corporation.  All rights reserved.
http://wxq.mydomain:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ......  Stopped.
 
 
在第一次启动的时候,遇到了一个问题,就是报错
[oracle@wxq ~]$ emctl start dbconsole
TZ set to PRC
OC4J Configuration issue. /opt/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_wxq.mydomain_devMISowb not found.
[oracle@wxq ~]$ emctl start dbconsole
TZ set to PRC
EM Configuration issue. /opt/oracle/product/10.2.0/db_1/wxq.mydomain_devMISowb not found.
 
原因是在安装Oracle的时候是使用localhost.localdomain作为机器名的,所以以上两个目录都是用了这个机器名来创建。之后修改了机器名之后,OEM启动时就无法找到对应的文件夹了,需要手动修改一下名称:
[oracle@wxq j2ee]$ mv OC4J_DBConsole_localhost.localdomain_devMISowb/ OC4J_DBConsole_wxq.mydomain_devMISowb
[oracle@wxq db_1]$ mv localhost.localdomain_devMISowb/ wxq.mydomain_devMISowb
 
 
二、登录OEM问题
 
启动的时候会有提示登录地址,只要按照这个登录地址就可以了。例如我的地址就是:
http://wxq.mydomain:1158/em/
 
 
如果OEM已经启动了,可以通过emctl status dbconsole命令来查看:
 
[oracle@wxq ~]$ emctl status dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.3.0 
Copyright (c) 1996, 2006 Oracle Corporation.  All rights reserved.
http://wxq.mydomain:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory /opt/oracle/product/10.2.0/db_1/wxq.mydomain_devMISowb/sysman/log

 
还可以通过以下文件查看Oracle的所有端口设置:
 
[oracle@wxq ~]$ cat /opt/oracle/product/10.2.0/db_1/install/portlist.ini
iSQL*Plus HTTP port number =5560
Enterprise Manager Console HTTP Port (devMISowb) = 1158
Enterprise Manager Agent Port (devMISowb) = 1831

 
三、emctl的其他操作
 
直接输入emctl命令来查看emctl可以做的所有操作:
 
[oracle@wxq ~]$ emctl
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.3.0 
Copyright (c) 1996, 2006 Oracle Corporation.  All rights reserved.
Invalid arguments
 
Unknown command option
Usage::
   Oracle Enterprise Manager 10g Database Control commands:
       emctl start| stop| status| setpasswd dbconsole
       emctl secure <options>
 
       emctl set ssl test|off|on em
       emctl set ldap <host> <port> <user dn> <user pwd> <context dn>
emctl blackout options can be listed by typing "emctl blackout"
emctl config options can be listed by typing "emctl config"
emctl secure options can be listed by typing "emctl secure"
emctl ilint  options can be listed by typing "emctl ilint"
emctl deploy  options can be listed by typing "emctl deploy"

具体的操作等以后有空的时候尝试一下。
 

四、遇到的问题
 
开启之后发现部分按钮的名称在本地显示乱码,而且无法连接到OEM
 
OEM
 
乱码问题具体的解决办法可以参考:http://www.eygle.com/archives/2006/03/oracle10g_em_font_change.html
 
无法连接的问题可以参见:http://space.itpub.net/161195/viewspace-501482
 
 
 
 
 
 
 
 
以下转贴以上两个链接,以防失效:
*******************************************************************************************
Oracle10g EM乱码之快速解决
作者:eygle |English Version 【转载时请以超链接形式标明文章出处和作者信息及本声明】
链接:
http://www.eygle.com/archives/2006/03/oracle10g_em_font_change.html
--------------------------------------------------------------------------------
一直没怎么用10g的EM工具,今天打开来看看,发现也有相传已久的乱码问题.网上也流传着N种解决方案,仔细看一下,其实这个问题很好解决.
 
如果安装时,我们系统环境变量设置的是中文环境,那么就不会有这个问题.这个问题根本原因在于安装时,JDK/JRE字符集的自动选择.
 
在 $ORACLE_HOME/jdk/jre/lib 和 $ORACLE_HOME/jre/1.4.2/lib/ 目录下都有多种字符集字体配置文件:
 
[oracle@danaly ~]$ cd $ORACLE_HOME/jdk/jre/lib[oracle@danaly lib]$ ls font*zh_CN*font.properties.zh_CN.Redhat  font.properties.zh_CN.Redhat2.1  font.properties.zh_CN.Sun  font.properties.zh_CN_UTF8.Sun[oracle@danaly lib]$ cd $ORACLE_HOME/jre/1.4.2/lib/[oracle@danaly lib]$ ls font*zh_CN*font.properties.zh_CN.Redhat  font.properties.zh_CN.Redhat2.1  font.properties.zh_CN.Sun  font.properties.zh_CN_UTF8.Sun 
 
我们只要用合适的中文字符集文件替换缺省文件即可,我选择使用font.properties.zh_CN.Redhat来替换缺省字体定义文件:
 
[oracle@danaly lib]$ cp font.properties.zh_CN.Redhat font.properties 
 
替换之后需要清理一下Cache,重启EM即可.
 
Cache路径通常位于:
 
$ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs 
 
清除所有gif文件即可.然后重新启动EM:
 
[oracle@danaly zhs]$ emctl stop dbconsoleTZ set to PRCoracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  Copyright (c) 1996, 2005 oracle Corporation.  All rights reserved.http://danaly.hurrray.com.cn:1158/em/console/aboutApplicationStopping oracle Enterprise Manager 10g Database Control ...  ...  Stopped. [oracle@danaly zhs]$ emctl start dbconsoleTZ set to PRCoracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  Copyright (c) 1996, 2005 oracle Corporation.  All rights reserved.http://danaly.hurrray.com.cn:1158/em/console/aboutApplicationStarting oracle Enterprise Manager 10g Database Control .............. started. ------------------------------------------------------------------Logs are generated in directory /opt/oracle/product/10.2.0/danaly.hurrray.com.cn_danaly/sysman/log  
 
现在登陆Web页面,EM显示就可以正常显示中文了.
 
注意:如果经过以上处理仍然不能正确显示中文,请参考以下说明:
 
打开刚替换好的font.properties,或者查看原有的中文字体文件:
 

[oracle@smsdbrac1 lib]$ tail -2 font.properties.zh_CN.Redhat
filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/zh_CN/TrueType/zysong.ttf
注意其中包含了filename指向中文字体文件,请确认该文件在你的服务器上是否存在,如果不存在,改换一个存在的中文字体文件即可,也可以自行下载安装新的字体文件:
 
 
 
[oracle@smsdbrac1 lib]$ ls -al /usr/share/fonts/zh_CN/TrueType/zysong.ttf
-rw-r--r--  1 root root 9249332 Mar 29  2002 /usr/share/fonts/zh_CN/TrueType/zysong.ttf
 
*******************************************************************************************
 
主机名改名后oracle database control 无法启动的问题
上一篇 / 下一篇  2008-11-23 12:13:33 / 个人分类:oracle管理
 
查看( 366 ) / 评论( 2 ) / 评分( 0 / 0 )
一、简介:
 
1.概念
 
Oracle10G的EM(企业管理器)采用了web方式,也就是直接打开ie浏览器,输入网址就可以访问oracle,进而可以管理oracle.
 
Oracle10G的EM 分成了2个产品,database control(用于一个database的)和grid contro(用于多个database的)。这里遇到的问题是在database control(用于一个database的)。Grid control据说需要下载单独的光盘安装,这一点也我只是看到其他高手这么说的,我并没有做过。
 
下面一段话摘自http://www.cublog.cn/u/25565/showart_268270.html,十分感谢这位高手。
 
在用DBCA建库的时候,可以选择是否启用dbcontrol,启用的话需要在数据库中建立一个sysman的schema,用于保存EM的一些数据,这个就是EM的资料库(repository)。
 
---摘录完毕。
 
2.本机的环境
 
装oralce 10g之前,忘记了改主机名,这样一来,是在装完oracle后,去改的主机名,改完主机名后,还需要去改E:\oracle\product\10.2.0\db_1\network\admin\listener.ora  这个文件,将其中的老主机名改为新主机名。这是个老问题了,不知道oracle为什么不解决呢?呵呵。
 
二、解决过程:
 
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
 
C:\Documents and Settings\Administrator>emctl
Environment variable ORACLE_SID not defined. Please define it.
 
C:\Documents and Settings\Administrator>set oracle_sid=oracle
 
C:\Documents and Settings\Administrator>emctl
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
Invalid arguments
 
Unknown command option
Usage::
   Oracle Enterprise Manager 10g Database Control commands:
       emctl start| stop| status| setpasswd dbconsole
       emctl secure <options>
 
       emctl set ssl test|off|on em
       emctl set ldap <host> <port> <user dn> <user pwd> <context dn>
emctl blackout options can be listed by typing "emctl blackout"
emctl config options can be listed by typing "emctl config"
emctl secure options can be listed by typing "emctl secure"
emctl ilint  options can be listed by typing "emctl ilint"
emctl deploy  options can be listed by typing "emctl deploy"
 
C:\Documents and Settings\Administrator>emctl start dbconsole
Unable to determine local host from URL REPOSITORY_URL=http://shleiyanliang:%EM_
UPLOAD_PORT%/em/upload/
.
 
C:\Documents and Settings\Administrator>emca -config dbcontrol db
 
EMCA 开始于 2008-11-23 12:07:02
EM Configuration Assistant 10.2.0.1.0 正式版
版权所有 (c) 2003, 2005, Oracle。保留所有权利。
 
输入以下信息:
数据库 SID: oracle
已为数据库 oracle 配置了 Database Control
您已选择配置 Database Control, 以便管理数据库 oracle
此操作将移去现有配置和默认设置, 并重新执行配置
是否继续? [yes(Y)/no(N)]: y
监听程序端口号: 1521
SYS 用户的口令:
DBSNMP 用户的口令:
SYSMAN 用户的口令:
SYSMAN 用户的口令: 通知的电子邮件地址 (可选):leiyanliang@inspur.com
通知的发件 (SMTP) 服务器 (可选):
-----------------------------------------------------------------
 
已指定以下设置
 
数据库 ORACLE_HOME ................ E:\oracle\product\10.2.0\db_1
 
数据库主机名 ................ shleiyanliang
监听程序端口号 ................ 1521
数据库 SID ................ oracle
通知的电子邮件地址
...............leiyanliang@inspur.com
通知的发件 (SMTP) 服务器 ...............
 
-----------------------------------------------------------------
是否继续? [yes(Y)/no(N)]: y
2008-11-23 12:07:43 oracle.sysman.emcp.EMConfig perform
信息: 正在将此操作记录到 E:\oracle\product\10.2.0\db_1\cfgtoollogs\emca\oracle\e
mca_2008-11-23_12-07-01-下午.log。
2008-11-23 12:07:47 oracle.sysman.emcp.util.DBControlUtil stopOMS
信息: 正在停止 Database Control (此操作可能需要一段时间)...
2008-11-23 12:07:56 oracle.sysman.emcp.util.DBControlUtil startOMS
信息: 正在启动 Database Control (此操作可能需要一段时间)...
2008-11-23 12:08:36 oracle.sysman.emcp.EMDBPostConfig performConfiguration
信息: 已成功启动 Database Control
2008-11-23 12:08:36 oracle.sysman.emcp.EMDBPostConfig performConfiguration
警告: 无法创建 Database Control 快捷方式
2008-11-23 12:08:36 oracle.sysman.emcp.EMDBPostConfig performConfiguration
信息: >>>>>>>>>>> Database Control URL 为
http://shleiyanliang:1158/em<<<<<<<<<
<<
已成功完成 Enterprise Manager 的配置
EMCA 结束于 2008-11-23 12:08:36
 
C:\Documents and Settings\Administrator>emctl status dbconcole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
Invalid arguments
 
Unknown command option status
Usage::
   Oracle Enterprise Manager 10g Database Control commands:
       emctl start| stop| status| setpasswd dbconsole
       emctl secure <options>
 
       emctl set ssl test|off|on em
       emctl set ldap <host> <port> <user dn> <user pwd> <context dn>
emctl blackout options can be listed by typing "emctl blackout"
emctl config options can be listed by typing "emctl config"
emctl secure options can be listed by typing "emctl secure"
emctl ilint  options can be listed by typing "emctl ilint"
emctl deploy  options can be listed by typing "emctl deploy"
 
C:\Documents and Settings\Administrator>emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://shleiyanliang:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory E:\oracle\product\10.2.0\db_1/shleiyanliang_oracle/sysman/log
 
C:\Documents and Settings\Administrator>
 
------------------到此完毕!------------------
 
最后一句话:
 
Logs are generated in directory E:\oracle\product\10.2.0\db_1/shleiyanliang_oracle/sysman/log
 
应该可以理解成database control的日志文件的所在位置吧?呵呵
 
 
 
这个完成之后,当时我写的邮箱:leiyanliang@inspur.com马上就收到到邮件了,邮件主题如下:
EM_预警:_严重:_shleiyanliang_-_Filesystem_C:\_has_only_3.35%_available...
邮件内容如下:
 
shleiyanliang
类型=Host
主机=shleiyanliang
度量=Filesystem Space Available (%)
Mount Point=C:\
时间戳=2008-11-23 下午12时23分23秒 CST
严重性=严重
消息=Filesystem C:\ has only 3.35% available space
规则名=Host Availability and Critical States
规则所有者=SYSMAN
 
实话说,这一点倒是挺好的,可以实时收到oracle自动监控的警告信息。
*******************************************************************************************
 
 
 
 
posted on 2009-08-28 21:56 decode360 阅读(1835) 评论(0)  编辑  收藏 所属分类: 07.Oracle

只有注册用户登录后才能发表评论。


网站导航: