天天看點

Oracle 10g Recreate EM

Oracle10G的EM采用了web方式,并且分成了2個産品,database control和grid control。在使用過程中會因為各種各樣的原因造成EM無法啟動,通過recreate可以解決大部分的問題;使用指令行工具emca可以建立,修改,重建或者删除dbcontrol的配置。而使用指令行工具emctl可以啟動/停止EM console服務,察看服務狀态等。

1.drop configuration files and repository run :

emca -deconfig dbcontrol db -repos drop

2. Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and mangement objects:

SQL> drop user sysman cascade;

SQL> drop role MGMT_USER;

SQL> drop user MGMT_VIEW cascade;

SQL> drop public synonym MGMT_TARGET_BLACKOUTS;

SQL> drop public synonym SETEMVIEWUSERCONTEXT;

3.Create configuration files and repository run

emca -config dbcontrol db -repos create

emca常用指令文法

emca -repos create建立一個EM資料庫

emca -repos recreate重建一個EM資料庫

emca -repos drop删除一個EM資料庫

emca -config dbcontrol db配置資料庫的 Database Control

emca -deconfig dbcontrol db删除資料庫的 Database Control配置

emca -reconfig ports 重新配置db control和agent的端口

注:通過檢視$ORACLE_HOME/install/portlist.ini 檔案可以知道目前dbcontrol正在使用的端口,預設dbcontrol http端口1158,agent端口3938。如果要重新配置端口,可以使用如下指令:

emca -reconfig ports -dbcontrol_http_port 1159

emca -reconfig ports -agent_port 3939

emctl常用指令文法

emctl start dbconsole啟動EM console服務,使用前需要先設定ORACLE_SID環境變量

emctl stop dbconsole停止EM console服務,使用前需要先設定ORACLE_SID環境變量

emctl status dbconsole 檢視EM console服務狀态