原文地址:配置oracle11g EM dbcontrol作者:蘭博wk
oracle從10g以來一直大力推薦dba通過EM來進行管理,不管個人的喜好如何,都不能否認EM還是具有很強的易用性的。
前陣子裝好了11g後,發現oracle11g文檔很多快速管理指南的內容都是通過EM來進行的,但我在文檔上並沒找到EM的安裝說明,於是試着通過10g的說明來對其進行配置。
從安裝軟件上看,我並沒找到gridcontrol部分,不知道是不是還沒有推出,下面簡單描述一下db control的配置過程以及遇到的幾個問題。
跟10g的方法相仿,oracle11g也可以通過EMCA來配置dbcontrol(在裝數據庫時候用dbca可以同時創建em)
登陸oracle用戶,執行emca-h命令後可以看到emca的各種配置參數及選項,具體參數的說明可以參考10g中的說明(可在Introduction toEnterprise Manager Advanced Configuration中找到)。執行emca -configdbcontrol db -reposcreate,按提示輸入一些配置後,創建過程開始,可惜建到一半後,SYSAUX空間不足,報錯退出了。看來自10G以後SYSAUX空間的要求越來越大了,這裏要注意,不光是sysaux表空間,system表空間也要有足夠的空閒。
擴展表空間後執行emca -config dbcontrol db -reposrecreate準備重新開始創建,結果剛一開始就報錯退出了,竟然是報沒有tns監聽,lsnrctlstatus檢查監聽是啓的,用配置的tnsnames連接數據庫也能連上,想了很久後懷疑跟監聽沒有采用動態註冊方式有關,可按道理在一些缺省條件達成的情況的下,動態註冊是自動生效的。lsnrctlstatus命令再看了一下,動態註冊果然沒有啓動,沒辦法只能試試強制指定了,tnsnames裏增加
listener1=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=oratest)(PORT=1521))
)
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=oratest)(PORT=1521))
)
並指定local_listener=listener1後,動態註冊立即生效了。至於爲啥,我不知道,新特性還是bug?以後再說吧(10G沒怎麼玩過,不知道有沒這個問題)
重新執行emca -config dbcontrol db -reposrecreate,成功,開始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 rightsreserved.
EM Configuration Assistant, Version 11.1.0.5.0 Production
Copyright (c) 2003, 2005, Oracle. All rightsreserved.
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):
-----------------------------------------------------------------
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 ...............
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.EMReposConfiginvoke
INFO: Dropping the EM repository (this may take a while) ...
Aug 29, 2007 8:50:26 AM oracle.sysman.emcp.EMReposConfiginvoke
INFO: Repository successfully dropped
Aug 29, 2007 8:50:28 AM oracle.sysman.emcp.EMReposConfigcreateRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 29, 2007 9:16:21 AM oracle.sysman.emcp.EMReposConfiginvoke
INFO: Repository successfully created
Aug 29, 2007 9:17:05 AM oracle.sysman.emcp.EMReposConfiguploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may takea while) ...
Aug 29, 2007 9:20:57 AM oracle.sysman.emcp.EMReposConfiginvoke
INFO: Uploaded configuration data successfully
Aug 29, 2007 9:21:22 AM oracle.sysman.emcp.util.DBControlUtilconfigureSoftwareLib
INFO: Software library configured successfully.
Aug 29, 2007 9:21:22 AM oracle.sysman.emcp.EMDBPostConfigconfigureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Aug 29, 2007 9:26:27 AM oracle.sysman.emcp.EMDBPostConfigconfigureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Aug 29, 2007 9:26:27 AM oracle.sysman.emcp.util.DBControlUtilsecureDBConsole
INFO: Securing Database Control (this may take a while) ...
Aug 29, 2007 9:27:34 AM oracle.sysman.emcp.util.DBControlUtilsecureDBConsole
INFO: Database Control secured successfully.
Aug 29, 2007 9:27:34 AM oracle.sysman.emcp.util.DBControlUtilstartOMS
INFO: Starting Database Control (this may take a while) ...
Aug 29, 2007 9:36:05 AM oracle.sysman.emcp.EMDBPostConfigperformConfiguration
INFO: Database Control started successfully
Aug 29, 2007 9:36:08 AM oracle.sysman.emcp.EMDBPostConfigperformConfiguration
INFO:>>>>>>>>>>>The Database Control URL is https://oratest:1158/em<<<<<<<<<<<
Aug 29, 2007 9:37:50 AM oracle.sysman.emcp.EMDBPostConfiginvoke
WARNING:
************************ WARNING ************************
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.EMReposConfiginvoke
INFO: Dropping the EM repository (this may take a while) ...
Aug 29, 2007 8:50:26 AM oracle.sysman.emcp.EMReposConfiginvoke
INFO: Repository successfully dropped
Aug 29, 2007 8:50:28 AM oracle.sysman.emcp.EMReposConfigcreateRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 29, 2007 9:16:21 AM oracle.sysman.emcp.EMReposConfiginvoke
INFO: Repository successfully created
Aug 29, 2007 9:17:05 AM oracle.sysman.emcp.EMReposConfiguploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may takea while) ...
Aug 29, 2007 9:20:57 AM oracle.sysman.emcp.EMReposConfiginvoke
INFO: Uploaded configuration data successfully
Aug 29, 2007 9:21:22 AM oracle.sysman.emcp.util.DBControlUtilconfigureSoftwareLib
INFO: Software library configured successfully.
Aug 29, 2007 9:21:22 AM oracle.sysman.emcp.EMDBPostConfigconfigureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Aug 29, 2007 9:26:27 AM oracle.sysman.emcp.EMDBPostConfigconfigureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Aug 29, 2007 9:26:27 AM oracle.sysman.emcp.util.DBControlUtilsecureDBConsole
INFO: Securing Database Control (this may take a while) ...
Aug 29, 2007 9:27:34 AM oracle.sysman.emcp.util.DBControlUtilsecureDBConsole
INFO: Database Control secured successfully.
Aug 29, 2007 9:27:34 AM oracle.sysman.emcp.util.DBControlUtilstartOMS
INFO: Starting Database Control (this may take a while) ...
Aug 29, 2007 9:36:05 AM oracle.sysman.emcp.EMDBPostConfigperformConfiguration
INFO: Database Control started successfully
Aug 29, 2007 9:36:08 AM oracle.sysman.emcp.EMDBPostConfigperformConfiguration
INFO:>>>>>>>>>>>The Database Control URL is https://oratest:1158/em<<<<<<<<<<<
Aug 29, 2007 9:37:50 AM oracle.sysman.emcp.EMDBPostConfiginvoke
WARNING:
************************ WARNING ************************
Management Repository has been placed in secure mode whereinEnterprise Manager data will be encrypted. Theencryption 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 willbecome unusable if this file is lost.
***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 29, 2007 9:37:51 AM
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
$ more/oracle11g/product/11g/oratest_test11g/sysman/config/emkey.ora
KEY=056790FE22685160158605895E3E62FC06D7C153C224D99BAA82236AD677DD962B974B3BDA0A678E9D8278C75662EFEB5A8EB793695A79C131F79B8F8BDBBD03
80955F67D1BFBE675F5E20B9DC6B710A92
都完成之後,執行emctl status dbconsole可以查看狀態,emctl startdbconsole和emctl stop dbconsole可以對Database Control ConsoleProcess進行啓停。缺省端口依然跟10G一樣是1158,不過似乎不在支持http,只能用https登陸。我從遠程用ie7登陸的時候會警告證書是錯誤的(linux本地上沒有問題),不用管它,繼續就可以看到em的登陸界面了,呵呵。
界面看起來挺友好的,具體功能有待日後研究。