OEM 控制臺是運行在HTTP服務(wù)器上的web頁面(非常方便,可以遠(yuǎn)程管理),該HTTP服務(wù)器將作為Grid Control 安裝的一部分安裝和配置,沒有任何客戶端安裝。 將中心 Console、多個代理、公共服務(wù)以及工具結(jié)為一體,提供一個集成的綜合性系統(tǒng)管理平臺,管理 Oracle 數(shù)據(jù)庫環(huán)境,因此Oracle公司大力推薦DBA們使用EM來進(jìn)行管理Oracle。
使用 Oracle Enterprise Manager Console,可以執(zhí)行以下任務(wù):
·管理、診斷和調(diào)整多個遠(yuǎn)程系統(tǒng)。
·在多個節(jié)點上,按不同的時間間隔調(diào)度作業(yè)。
·監(jiān)視整個網(wǎng)絡(luò)范圍內(nèi)的服務(wù)和事件。
·管理管理員,實現(xiàn) Oracle Enterprise Manager 管理員間的信息共享。
·將遠(yuǎn)程系統(tǒng)分組組織,便于管理和監(jiān)視。
·管理 Oracle Parallel Server。
·從任何一個授權(quán)位置上通過 Management Server 管理您的數(shù)據(jù)庫網(wǎng)絡(luò)。
·管理集成使用的 Oracle 和第三方工具。
使用命令行工具emca可以創(chuàng)建,修改,重建或者刪除dbcontrol的配置。
SQL > select * from v$version
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
由于要在數(shù)據(jù)庫中建EM資料庫,數(shù)據(jù)庫和監(jiān)聽都必須已經(jīng)啟動并正常工作。
配置dbcontrol(如果你提前配置的話,啟動emctl 等命令會出現(xiàn)錯誤DB Console start error:OC4J Configuration issue滴)
[oracle~]$ emca -config dbcontrol db
STARTED EMCA at Aug 16, 2010 3:50:49 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: blogbench
Listener port number: 1521
Listener ORACLE_HOME [ /mnt/ddb/1/app/oracle/product/11.2.0/dbhome_1 ]:
Password for SYS user:
Password for DBSNMP 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 ................ /mnt/ddb/1/app/oracle/product/11.2.0/dbhome_1
Local hostname ................ %%%
Listener ORACLE_HOME ................ /mnt/ddb/1/app/oracle/product/11.2.0/dbhome_1
Listener port number ................ 1521
Database SID ................ ceshi
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Aug 16, 2010 3:51:35 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /mnt/ddb/1/app/oracle/cfgtoollogs/emca/blogbench/emca_2010_08_16_15_50_48.log.
Aug 16, 2010 3:51:36 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Aug 16, 2010 3:52:18 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Aug 16, 2010 3:52:20 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Aug 16, 2010 3:52:20 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Aug 16, 2010 3:52:42 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Aug 16, 2010 3:52:42 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Aug 16, 2010 3:52:56 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Aug 16, 2010 3:52:56 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Aug 16, 2010 3:53:13 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Aug 16, 2010 3:53:13 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://%%%:1158/em <<<<<<<<<<<
Aug 16, 2010 3:53:15 PM oracle.sysman.emcp.EMDBPostConfig invoke
***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 16, 2010 3:53:15 PM
配置完畢后就可以登錄https://%%%:1158/em(這個我記得以前Oracle 10g的時候支持的可是http協(xié)議,看來11g在安全性上又做了相應(yīng)的提升)進(jìn)行管理數(shù)據(jù)庫了,可以查看數(shù)據(jù)庫的很多運行狀態(tài)。
其他常用的命令語法:
emca -repos create創(chuàng)建一個EM資料庫
emca -repos recreate重建一個EM資料庫 (可以解決OracleService*、OracleDBConsole*無法啟動的問題)
emca -repos drop刪除一個EM資料庫
emca -config dbcontrol db配置數(shù)據(jù)庫的Database Control
emca -deconfig dbcontrol db刪除數(shù)據(jù)庫的Database Control配置
emca -reconfig ports重新配置db control和agent的端口
emctl start console啟動EM console服務(wù),使用前需要先設(shè)置ORACLE_SID環(huán)境變量
emctl stop console停止EM console服務(wù),使用前需要先設(shè)置ORACLE_SID環(huán)境變量
emctl status console查看EM console的服務(wù)狀態(tài),使用前需要先設(shè)置ORACLE_SID環(huán)境變量
注:通過查看$ORACLE_HOME/install/readme文件可以知道當(dāng)前dbcontrol正在使用的端口,默認(rèn)dbcontrol http端口1158,agent端口3938。如果要重新配置端口,可以使用如下命令:
emca -reconfig ports -dbcontrol_http_port 1159
emca -reconfig ports -agent_port 3939
使用命令行工具emctl可以啟動/停止console服務(wù),察看服務(wù)狀態(tài)等。
配置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