emca和emctl的日常用法及例項(經驗儲存)
db: oracle 11.2.0.4- 64bit
準備繼續學習下ocp的相關知識點,在vm中建立oem,其中一些emca、emctl用法和在操作中出錯的情景,詳細如下:
=====1、emca和emctl用法
1,修改DBSNMP密碼:
重新配置DBCONSOLE,需要輸入DBSNMP密碼,但任何密碼都會顯示錯誤,需要預先修改。
sql>alter user dbsnmp identified by xxx;
2,刪除早期DBCONSOLE建立的使用者:
sql>drop role MGMT_USER;
sql>drop user MGMT_VIEW cascade;
sql>drop user sysman cascade;
3,刪除早期DBCONSOLE建立的物件:
sql>drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;
sql>drop public synonym SETEMVIEWUSERCONTEXT;
4,重新建立DBCONSOLE:(如果是在windows下,要先到登錄檔刪除DBCONSOLE的服務,重啟電腦)
$emca -config dbcontrol db -repos create
如果此命令還是失敗,可直接利用重建命令:
$emca -config dbcontrol db -repos recreate
根據提示,先輸入SID,再輸入Y繼續;
輸入埠1521,輸入SYS密碼,輸入DBSNMP密碼,輸入SYSMAN 密碼,輸入Y繼續
完成。
5,檢查狀態 emctl status dbconsole。
附emca常用命令:
建立一個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_SID環境變數後,啟動EM console服務
emctl start dbconsole
先設定ORACLE_SID環境變數後,停止EM console服務
emctl stop dbconsole
先設定ORACLE_SID環境變數後,檢視EM console服務的狀態
emctl status dbconsole
配置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
-------------------------------------------------------------------------------------------------------------------------
Oracle 10G重建EM DB Control.
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:
a. drop user sysman cascade;
b. drop role MGMT_USER;
c. drop user MGMT_VIEW cascade;
d. drop public synonym MGMT_TARGET_BLACKOUTS;
e. drop public synonym SETEMVIEWUSERCONTEXT;
3.Create configuration files and repository run
emca -config dbcontrol db -repos create
建立EM時,提示的埠號,應為例項的斷口號,比如1521,不是EM的埠號(比如1158)
EM的埠號在這個檔案中可以查到10.2.0\db_1\sysman\config\emca.properties
然後,進行em後,介面出來了,但報了一個錯:
Java.lang.Exception: Exception in sending Request :: null
很多功能不能用,提示重新登入.
在Oracle論壇上查到了解決辦法:
http://forums.oracle.com/forums/thread.jspa?threadID=320574&tstart=0&messageID=1374397
找到下面的檔案
10.2.0\db_1\ZYKNET_ORC2\sysman\config\emd.properties
其中的agentTZRegion預設是GMT,改為你所在的時區即可,例如:
agentTZRegion=Asia/Chungking
關於時區的列表參考:10.2.0\db_1\sysman\admin\supportedtzs.lst
然後,重啟OracleDBConsole
=====2、操作時出錯的情景
1. emca: 按要求配置了.bash_profile中的環境變數
點選(此處)摺疊或開啟
- ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME
- ORACLE_HOSTNAME=srv1; export ORACLE_HOSTNAME
EM Configuration issue. /u01/app/oracle/product/10.2.0/db_1/localhost_orcl not found.
2. emca配置使用者locked問題
srv1:/home/oracle> emca -config dbcontrol db -repos create STARTED EMCA at Feb 25, 2015 10:55:33 AM EM Configuration Assistant, Version 11.2.0.3.0 Production Copyright (c) 2003, 2011, Oracle. All rights reserved. Enter the following information: Database SID: orcl Listener port number: 1521 Listener ORACLE_HOME [ /u01/app/oracle/product/10.2.0/db_1 ]: Password for SYS user: Password for DBSNMP user: Feb 25, 2015 10:56:17 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly WARNING: ORA-28000: the account is locked 這個地方 DBSNMP使用者被locked了,需要解鎖 sysdba使用者: alter user sysman account unlock;即可 |
3. 由於開始時配置ORACLE_HOSTNAME=localhost,導致出錯,只能用命令emca -config dbcontrol db -repos recreate重新建立下
點選(此處)摺疊或開啟
- srv1:/home/oracle> emca -config dbcontrol db -repos recreate
- STARTED EMCA at Feb 25, 2015 10:58:39 AM
- EM Configuration Assistant, Version 11.2.0.3.0 Production
- Copyright (c) 2003, 2011, Oracle. All rights reserved.
- Enter the following information:
- Database SID: orcl
- Listener port number: 1521
- Listener ORACLE_HOME [ /u01/app/oracle/product/10.2.0/db_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 ................ /u01/app/oracle/product/10.2.0/db_1
- Local hostname ................ srv1
- Listener ORACLE_HOME ................ /u01/app/oracle/product/10.2.0/db_1
- Listener port number ................ 1521
- Database SID ................ orcl
- Email address for notifications ...............
- Outgoing Mail (SMTP) server for notifications ...............
- -----------------------------------------------------------------
- ----------------------------------------------------------------------
- WARNING : While repository is dropped the database will be put in quiesce mode.
- ----------------------------------------------------------------------
- Do you wish to continue? [yes(Y)/no(N)]: Y
- Feb 25, 2015 10:58:59 AM oracle.sysman.emcp.EMConfig perform
- INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2015_02_25_10_58_38.log.
- Feb 25, 2015 10:59:01 AM oracle.sysman.emcp.EMReposConfig invoke
- INFO: Dropping the EM repository (this may take a while) ...
- Feb 25, 2015 11:03:13 AM oracle.sysman.emcp.EMReposConfig invoke
- INFO: Repository successfully dropped
- Feb 25, 2015 11:03:15 AM oracle.sysman.emcp.EMReposConfig createRepository
- INFO: Creating the EM repository (this may take a while) ...
- Feb 25, 2015 11:15:06 AM oracle.sysman.emcp.EMReposConfig invoke
- INFO: Repository successfully created
- Feb 25, 2015 11:15:23 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
- INFO: Uploading configuration data to EM repository (this may take a while) ...
- Feb 25, 2015 11:17:37 AM oracle.sysman.emcp.EMReposConfig invoke
- INFO: Uploaded configuration data successfully
- Feb 25, 2015 11:17:45 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
- INFO: Securing Database Control (this may take a while) ...
- Feb 25, 2015 11:18:06 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
- INFO: Database Control secured successfully.
- Feb 25, 2015 11:18:06 AM oracle.sysman.emcp.util.DBControlUtil startOMS
- INFO: Starting Database Control (this may take a while) ...
- Feb 25, 2015 11:20:37 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
- INFO: Database Control started successfully
- Feb 25, 2015 11:20:37 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
- INFO: >>>>>>>>>>> The Database Control URL is https://srv1:1158/em <<<<<<<<<<<
- Feb 25, 2015 11:20:52 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: /u01/app/oracle/product/10.2.0/db_1/srv1_orcl/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 Feb 25, 2015 11:20:52 AM
注意::用360瀏覽器開啟 https://srv1:1158/em時,無法登陸,用firefox沒有問題,,這裡對360瀏覽器吐槽下!!!!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/3090/viewspace-1440948/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- emca和emctl常用語法(zt)
- mysql儲存過程經典例項詳解MySql儲存過程
- (Oracle)儲存過程、儲存函式和包的相關知識與例項Oracle儲存過程儲存函式
- JS中排序的用法和例項JS排序
- 儲存程式和程式控制:開發經驗分享及操作過程詳解
- Netapp儲存日常檢查及資訊收集APP
- javascript this用法和簡單例項JavaScript單例
- 儲存過程編寫經驗和優化措施儲存過程優化
- Excel isna函式的用法和例項Excel函式
- 日常學習儲存--陣列和指標陣列指標
- mysql 儲存過程簡單例項MySql儲存過程單例
- PHP呼叫MYSQL儲存過程例項PHPMySql儲存過程
- mysql儲存過程簡單例項MySql儲存過程單例
- 儲存過程編寫經驗和最佳化措施儲存過程
- Oracle minus用法詳解及應用例項Oracle
- js基於Cookie的儲存類例項程式碼JSCookie
- (轉)例項分析:MySQL優化經驗MySql優化
- UNIX網路程式設計學習(9)--getsockname和getpeername的用法及例項程式設計
- Oracle儲存過程編寫經驗和最佳化措施Oracle儲存過程
- 儲存過程編寫經驗和最佳化措施(轉)儲存過程
- VBox和HBox的用法及用例
- C# Timer用法及例項詳解C#
- Makefile和GCC日常用法GC
- zookeeper 用法和日常運維運維
- es6實現的本地儲存程式碼例項
- cookie儲存使用者登入名和密碼程式碼例項Cookie密碼
- 日常專案經驗總結
- 資料庫儲存選型經驗總結資料庫
- MySQL定時任務與儲存過程例項MySql儲存過程
- Android SharedPreferences儲存資料使用例項分析Android
- 如何複製控制檔案在ASM例項儲存ASM
- Stored Procedure(儲存過程)編寫經驗和最佳化措施 (轉)儲存過程
- cookie儲存刪除使用者名稱和密碼程式碼例項Cookie密碼
- js的建構函式和原型用法程式碼例項JS函式原型
- 資料庫的日常管理經驗淺談資料庫
- 使用七牛雲端儲存的一些經驗總結
- 前端(react)上傳到阿里雲OSS儲存 例項前端React阿里
- 將網頁儲存為圖片形式程式碼例項網頁