【OEM】OEM安裝維護
各位技術愛好者,看完本文後,你可以掌握如下的技能,也可以學到一些其它你所不知道的知識,~O(∩_∩)O~:
① oem安裝和維護
② OEM各種錯誤解決
Tips:
① 若文章代碼格式有錯亂,推薦使用搜狗、QQ或360浏覽器,也可以下載pdf格式的文檔來查看,pdf文檔下載地址:http://yunpan.cn/cdEQedhCs2kFz (提取碼:ed9b)
② 本篇BLOG中命令的輸出部分需要特別關注的地方我都用灰色背景和粉紅色字體來表示,比如下邊的例子中,thread 1的最大歸檔日志號為33,thread 2的最大歸檔日志號為43是需要特別關注的地方;而命令一般使用黃色背景和紅色字體標注;對代碼或代碼輸出部分的注釋一般采用藍色字體表示。
List of Archived Logs in backup set 11
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ------------------- ---------- ---------
1 32 1621589 2015-05-29 11:09:52 1625242 2015-05-29 11:15:48
1 33 1625242 2015-05-29 11:15:48 1625293 2015-05-29 11:15:58
2 42 1613951 2015-05-29 10:41:18 1625245 2015-05-29 11:15:49
2 43 1625245 2015-05-29 11:15:49 1625253 2015-05-29 11:15:53
[ZFXXDB1:root]:/>lsvg -o
T_XDESK_APP1_vg
rootvg
[ZFXXDB1:root]:/>
00:27:22 SQL> alter tablespace idxtbs read write;
====》2097152*512/1024/1024/1024=1G
本文如有錯誤或不完善的地方請大家多多指正,ITPUB留言或QQ皆可,您的批評指正是我寫作的最大動力。
我安裝過幾次EM,出現過很多問題,幾經周折,總結了如下的內容,實在不能解決就重新創建吧,重新創建可以解決99%的問題,這裡把需要注意的一些前提列出來:
1. 數據庫必須使用服務器模式的,不能使用客戶端模式的,客戶端模式有很多文件不存在(從$ORACLE_HOME的db_1或者client_1也可以識別)
2. 數據庫服務器的ip地址必須是靜態的,不能是dhcp動態獲取,動態獲取可能導致em運行緩慢,還可能導致服務器ip地址改變等問題,也可能導致em啟動後又自動關閉等問題
3. 數據庫服務器的hostname不能隨便修改,修改後em肯定不能用了
4. 安裝過程中出現問題的時候認真查看日志,安裝日志路徑:$ORACLE_HOME/cfgtoollogs\emca\
5. OEM運行日志:$ORACLE_HOME/$hostname_$oracle_sid/sysman/log
6. 建議重新創建,在oracle用戶下:
單機: emca -config dbcontrol db -repos recreate
集群: emca -config dbcontrol db -repos recreate -cluster
若是集群環境,則在創建之前先在grid用戶下執行如下代碼:
-----sqlplus / as sysasm ASM實例 GRID 用戶下執行
SYS@+ASM1> create user asmsnmp identified by xxx;
SYS@+ASM1> grant sysdba to asmsnmp;
SYS@+ASM1> alter user asmsnmp identified by xxx;
SYS@+ASM1> alter system set remote_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ZFXDESKDB-scan)(PORT=1521))))' sid='*';
SYS@+ASM1> alter system register;
7. 啟動和關閉維護命令,oracle用戶下:export ORACLE_UNQNAME=$DB_UNIQUE_NAME ,數據庫唯一名,進程:ps -ef| grep em
啟動: emctl stop dbconsole
關閉: emctl stop dbconsole
運行狀態:emctl status dbconsole
8. Rac集群環境在其中一個節點上安裝,其他節點也可以查詢,為EM Daemon,如:
[ZFXDESKDB2:oracle]:/oracle>export ORACLE_UNQNAME=oraESKDB
[ZFXDESKDB2:oracle]:/oracle>emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved.
https://ZFXDESKDB1:1158/em/console/aboutApplication
EM Daemon is running.
------------------------------------------------------------------
Logs are generated in directory /oracle/app/oracle/product/11.2.0/db/zfxdeskdb2_oraESKDB/sysman/log
Oracle 10g企業管理器(Oracle Enterprise Manager)簡稱OEM,是一個基於Java的框架系統,該系統集成了多個組件,為用戶提供了一個功能強大的圖形用戶界面。
1. OEM的功能
(1) 管理完整的Oracle 10g環境,包括數據庫、iAS服務器、應用程序和服務。
(2) 診斷、修改和優化多個數據庫。
(3) 在多個系統上,按不同的時間間隔調度服務。
(4) 通過網絡管理數據庫的約束條件。
(5) 管理來自不同位置的多個網絡節點和服務。
(6) 和其他管理員共享任務。
(7) 將相關的服務組合在一起,便於對任務的管理。
(8) 啟動集成的Oracle10g第三方工具。
2. OEM的管理工具
(1) 例程管理。對數據庫執行以下管理操作:
① 查看和編輯實例(Instance)參數值。
② 管理用戶會話,查看當前運行的SQL及其解釋計劃。
③ 管理分布式Internet計算環境中沒有及時解決的事務處理沖突。
④ 監視需要長時間運行的操作。
⑤ 通過資源計劃控制處理資源。
⑥ 管理已存儲配置。
⑦ 管理占用資源數量最多的鎖和會話。
OEM的管理工具
(2) 方案管理。使用方案管理器來管理方案對象,如表、索引、視圖和觸發器等。利用它可以實現下列功能:
① 創建方案對象。
② 修改方案對象。
③ 刪除方案對象。
④ 顯示方案對象的相關性。
(3) 安全管理。DBA使用安全管理器可以完成以下操作:
① 創建用戶、角色和概要文件。
② 修改用戶、角色和概要文件。
③ 刪除用戶、角色和概要文件。
④ 向數據庫用戶授予權限和角色。
2. OEM的管理工具
(4) 存儲管理。使用存儲管理器可管理表空間、回滾段、數據文件和重做日
志等存儲對象。利用它可以進行以下操作:
① 創建存儲對象。
② 將數據文件和回滾段添加到表空間中。
③ 刪除存儲對象。
④ 將對象脫機或聯機。
⑤ 顯示對象的相關性。
創建一個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_Home/install/portlist.ini>
配置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
emctl start dbconsole -----啟動控制台服務
emctl stop dbconsole -----關閉控制台服務
emctl status dbconsole -----查看控制台服務狀態
命令如下:
emca -config dbcontrol db -repos recreate ---建議重新創建
emca -config dbcontrol db -repos create
emca -repos drop
emca -deconfig dbcontrol db
drop user sysman cascade;
drop role MGMT_USER;
drop user MGMT_VIEW cascade;
先設置ORACLE_SID環境變量後,停止EM console服務
emctl stop dbconsole
先設置ORACLE_SID環境變量後,查看EM console服務的狀態
emctl status dbconsole
[oracle@rhel_linux_asm ~]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
http://192.168.128.131:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is not running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/192.168.128.131_orclasm/sysman/log
[oracle@rhel_linux_asm ~]$
先設置ORACLE_SID環境變量後,啟動EM console服務
emctl start dbconsole
[oracle@rhel_linux_asm ~]$ emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
http://192.168.128.131:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control .................. started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/192.168.128.131_orclasm/sysman/log
[oracle@rhel_linux_asm ~]$
訪問浏覽器:http://192.168.128.131:1158/em/
這個說明監聽沒有啟動
1、 打開cmd,輸入 emctl start dbconsole
將會有錯誤信息提示,如果沒有設置ORACLE_SID 則提示
Environment variable ORACLE_SID not defined. Please define it.
(設置ORACLE_SID:打開cmd,輸入set ORACLE_SID=orcl(實例名),即可)
解決方案:
1. EM Configuration issue. c:\app\Administrator\product\11.2.0\dbhome_1/lhr_$oracle_unqname not found.
辦法:set oracle_unqname=$oracle_sid
2. OC4JConfigurationissue.c:\app\Administrator\product\11.2.0\dbhome_1/oc4j/j2ee/OC4J_DBConsole_lhr_$oracle_sid not found.
辦法:set oracle_sid=orcl
3. OC4JConfigurationissue.c:\app\Administrator\product\11.2.0\dbhome_1/oc4j/j2ee/OC4J_DBConsole_mcfg.sandai.net_orcl not found.
4. Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name
解決方法:
在啟動的時候先設置一下: set oracle_unqname=$ORACLE_SID
重建oem吧,可能你的oem根本就沒有建立吧。。。。
該問題的意思就是不能加載CompEMdbconsole.pm 文件,去相應的目錄看看有沒有,沒有的話就到其它地方拷貝文件過來吧。locate 就是 位於,查找。。。。的意思,,,,,英語呀
[oracle@lhr_linux ~]$ emctl
Can't locate CompEMdbconsole.pm in @INC (@INC contains: %s_javapOracleHome%/sysman/admin/scripts %s_javapOracleHome%/bin /u01/app/oracle/product/11.2.0/client_1/perl/lib/5.10.0/i686-linux-thread-multi /u01/app/oracle/product/11.2.0/client_1/perl/lib/5.10.0 /u01/app/oracle/product/11.2.0/client_1/perl/lib /u01/app/oracle/product/11.2.0/client_1/perl/lib/site_perl/5.10.0/i686-linux-thread-multi /u01/app/oracle/product/11.2.0/client_1/perl/lib/site_perl/5.10.0 /u01/app/oracle/product/11.2.0/client_1/perl/lib/site_perl /u01/app/oracle/product/11.2.0/client_1/perl/libwww-perl/lib /u01/app/oracle/product/11.2.0/client_1/perl/ext/POSIX /u01/app/oracle/product/11.2.0/client_1/perl/URI /u01/app/oracle/product/11.2.0/client_1/perl/HTML_Parser /u01/app/oracle/product/11.2.0/client_1/perl/HTML-Parser/lib /u01/app/oracle/product/11.2.0/client_1/sysman/admin/scripts /u01/app/oracle/product/11.2.0/client_1/bin /u01/app/oracle/product/11.2.0/client_1/sysman/admin/scripts/Net-DNS-0.48/lib/ /u01/app/oracle/product/11.2.0/client_1/sysman/admin/scripts/libnet-1.19/ .) at /u01/app/oracle/product/11.2.0/client_1/bin/EmctlCommon.pm line 638.
1. Can't locate CompEMdbconsole.pm in @INC造成的問題
Set the environment correctly for the Database ORACLE_HOME:
Unix:
export ORACLE_HOME=
export ORACLE_SID=
export PATH=$ORACLE_HOME/bin:$PATH
$ORACLE_HOME/bin: emctl start dbconsole
Windows:
set ORACLE_HOME=
set ORACLE_SID=
set PATH=$ORACLE_HOME\bin:$PATH
$ORACLE_HOME\bin: emctl start dbconsole
我看了下目錄$ORACLE_HOME\bin文件 perl模塊沒有,可能解壓出問題,由於perl是跨平台的語言,直接找個相應的版本復制一下,把comp和db開頭的pm復制到$ORACLE_HOME\bin下,大約9個文件吧,或者把pm文件全部拷貝過去吧,大約34個文件
2.由於ip地址改動的問題EM報
[oracle@localhost bin]$ emctl status
EM Configuration issue. /opt/oracle/product/11.2.0/db_1/localhost.localdomain_ocmdb not found.
問題表現如下:
[oracle@xbfye7l01 db_home]$ emca -config dbcontrol db
………………
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Aug 15, 2012 9:45:48 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_15_09_45_23.log.
Aug 15, 2012 9:45:49 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Listener is not up or database service is not registered with it. Start the Listener and register database service and run EM Configuration Assistant again .
Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_15_09_45_23.log for more details.
Could not complete the configuration. Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_15_09_45_23.log for more details.
[oracle@xbfye7l01 db_home]$
查看日志:
[oracle@xbfye7l01 db_home]$ tail -100 /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_15_09_45_23.log
g 15, 2012 9:45:49 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly
CONFIG: SQLEngine created successfully and connected
Aug 15, 2012 9:45:49 AM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
CONFIG: ORA-12541: TNS:no listener
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-12541: TNS:no listener
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1650)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeSql(SQLEngine.java:1898)
at oracle.sysman.emcp.ParamsManager.checkListenerStatusForDBControl(ParamsManager.java:3230)
at oracle.sysman.emcp.EMReposConfig.unlockMGMTAccount(EMReposConfig.java:1000)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:345)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:157)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:253)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:589)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1448)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:573)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:521)
Aug 15, 2012 9:45:49 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Listener is not up or database service is not registered with it. Start the Listener and register database service and run EM Configuration Assistant again .
Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_15_09_45_23.log for more details.
Aug 15, 2012 9:45:49 AM oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Listener is not up or database service is not registered with it. Start the Listener and register database service and run EM Configuration Assistant again .
at oracle.sysman.emcp.ParamsManager.checkListenerStatusForDBControl(ParamsManager.java:3245)
at oracle.sysman.emcp.EMReposConfig.unlockMGMTAccount(EMReposConfig.java:1000)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:345)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:157)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:253)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:589)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1448)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:573)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:521)
Aug 15, 2012 9:45:49 AM oracle.sysman.emcp.EMConfig restoreOuiLoc
CONFIG: Restoring oracle.installer.oui_loc to /apps/product/11.2.0/db_home/oui
解決辦法:
最後檢查是因為修改Hostname,但hosts文件以及監聽未及時修改所致,於是調整完各個參數,保持一至後,發現仍然報同樣的錯誤,又檢查發現數據庫V$session中的機器名還是原來的hostname,所以重啟數據庫,機器後一樣,但總的問題沒有解決。於是重啟了機器,該問題解決。但出現了第二個問題,在下面將進行解決。
問題表現1:
[oracle@xbfye7l01 ~]$ emca -config dbcontrol db
Do you wish to continue? [yes(Y)/no(N)]: Y
Aug 16, 2012 9:06:21 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_06_08.log.
Aug 16, 2012 9:06:23 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Failed to unlock all EM-related accounts
Aug 16, 2012 9:06:23 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Failed to unlock all EM-related accounts
Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_06_08.log for more details.
Could not complete the configuration. Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_06_08.log for more details.
[oracle@xbfye7l01 ~]$
查看日志:
[root@xbfye7l01 ~]# tail -100 /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_06_08.log
………………
CONFIG: Couldn't execute statement: ORA-01403: no data found
ORA-06512: at "SYSMAN.MGMT_VIEW_PRIV", line 41
ORA-06512: at line 1 (DBD NO_DATA: OCIStmtExecute) at /apps/product/11.2.0/db_home/sysman/admin/scripts/emca/emcaDbUtil.pl line 129, <STDIN> line 2.
Aug 16, 2012 9:06:23 AM oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: Error executing /apps/product/11.2.0/db_home/sysman/admin/scripts/emca/emcaDbUtil /apps/product/11.2.0/db_home/perl/lib:/apps/product/11.2.0/db_home/perl/lib/site_perl:/apps/product/11.2.0/db_home/sysman/admin/scripts:/apps/product/11.2.0/db_home/bin: /apps/product/11.2.0/db_home/perl/bin/perl /apps/product/11.2.0/db_home/sysman/admin/scripts/emca/emcaDbUtil.pl /apps/product/11.2.0/db_home (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xbfye7l01)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=E7DEV))) SYS SYSDBA declare repos_pwd varchar2(30); view_user varchar2(30); view_user_pwd varchar2(30); view_user_acc_status varchar2(30); begin repos_pwd := ?; sysman.mgmt_view_priv.get_view_user(view_user); select account_status into view_user_acc_status from sys.dba_users where upper(username) = upper ( view_user ); IF view_user_acc_status like '%LOCKED%' THEN execute immediate 'alter user ' || view_user || ' account unlock'; END IF; IF view_user_acc_status like '%EXPIRED%' THEN sysman.mgmt_view_priv.set_view_user_creds ( repos_pwd ); sysman.mgmt_view_priv.GET_VIEW_USER_CREDS ( view_user, view_user_pwd ); execute immediate 'alter user ' || view_user || ' identified by ' || view_user_pwd || ''; END IF; end; E7DEV 1 SYSMAN_PWD
Aug 16, 2012 9:06:23 AM oracle.sysman.emcp.EMReposConfig unlockMGMTAccount
CONFIG: Failed to unlock mgmt_view account
Aug 16, 2012 9:06:23 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Failed to unlock all EM-related accounts
Aug 16, 2012 9:06:23 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Failed to unlock all EM-related accounts
Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_06_08.log for more details.
Aug 16, 2012 9:06:23 AM oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Failed to unlock all EM-related accounts
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:348)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:157)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:253)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:589)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1448)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:573)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:521)
Aug 16, 2012 9:06:23 AM oracle.sysman.emcp.EMConfig restoreOuiLoc
CONFIG: Restoring oracle.installer.oui_loc to /apps/product/11.2.0/db_home/oui
[root@xbfye7l01 ~]#
[oracle@xbfye7l01 ~]$ emca -config dbcontrol db -repos create
Do you wish to continue? [yes(Y)/no(N)]: Y
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_12_41.log.
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_repos_create_<date>.log for more details.
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_12_41.log for more details.
Could not complete the configuration. Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_12_41.log for more details.
[oracle@xbfye7l01 ~]$
查看日志:
[root@xbfye7l01 ~]# tail -50 /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_12_41.log
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.util.GeneralUtil isLocalConnectionRequired
CONFIG: isLocalConnectionRequired: true
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngine
CONFIG: isLocalConnectionRequired: true. Connecting to database instance locally.
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly
CONFIG: SQLEngine connecting with SID: E7DEV, oracleHome: /apps/product/11.2.0/db_home, and user: SYS
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly
CONFIG: SQLEngine created successfully and connected
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMReposConfig createRepository
CONFIG: Spooling to /apps/cfgtoollogs/emca/E7DEV/emca_repos_create_2012_08_16_09_12_57.log
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMReposConfig createRepository
CONFIG: ORA-20001: SYSMAN already exists..
ORA-06512: at line 17
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-20001: SYSMAN already exists..
ORA-06512: at line 17
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1650)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:1000)
at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:339)
at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:380)
at oracle.sysman.emcp.EMReposConfig.createRepository(EMReposConfig.java:510)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:228)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:157)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:253)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:589)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1448)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:573)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:521)
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_repos_create_<date>.log for more details.
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_12_41.log for more details.
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Error creating the repository
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:240)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:157)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:253)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:589)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1448)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:573)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:521)
Aug 16, 2012 9:12:57 AM oracle.sysman.emcp.EMConfig restoreOuiLoc
CONFIG: Restoring oracle.installer.oui_loc to /apps/product/11.2.0/db_home/oui
[root@xbfye7l01 ~]#
再次嘗試:
[oracle@xbfye7l01 ~]$ emca -repos create
STARTED EMCA at Aug 16, 2012 9:23:21 AM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: E7DEV
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: Y
Aug 16, 2012 9:23:36 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_23_21.log.
Aug 16, 2012 9:23:36 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 16, 2012 9:23:36 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Aug 16, 2012 9:23:36 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_repos_create_<date>.log for more details.
Aug 16, 2012 9:23:36 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_23_21.log for more details.
Could not complete the configuration. Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_23_21.log for more details.
[oracle@xbfye7l01 ~]$
1.執行下面的一系統刪除命令:
這裡其實可以用重建的命令,emca -config dbcontrol db -repos recreate ---建議重新創建,
這樣就不會報這種錯誤了
由於之前操作過一次,所以部分報不存在,第一次刪除時均正常
SQL> drop user sysman cascade;
User dropped.
SQL> drop role MGMT_USER;
Role dropped.
SQL> drop user MGMT_VIEW cascade;
drop user MGMT_VIEW cascade
*
ERROR at line 1:
ORA-01918: user 'MGMT_VIEW' does not exist
SQL> drop public synonym MGMT_TARGET_BLACKOUTS;
Synonym dropped.
SQL> drop public synonym SETEMVIEWUSERCONTEXT;
drop public synonym SETEMVIEWUSERCONTEXT
*
ERROR at line 1:
ORA-01432: public synonym to be dropped does not exist
2. 重建測試,問題依然存在。
[oracle@xbfye7l01 ~]$ emca -repos create
STARTED EMCA at Aug 16, 2012 9:30:15 AM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: E7DEV
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: Y
Aug 16, 2012 9:30:24 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_30_15.log.
Aug 16, 2012 9:30:24 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 16, 2012 9:31:37 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Aug 16, 2012 9:31:37 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_repos_create_<date>.log for more details.
Aug 16, 2012 9:31:37 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_30_15.log for more details.
Could not complete the configuration. Refer to the log file at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_30_15.log for more details.
[oracle@xbfye7l01 ~]$
3. 刪除數據庫的 Database Control配置
[oracle@xbfye7l01 ~]$ emca -deconfig dbcontrol db
STARTED EMCA at Aug 16, 2012 9:46:37 AM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: E7DEV
Do you wish to continue? [yes(Y)/no(N)]: Y
Aug 16, 2012 9:46:42 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_46_36.log.
Aug 16, 2012 9:46:42 AM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 16, 2012 9:46:42 AM
[oracle@xbfye7l01 ~]$
4. 刪除EM資料庫
[oracle@xbfye7l01 ~]$ emca -repos drop
STARTED EMCA at Aug 16, 2012 9:47:09 AM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: E7DEV
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: Y
Aug 16, 2012 9:47:18 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_47_09.log.
Aug 16, 2012 9:47:18 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Aug 16, 2012 9:47:56 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 16, 2012 9:47:56 AM
[oracle@xbfye7l01 ~]$
5.對EM資料庫和Database Control重新創建。
[oracle@xbfye7l01 ~]$ emca -config dbcontrol db -repos create
STARTED EMCA at Aug 16, 2012 9:48:35 AM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: E7DEV
Listener port number: 1521
Listener ORACLE_HOME [ /apps/product/11.2.0/db_home ]:
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 ................ /apps/product/11.2.0/db_home
Local hostname ................ xbfye7l01
Listener ORACLE_HOME ................ /apps/product/11.2.0/db_home
Listener port number ................ 1521
Database SID ................ E7DEV
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Aug 16, 2012 9:48:54 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /apps/cfgtoollogs/emca/E7DEV/emca_2012_08_16_09_48_35.log.
Aug 16, 2012 9:48:54 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 16, 2012 9:51:56 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Aug 16, 2012 9:51:58 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Aug 16, 2012 9:52:26 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Aug 16, 2012 9:52:29 AM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Aug 16, 2012 9:52:29 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Aug 16, 2012 9:52:47 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Aug 16, 2012 9:52:47 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Aug 16, 2012 9:54:05 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Aug 16, 2012 9:54:05 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Aug 16, 2012 9:54:26 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Aug 16, 2012 9:54:26 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://xbfye7l01:1158/em <<<<<<<<<<<
Aug 16, 2012 9:54:28 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: /apps/product/11.2.0/db_home/xbfye7l01_E7DEV/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 16, 2012 9:54:28 AM
[oracle@xbfye7l01 ~]$
此次操作成功,問題得到解決,經測試https://xbfye7l01:1158/em登陸正常。
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
OC4J Configuration issue. /u01/app/oracle/product/11.2.0/client_1/oc4j/j2ee/OC4J_DBConsole_Error occurred during initialization of VM
java.lang.Error: Properties init: Could not determine current working directory._orcllinux not found.
當前的操作目錄已經不存在了或者已經刪掉重建了,所以切換到任意一個存在的目錄即可。。。。
一次安裝過程中我殺掉了進程後使用命令重建就報錯了,這個時候手動清理一下相關用戶和下邊對象重建就可以了。
drop user sysman cascade;
drop role MGMT_USER;
drop user MGMT_VIEW cascade;
OEM不能正常訪問:
解決方案:
1. 修改$ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/WEB-INF/uix-config.xml文件,將inaccessible改成accessible
2. 然後重啟EM就可以了;
網上有很多解決辦法的,或者使用火狐浏覽器就可以了。
Internet-->常規-->語言,添加“英語(美國) [en_us]”,並將其移動到第一個,再訪問em登陸界面,即可正常(英文)。
修改後:
在實踐過程中,發現oracle em控制台原先是中文的,菜單翻譯的並不准確,不如英文的好對應管理,因此,需要修改linux系統的語言配置,將菜單改為英文,查到的參考網文如下:
http://www.blogjava.net/parable-myth/archive/2006/09/27/72331.html
http://www.linuxidc.com/Linux/2008-04/12265.htm
http://www.linuxsky.org/doc/newbie/200707/84.html
http://lavasoft.blog.51cto.com/62575/155329
實際的配置過程比較簡單,為了減少對系統其他用戶的影響,將/etc/sysconfig下面的i18n配置文件,拷貝到root用戶目錄下,命令是:cp /etc/sysconfig/i18n $root/.i18n
修改此文件,LANG="en_US.UTF-8",xwindow會顯示英文界面,
經過此修改後,再重啟系統,root用戶的默認語言即為英語,打開em控制台也變成英文界面了。
em的亂碼是由java引起的,em的按鈕是由java生成的圖,oracle 11g使用的是jdk1.5,jdk1.5以後有了一個簡便方法來解決這個問題。
$ mkdir $ORACLE_HOME/jdk/jre/lib/fonts/fallback
把windows下的字體文件simsun.ttc復制到$ORACLE_HOME/jdk/jre/lib/fonts/fallback目錄下 並改名 simsun.ttf(注意ms的simsun字體是有版權的,所以商用換其他字體),相應的權限改為oracle用戶可用.
之後需要清理一下Cache,重啟EM即可:
$ rm $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs/*.gif
$ emctl stop dbconsole
$ emctl start dbconsole
登陸Web頁面查看,EM顯示就可以正常顯示中文了
第一步和第二步我沒找見相關的字體,但是後邊的我做完後重啟後就可以正常顯示字體了。。。
1 修改jdk 下面的字體
[oracle@dbserver db_1]$ cd $ORACLE_HOME/jdk/jre/lib/
[oracle@dbserver lib]$ mv font.properties font.properties_bak
[oracle@racdbserver lib]$
[oracle@dbserver lib]$ cp font.properties.zh_CN.Redhat font.properties
[oracle@dbserver lib]$
2 修改jre 下面的字體
[oracle@dbserver lib]$ cd $ORACLE_HOME/jre/1.4.2/lib
[oracle@dbserver lib]$ mv font.properties font.properties_bak
[oracle@dbserver lib]$ cp font.properties.zh_CN.Redhat font.properties
3 添加簡體中文字體庫
在/usr/share/fonts目錄下創建zh_CN/TrueType目錄(如果目錄不存在時),並將zysong.ttf文件復制到新目錄下
[oracle@dbserver lib]$ cd /usr/share/fonts;
[oracle@dbserver lib]$ mkdir -p zh_CN/TrueType;
[oracle@dbserver lib]$ cp /opt/zysong.ttf /usr/share/fonts/zh_CN/TrueType;
沒有這個文件的話,可以到http://download.csdn.net/download/luohu_aispace/2640175下載。將zysong.ttf文件屬主授權給oracle用戶和oinstall用戶組
[oracle@dbserver lib]$ chown -R oracle:oinstall zysong.ttf;
4 清除em的cache
[oracle@dbserver lib]$ cd $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs
[oracle@dbserver zhs]$ rm *.gif
5 重新啟動em
[oracle@dbserver bin]$ cd $ORACLE_HOME/bin
[oracle@dbserver bin]$ emctl stop dbconsole
[oracle@dbserver bin]$ emctl start dbconsole
將 192.168.128.134 修改為:192.168.59.130
注意:
① 修改ip地址之後,還應該把/etc/hosts文件中的地址也修改了
② 重新啟動linux
[oracle@rhel6_lhr ~]$ emctl status dbconsole
EM Configuration issue. /u01/app/oracle/product/11.2.0/dbhome_1/192.168.59.130_orclasm not found.
OC4J Configuration issue. /u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_192.168.59.130_orclasm not found.
解決辦法:
第一步:
重新配置之前需要把正在運行的OEM停掉,執行emctl stop dbconsole,如果報錯,就設置下環境變量:export ORACLE_HOSTNAME=192.168.128.134,這裡的ip就是配置之前的老的ip地址。
第二步,執行:
mv /u01/app/oracle/product/11.2.0/dbhome_1/192.168.128.134_orclasm /u01/app/oracle/product/11.2.0/dbhome_1/192.168.59.130_orclasm
mv /u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_192.168.128.134_orclasm /u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_192.168.59.130_orclasm
最後還是沒有解決,還是刪掉重建吧:emca -config dbcontrol db -repos recreate
今天打開EM發現提示
ORA-28001: the password has expired (DBD ERROR: OCISessionBegin)
於是查找了一下資料,密碼過期導致EM無法登錄。ORACLE11G默認的口令期限是180天,為了永久解決這個問題只能修改配置文件。
1、查看目前數據庫中的口令期限
SYS@ orcl>select * from dba_profiles where profile='DEFAULT'
2 and resource_name='PASSWORD_LIFE_TIME';
PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- ------------------------------------------------
DEFAULT PASSWORD_LIFE_TIME PASSWORD 180
2、修改成無限制的
SYS@ orcl>alter profile default limit password_life_time unlimited;
3、查看em的兩個賬號狀態sysman和dbsnmp
SYS@ orcl>select username,account_status from dba_users;
USERNAME ACCOUNT_STATUS
------------------------------ --------------------------------
TEST OPEN
TEST2 OPEN
SCOTT OPEN
HR OPEN
ORACLE_OCM EXPIRED & LOCKED
XS$NULL EXPIRED & LOCKED
BI EXPIRED & LOCKED
PM EXPIRED & LOCKED
MDDATA EXPIRED & LOCKED
IX EXPIRED & LOCKED
SH EXPIRED & LOCKED
USERNAME ACCOUNT_STATUS
------------------------------ --------------------------------
DIP EXPIRED & LOCKED
OE EXPIRED & LOCKED
APEX_PUBLIC_USER EXPIRED & LOCKED
SPATIAL_CSW_ADMIN_USR EXPIRED & LOCKED
SPATIAL_WFS_ADMIN_USR EXPIRED & LOCKED
DBSNMP EXPIRED
SYSMAN EXPIRED
4、2個賬號都過期,於是修改密碼
SYS@ orcl>alter user dbsnmp identified by oracle;
User altered.
SYS@ orcl>alter user sysman identified by oracle;
User altered.
5、再重新打開EM,能夠正常使用了。在修改密碼前我重新啟動過數據庫和EM
命令如下:
emca -config dbcontrol db -repos recreate ---建議重新創建
emca -config dbcontrol db -repos create
然後會出現以下信息:
C:\Users\Administrator>emctl start dbconsole
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to da
tabase unique name.
C:\Users\Administrator>emca -config dbcontrol db -repos recreate
EMCA 開始於 2012-3-12 16:28:39
EM Configuration Assistant, 11.2.0.0.2 正式版
版權所有 (c) 2003, 2005, Oracle。保留所有權利。
輸入以下信息:
數據庫 SID: orcl
監聽程序端口號: 1521
監聽程序 ORACLE_HOME [ c:\app\Administrator\product\11.2.0\dbhome_1 ]:
SYS 用戶的口令:
DBSNMP 用戶的口令:
SYSMAN 用戶的口令:
SYSMAN 用戶的口令: 通知的電子郵件地址 (可選):
通知的發件 (SMTP) 服務器 (可選):
-----------------------------------------------------------------
已指定以下設置
數據庫 ORACLE_HOME ................ c:\app\Administrator\product\11.2.0\dbhome_1
本地主機名 ................ lhr
監聽程序 ORACLE_HOME ................ c:\app\Administrator\product\11.2.0\dbhome
_1
監聽程序端口號 ................ 1521
數據庫 SID ................ orcl
通知的電子郵件地址 ...............
通知的發件 (SMTP) 服務器 ...............
-----------------------------------------------------------------
是否繼續? [是(Y)/否(N)]: y
2012-3-12 16:31:41 oracle.sysman.emcp.EMConfig perform
信息: 正在將此操作記錄到 c:\app\Administrator\cfgtoollogs\emca\orcl\emca_2012_03
_12_16_28_39.log。
2012-3-12 16:31:44 oracle.sysman.emcp.EMReposConfig invoke
信息: 正在刪除 EM 資料檔案庫 (此操作可能需要一段時間)...
2012-3-12 16:35:22 oracle.sysman.emcp.EMReposConfig invoke
信息: 已成功刪除資料檔案庫
2012-3-12 16:35:23 oracle.sysman.emcp.EMReposConfig createRepository
信息: 正在創建 EM 資料檔案庫 (此操作可能需要一段時間)...
2012-3-12 16:42:47 oracle.sysman.emcp.EMReposConfig invoke
信息: 已成功創建資料檔案庫
2012-3-12 16:42:58 oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
信息: 正在將配置數據上載到 EM 資料檔案庫 (此操作可能需要一段時間)...
2012-3-12 16:45:05 oracle.sysman.emcp.EMReposConfig invoke
信息: 已成功上載配置數據
2012-3-12 16:45:25 oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
信息: 軟件庫已配置成功。
2012-3-12 16:45:25 oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
信息: 正在部署預配檔案...
2012-3-12 16:46:42 oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
信息: 預配檔案部署成功。
2012-3-12 16:46:42 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
信息: 正在保護 Database Control (此操作可能需要一段時間)...
2012-3-12 16:46:56 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
信息: 已成功保護 Database Control。
2012-3-12 16:46:56 oracle.sysman.emcp.util.DBControlUtil startOMS
信息: 正在啟動 Database Control (此操作可能需要一段時間)...
2012-3-12 16:50:05 oracle.sysman.emcp.EMDBPostConfig performConfiguration
信息: 已成功啟動 Database Control
2012-3-12 16:50:06 oracle.sysman.emcp.EMDBPostConfig performConfiguration
信息: >>>>>>>>>>> Database Control URL 為 https://lhr:5501/em <<<<<<<<<<<
2012-3-12 16:50:24 oracle.sysman.emcp.EMDBPostConfig invoke
警告:
************************ WARNING ************************
管理資料檔案庫已置於安全模式下, 在此模式下將對 Enterprise Manager 數據進行加密。
加密密鑰已放置在文件 c:/app/Administrator/product/11.2.0/dbhome_1/lhr_orcl/sysma
n/config/emkey.ora 中。請務必備份此文件, 因為如果此文件丟失, 則加密數據將不可用
。
***********************************************************
已成功完成 Enterprise Manager 的配置
EMCA 結束於 2012-3-12 16:50:24
C:\Users\Administrator>
方法二是自己實驗出來的,並不是一個正式的方法,但是比上一種方法簡單,易於操作。
信息提示裡找不到一個目錄D:\oracle\product\10.1.0\db_1\oc4j\j2ee\OC4J_DBConsole_localhost_java, 到這個信息提示的上一層目錄裡一看,可以看到有個類似的目錄, 形如OC4J_DBConsole_janes_java, 這裡janes是我的機器名,把這個目錄copy到當前目錄下,改成信息提示裡沒有找到的目錄名,比如 我這裡就改成D:\oracle\product\10.1.0\db_1\oc4j\j2ee\OC4J_DBConsole_localhost_java
同時來到D:\oracle\product\10.1.0\db_1目錄下,可以找到一個名字形如janes_ORCL的目錄,
注意janes_ORCL,這裡的janes是我的機器名,ORCL是我這裡ORacle的SID,你可以根據你的具體情況,來找到類似的目錄, 同樣在當前copy到當前目錄,並改名為localhost_ORCL.
還有第三方法,不過沒有試過
有出現這樣問題的幫著試試
set ORACLE_HOSTNAME=localhost
export ORACLE_HOSTNAME=192.168.225.130
然後通過emctl start dbconsole或者服務裡的ORacleDBConsoleXXXX的服務就可以啟動了。
在cmd裡輸入emctl start dbconsole後出現:
C:\Documents and Settings\Administrator>emctl start dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://hexun1:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ...OracleDBConsoleorcl
服務正在啟動 ...............
OracleDBConsoleorcl 服務已經啟動成功。
復制上面紅色標記的網址就可以通過浏覽器訪問了。
如果還出現上述的錯誤:刪除dbconsole重新配置
emca -deconfig dbconsole db -repos drop
如果刪除失敗,進入數據庫刪除dbconsole以前的用戶,並且修改DBSNMP密碼
sql>alter user dbsnmp identified by orcl;
刪除早期DBCONSOLE創建的用戶:
sql>drop role MGMT_USER;
sql>drop user MGMT_VIEW cascade;
sql>drop user sysman cascade;
刪除早期DBCONSOLE創建的對象:
sql>drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;
sql>drop public synonym SETEMVIEWUSERCONTEXT;
重新創建DBCONSOLE:(如果是在windows下,要先到注冊表刪除DBCONSOLE的服務,重啟電腦)
emca -config dbcontrol db -repos create
根據提示,先輸入SID,再輸入Y繼續;
輸入端口1521,輸入SYS密碼,輸入DBSNMP密碼,輸入SYSMAN 密碼,輸入Y繼續完成。
檢查狀態 emctl status dbconsole
emca -repos recreate
[ZFXDESKDB1:oracle]:/oracle>emca -config dbcontrol db -repos recreate -cluster
STARTED EMCA at Mar 2, 2016 3:51:52 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Enter the following information:
Database unique name: oraESKDB
Service name: oraESKDB
Listener port number: 1521
Listener ORACLE_HOME [ /oracle/app/11.2.0/grid ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Cluster name: ZFXDESKDB-cluster ====》任意輸入一個名稱
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /oracle/app/11.2.0/grid ]:
ASM port [ 1521 ]:
ASM username [ ASMSNMP ]:
ASM user password:
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /oracle/app/oracle/product/11.2.0/db
Database instance hostname ................ Listener ORACLE_HOME ................ /oracle/app/11.2.0/grid
Listener port number ................ 1521
Cluster name ................ ZFXDESKDB-cluster
Database unique name ................ oraESKDB
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
ASM ORACLE_HOME ................ /oracle/app/11.2.0/grid
ASM port ................ 1521
ASM user role ................ SYSDBA
ASM username ................ ASMSNMP
-----------------------------------------------------------------
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Mar 2, 2016 3:53:22 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/app/oracle/cfgtoollogs/emca/oraESKDB/emca_2016_03_02_15_51_52.log.
Mar 2, 2016 3:53:26 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Mar 2, 2016 3:56:23 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Mar 2, 2016 3:56:24 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Mar 2, 2016 4:03:05 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Mar 2, 2016 4:03:13 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Mar 2, 2016 4:04:37 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Mar 2, 2016 4:04:38 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /oracle/app/oracle/product/11.2.0/db/oc4j/j2ee/OC4J_DBConsole_zfxdeskdb1_oraESKDB to remote nodes ...
Mar 2, 2016 4:04:44 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /oracle/app/oracle/product/11.2.0/db/oc4j/j2ee/OC4J_DBConsole_zfxdeskdb2_oraESKDB to remote nodes ...
Mar 2, 2016 4:04:53 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /oracle/app/oracle/product/11.2.0/db/zfxdeskdb1_oraESKDB to remote nodes ...
Mar 2, 2016 4:04:57 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /oracle/app/oracle/product/11.2.0/db/zfxdeskdb2_oraESKDB to remote nodes ...
Mar 2, 2016 4:05:02 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Mar 2, 2016 4:05:27 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Mar 2, 2016 4:06:29 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Mar 2, 2016 4:06:29 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://ZFXDESKDB1:1158/em <<<<<<<<<<<
Mar 2, 2016 4:06:33 PM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO:
**************** Current Configuration ****************
INSTANCE NODE DBCONTROL_UPLOAD_HOST
---------- ---------- ---------------------
oraESKDB zfxdeskdb1 ZFXDESKDB1
oraESKDB zfxdeskdb2 ZFXDESKDB1
Mar 2, 2016 4:06:33 PM 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: /oracle/app/oracle/product/11.2.0/db/zfxdeskdb1_oraESKDB/sysman/config/emkey.ora. 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 Mar 2, 2016 4:06:33 PM
[ZFXDESKDB1:oracle]:/oracle>emctl status dbconsole
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.
[ZFXDESKDB1:oracle]:/oracle>export ORACLE_UNQNAME=oraESKDB
[ZFXDESKDB1:oracle]:/oracle>emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved.
https://ZFXDESKDB1:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs are generated in directory /oracle/app/oracle/product/11.2.0/db/zfxdeskdb1_oraESKDB/sysman/log
Rac下必須配置asm的scan-listener,否則配置的時候報錯:
Mar 2, 2016 11:10:11 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: Error during db connection : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Mar 2, 2016 11:10:16 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: ORA-12541: TNS:no listener
Mar 2, 2016 11:10:17 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: Error during db connection : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Mar 2, 2016 11:10:22 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: ORA-12541: TNS:no listener
Password validation failed. Some of the possible reasons may be:
1) Invalid username/password.
2) Database is not up.
3) Scan listener not up.
4) Database service is not registered with scan listener.
5) Password file may be missing or configured incorrectly.
解決方案:
SYS@+ASM1> alter system set remote_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ZFXDESKDB-scan)(PORT=1521))))' sid='*';
System altered.
SYS@+ASM1>
SYS@+ASM1>
SYS@+ASM1> alter system register;
Mar 2, 2016 3:41:53 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: ORA-01017: invalid username/password; logon denied
Password validation failed. Some of the possible reasons may be:
1) Invalid username/password.
2) Database is not up.
3) Scan listener not up.
4) Database service is not registered with scan listener.
5) Password file may be missing or configured incorrectly.
ASM user password:
Mar 2, 2016 3:44:08 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: Error during db connection : ORA-01017: invalid username/password; logon denied
Mar 2, 2016 3:44:18 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: ORA-01017: invalid username/password; logon denied
null [ORA-01219: database not open: queries allowed on fixed tables/views only]
ASM user password:
[ZFXDESKDB2:grid]:/home/grid>asmcmd
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 131100 72444 0 72444 0 Y DATA/
ASMCMD> passwd sys
Enter old password (optional):
Enter new password: ******
----集群環境下修改
ASMCMD> orapwusr --modify --password sys
Enter password: ******
ASMCMD>
----解決方案:
[ZFXDESKDB2:grid]:/oracle/app/11.2.0/grid/dbs>sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 2 15:46:27 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> create user asmsnmp identified by dulala;
create user asmsnmp identified by dulala
*
ERROR at line 1:
ORA-15306: ASM password file update failed on at least one node
SQL> grant sysdba to asmsnmp;
Grant succeeded.
SQL> alter user asmsnmp identified by dulala;
User altered.
SQL>
...........................................................................................................................................................................................
本文作者:小麥苗,只專注於數據庫的技術,更注重技術的運用
ITPUB BLOG:http://blog.itpub.net/26736162
本文地址:http://blog.itpub.net/26736162/viewspace-2029565/
本文pdf版:http://yunpan.cn/cdEQedhCs2kFz (提取碼:ed9b)
QQ:642808185 若加QQ請注明您所正在讀的文章標題
於 2016-03-03 10:00~ 2016-03-03 19:00 在中行完成
<版權所有,文章允許轉載,但須以鏈接方式注明源地址,否則追究法律責任!>
...........................................................................................................................................................................................