2013年7月19日 星期五

Oracle-如何重新安裝Oracle 11g EM


最近有些練習需要開啟Oracle 11g的EM (Enterprise manager)來搭配command line , 所以懶的開開關關 ,所以都用休眠的方式比較快點

最近發現EM怪怪的,首頁的統計圖表都不見看了一下EM 說 agent有點問題,但我也沒特別去理它想說其他功能能使用就好了

今天早上,EM升天了....瀏覽器都開不起來,我想說可能是太久沒重開機的關係 (但事實上無用仍然開不起來) ,啟動都會failed掉,事實上就算去看了它提供給我的路徑下我也不知道要看哪些log .....太多且不知道哪個才是真的有幫助的(如果哪位前被知道的話請指點一下)

以下就是我每次啟動都會一直異常的樣子:

[oracle@oracledb install]$ emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0 
Copyright (c) 1996, 2009 Oracle Corporation.  All rights reserved.
https://oracledb:5500/em/console/aboutApplication
Stopping Oracle Enterprise Manager 11g Database Control ... 
 ...  Stopped. 
[oracle@oracledb install]$ emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0 
Copyright (c) 1996, 2009 Oracle Corporation.  All rights reserved.
https://oracledb:5500/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control ............................................................................................. failed. 
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/oracledb_orcl2/sysman/log 
[oracle@oracledb install]$ 



網路上找了一些方法,但似乎沒甚麼幫助.....
最後只想到要不如重裝EM好了但網上也有一堆五花八門的重裝方式,試了幾個都失敗
最後整合了一下用最簡單的方式來移除及重裝

1.首先先停掉你的EM   SQL> emctl stop dbconsole
2.重置密碼  SQL> alter user sys identified by xxx;   <<(事實上可以不用做這步驟,除非你也忘了密碼)

3.卸載EM 資料庫 > 建立 > 設定

emca -repos drop
emca -repos create
emca -config dbcontrol db

執行以上命令,先卸載EM,並重新安裝。

以下是執行過程

(3-1 )

SQL> emca -repos drop


輸入以下資訊:
資料庫 SID: (請輸入你自己的SID別跟著我呀)
監聽程式埠號: 1521
SYS 用戶的密碼: (請輸入你自己的密碼別跟著我呀)
SYSMAN 用戶的密碼 (請輸入你自己的密碼別跟著我呀)
是否繼續? [yes(Y)/no(N)]: Y

接著要等一小段時間他會卸載掉........

SQL>emca -repos create 

資料庫 SID: (請輸入你自己的SID別跟著我呀)
監聽程式埠號: 1521
SYS 用戶的密碼: (請輸入你自己的密碼別跟著我呀)
SYSMAN 用戶的密碼 (請輸入你自己的密碼別跟著我呀)
是否繼續? [yes(Y)/no(N)]: Y

(基本上整個過程輸入的都差不多)

3-3  emca -config dbcontrol db

SQL>emca -config dbcontrol db


Database SID: orcl2
Database Control is already configured for the database orcl2
You have chosen to configure Database Control for managing the database orcl2
This will remove the existing configuration and the default settings and perform a fresh configuration
Do you wish to continue? [yes(Y)/no(N)]: Y
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/grid ]: 
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 ................ /u01/app/oracle/product/11.2.0/dbhome_1

Local hostname ................ oracledb
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/grid
Listener port number ................ 1521
Database SID ................ orcl2
Email address for notifications ............... 
Outgoing Mail (SMTP) server for notifications ............... 


網路上的朋友說,通常EM會掛掉有幾種可能原因:  

1. 更改網路
2.更改電腦名稱
3.更改IP

但我一樣也沒遇到就掛掉了.....Orz  請大家參考參考吧





沒有留言:

張貼留言