配置oracle11g EM db control

risingsunczl發表於2009-05-11
配置oracle11g EM db control[@more@]

建立一個EM資料庫
emca -repos create
重建一個EM資料庫
emca -repos recreate
刪除一個EM資料庫
emca -repos drop
配置資料庫的 Database Control
emca -config dbcontrol db
刪除資料庫的 Database Control配置
emca -deconfig dbcontrol db
重新配置db control的埠,預設埠在1158
emca -reconfig ports
emca -reconfig ports -dbcontrol_http_port 1160
emca -reconfig ports -agent_port 3940
先設定ORACLE_SID環境變數後,啟動EM console服務
emctl start dbconsole
先設定ORACLE_SID環境變數後,停止EM console服務
emctl stop dbconsole
先設定ORACLE_SID環境變數後,檢視EM console服務的狀態
emctl status dbconsole

配置dbconsole的步驟
emca -repos create
emca -config dbcontrol db
emctl start dbconsole
重新配置dbconsole的步驟
emca -repos drop
emca -repos create
emca -config dbcontrol db
emctl start dbconsole
-------------

oracle從10g以來一直大力推薦dba透過EM來進行管理,不管個人的喜好如何,都不能否認EM還是具有很強的易用性的。

前陣子裝好了11g後,發現oracle11g文件很多快速管理指南的內容都是透過EM來進行的,但我在文件上並沒找到EM的安裝說明,於是試著透過10g的說明來對其進行配置。
從安裝軟體上看,我並沒找到grid control部分,不知道是不是還沒有推出,下面簡單描述一下db control的配置過程以及遇到的幾個問題。
跟10g的方法相仿,oracle11g也可以透過EMCA來配置db control(在裝資料庫時候用dbca可以同時建立em)
登陸oracle使用者,執行emca -h命令後可以看到emca的各種配置引數及選項,具體引數的說明可以參考10g中的說明(可在Introduction to Enterprise Manager Advanced Configuration中找到)。執行emca -config dbcontrol db -repos create,按提示輸入一些配置後,建立過程開始,可惜建到一半後,SYSAUX空間不足,報錯退出了。看來自10G以後SYSAUX空間的要求越來越大了,這裡要注意,不光是sysaux表空間,system表空間也要有足夠的空閒。
擴充套件表空間後執行emca -config dbcontrol db -repos recreate準備重新開始建立,結果剛一開始就報錯退出了,竟然是報沒有tns監聽,lsnrctl status檢查監聽是啟的,用配置的tnsnames連線資料庫也能連上,想了很久後懷疑跟監聽沒有采用動態註冊方式有關,可按道理在一些預設條件達成的情況的下,動態註冊是自動生效的。lsnrctl status命令再看了一下,動態註冊果然沒有啟動,沒辦法只能試試強制指定了,tnsnames裡增加
listener1=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=oratest)(PORT=1521))
)
並指定local_listener=listener1後,動態註冊立即生效了。至於為啥,我不知道,新特性還是bug?以後再說吧(10G沒怎麼玩過,不知道有沒這個問題)
重新執行emca -config dbcontrol db -repos recreate,成功,開始drop以前的配置了,之後一切順利,執行過程及結果訊息如下:
$ emca -config dbcontrol db -repos recreate
STARTED EMCA at Aug 29, 2007 8:40:57 AM
EM Configuration Assistant, Version 11.1.0.5.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: test11g
Listener port number: 1521
Password for SYS 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 ................ /oracle11g/product/11g
Local hostname ................ oratest
Listener port number ................ 1521
Database SID ................ test11g
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Aug 29, 2007 8:41:20 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle11g/cfgtoollogs/emca/test11g/emca_2007_08_29_08_40_56.log.
Aug 29, 2007 8:41:30 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Aug 29, 2007 8:50:26 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Aug 29, 2007 8:50:28 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 29, 2007 9:16:21 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Aug 29, 2007 9:17:05 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Aug 29, 2007 9:20:57 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfullyAug 29, 2007 9:21:22 AM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Aug 29, 2007 9:21:22 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Aug 29, 2007 9:26:27 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Aug 29, 2007 9:26:27 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Aug 29, 2007 9:27:34 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Aug 29, 2007 9:27:34 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Aug 29, 2007 9:36:05 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Aug 29, 2007 9:36:08 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is <<<<<<<<<<<
Aug 29, 2007 9:37:50 AM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************ WARNING ************************
Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted. The encryption key has been placed in the file: /oracle11g/product/11g/oratest_test11g/sysman/config/emkey.ora. Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.
***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 29, 2007 9:37:51 AM
emkey.ora是金鑰的所在地所以如果在生成系統上還是需要備份好的。
$ more /oracle11g/product/11g/oratest_test11g/sysman/config/emkey.ora
KEY=056790FE22685160158605895E3E62FC06D7C153C224D99BAA82236AD677DD962B974B3BDA0A678E9D8278C75662EFEB5A8EB793695A79C131F79B8F8BDBBD03
80955F67D1BFBE675F5E20B9DC6B710A92
都完成之後,執行emctl status dbconsole可以檢視狀態,emctl start dbconsole和emctl stop dbconsole可以對Database Control Console Process進行啟停。預設埠依然跟10G一樣是1158,不過似乎不在支援http,只能用https登陸。我從遠端用ie7登陸的時候會警告證照是錯誤的(linux本地上沒有問題),不用管它,繼續就可以看到em的登陸介面了,呵呵。
介面看起來挺友好的,具體功能有待日後研究。

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

相關文章