主機名改名後oracle database control 無法啟動的問題

msdnchina發表於2008-11-23

一、簡介:

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

       emctl set ssl test|off|on em
       emctl set ldap
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=%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 使用者的口令: 通知的電子郵件地址 (可選):

通知的發件 (SMTP) 伺服器 (可選):
-----------------------------------------------------------------

已指定以下設定

資料庫 ORACLE_HOME ................ E:\oracle\product\10.2.0\db_1

資料庫主機名 ................ shleiyanliang
監聽程式埠號 ................ 1521
資料庫 SID ................ oracle
通知的電子郵件地址 ...............

通知的發件 (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 為
<<<<<<<<<
<<
已成功完成 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

       emctl set ssl test|off|on em
       emctl set ldap
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.

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的日誌檔案的所在位置吧?呵呵

 

這個完成之後,當時我寫的郵箱:馬上就收到到郵件了,郵件主題如下:
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自動監控的警告資訊。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/161195/viewspace-501482/,如需轉載,請註明出處,否則將追究法律責任。

相關文章