Oracle10g中OEM相關(guān)問題
??? 最近要用到OEM,發(fā)現(xiàn)在Linux下面裝的Oracle默認沒有打開console,所以需要手動開啟一下。找了點資料,也遇到了一些困難,就順便學(xué)習(xí)一下相關(guān)的知識。把要記錄的東西都記下來,也把錯誤貼出來,希望可以對別人有所幫助。
?
?
一、啟動和關(guān)閉
以下是啟動過程:
[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
?
以下是關(guān)閉過程:
?
[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作為機器名的,所以以上兩個目錄都是用了這個機器名來創(chuàng)建。之后修改了機器名之后,OEM啟動時就無法找到對應(yīng)的文件夾了,需要手動修改一下名稱:
[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問題
?
啟動的時候會有提示登錄地址,只要按照這個登錄地址就可以了。例如我的地址就是:
?
?
如果OEM已經(jīng)啟動了,可以通過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的所有端口設(shè)置:
?
[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"
具體的操作等以后有空的時候嘗試一下。
?
四、遇到的問題
?
開啟之后發(fā)現(xiàn)部分按鈕的名稱在本地顯示亂碼,而且無法連接到OEM:
?
?
?
?
?
?
?
?
?
?
?
以下轉(zhuǎn)貼以上兩個鏈接,以防失效:
*******************************************************************************************
一直沒怎么用10g的EM工具,今天打開來看看,發(fā)現(xiàn)也有相傳已久的亂碼問題.網(wǎng)上也流傳著N種解決方案,仔細看一下,其實這個問題很好解決.
?
如果安裝時,我們系統(tǒng)環(huán)境變量設(shè)置的是中文環(huá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?
?
清除所有g(shù)if文件即可.然后重新啟動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??
?
現(xiàn)在登陸Web頁面,EM顯示就可以正常顯示中文了.
?
注意:如果經(jīng)過以上處理仍然不能正確顯示中文,請參考以下說明:
?
打開剛替換好的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指向中文字體文件,請確認該文件在你的服務(wù)器上是否存在,如果不存在,改換一個存在的中文字體文件即可,也可以自行下載安裝新的字體文件:
?
?
?
[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(企業(yè)管理器)采用了web方式,也就是直接打開ie瀏覽器,輸入網(wǎng)址就可以訪問oracle,進而可以管理oracle.
?
Oracle10G的EM 分成了2個產(chǎn)品,database control(用于一個database的)和grid contro(用于多個database的)。這里遇到的問題是在database control(用于一個database的)。Grid control據(jù)說需要下載單獨的光盤安裝,這一點也我只是看到其他高手這么說的,我并沒有做過。
?
?
在用DBCA建庫的時候,可以選擇是否啟用dbcontrol,啟用的話需要在數(shù)據(jù)庫中建立一個sysman的schema,用于保存EM的一些數(shù)據(jù),這個就是EM的資料庫(repository)。
?
---摘錄完畢。
?
2.本機的環(huán)境
?
裝oralce 10g之前,忘記了改主機名,這樣一來,是在裝完oracle后,去改的主機名,改完主機名后,還需要去改E:\oracle\product\10.2.0\db_1\network\admin\listener.ora? 這個文件,將其中的老主機名改為新主機名。這是個老問題了,不知道oracle為什么不解決呢?呵呵。
?
二、解決過程:
?
Microsoft Windows XP [版本 5.1.2600]
(C) 版權(quán)所有 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 正式版
版權(quán)所有 (c) 2003, 2005, Oracle。保留所有權(quán)利。
?
輸入以下信息:
數(shù)據(jù)庫 SID: oracle
已為數(shù)據(jù)庫 oracle 配置了 Database Control
您已選擇配置 Database Control, 以便管理數(shù)據(jù)庫 oracle
此操作將移去現(xiàn)有配置和默認設(shè)置, 并重新執(zhí)行配置
是否繼續(xù)? [yes(Y)/no(N)]: y
監(jiān)聽程序端口號: 1521
SYS 用戶的口令:
DBSNMP 用戶的口令:
SYSMAN 用戶的口令:
SYSMAN 用戶的口令: 通知的電子郵件地址 (可選):leiyanliang@inspur.com
通知的發(fā)件 (SMTP) 服務(wù)器 (可選):
-----------------------------------------------------------------
?
已指定以下設(shè)置
?
數(shù)據(jù)庫 ORACLE_HOME ................ E:\oracle\product\10.2.0\db_1
?
數(shù)據(jù)庫主機名 ................ shleiyanliang
監(jiān)聽程序端口號 ................ 1521
數(shù)據(jù)庫 SID ................ oracle
通知的電子郵件地址 ...............leiyanliang@inspur.com
通知的發(fā)件 (SMTP) 服務(wù)器 ............... ?
-----------------------------------------------------------------
是否繼續(xù)? [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
警告: 無法創(chuàng)建 Database Control 快捷方式
2008-11-23 12:08:36 oracle.sysman.emcp.EMDBPostConfig performConfiguration
信息: >>>>>>>>>>> Database Control URL 為http://shleiyanliang:1158/em<<<<<<<<<
<<
已成功完成 Enterprise Manager 的配置
EMCA 結(jié)束于 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
?
應(yīng)該可以理解成database control的日志文件的所在位置吧?呵呵
?
?
?
這個完成之后,當(dāng)時我寫的郵箱:leiyanliang@inspur.com馬上就收到到郵件了,郵件主題如下:
EM_預(yù)警:_嚴(yán)重:_shleiyanliang_-_Filesystem_C:\_has_only_3.35%_available...
郵件內(nèi)容如下: ?
shleiyanliang
類型=Host
主機=shleiyanliang
度量=Filesystem Space Available (%)
Mount Point=C:\
時間戳=2008-11-23 下午12時23分23秒 CST
嚴(yán)重性=嚴(yán)重
消息=Filesystem C:\ has only 3.35% available space
規(guī)則名=Host Availability and Critical States
規(guī)則所有者=SYSMAN
?
實話說,這一點倒是挺好的,可以實時收到oracle自動監(jiān)控的警告信息。
*******************************************************************************************
?
?
?
?