日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle 怎么调整emctl,emca和emctl的日常用法及实例(经验保存)

發(fā)布時(shí)間:2023/12/20 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle 怎么调整emctl,emca和emctl的日常用法及实例(经验保存) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

環(huán)境:redhat 5.8-64bit

db: oracle 11.2.0.4- 64bit

準(zhǔn)備繼續(xù)學(xué)習(xí)下ocp的相關(guān)知識(shí)點(diǎn),在vm中創(chuàng)建oem,其中一些emca、emctl用法和在操作中出錯(cuò)的情景,詳細(xì)如下:

=====1、emca和emctl用法

1,修改DBSNMP密碼:

重新配置DBCONSOLE,需要輸入DBSNMP密碼,但任何密碼都會(huì)顯示錯(cuò)誤,需要預(yù)先修改。

sql>alter user dbsnmp identified by xxx;

2,刪除早期DBCONSOLE創(chuàng)建的用戶:

sql>drop role MGMT_USER;

sql>drop user MGMT_VIEW cascade;

sql>drop user sysman cascade;

3,刪除早期DBCONSOLE創(chuàng)建的對(duì)象:

sql>drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;

sql>drop public synonym SETEMVIEWUSERCONTEXT;

4,重新創(chuàng)建DBCONSOLE:(如果是在windows下,要先到注冊(cè)表刪除DBCONSOLE的服務(wù),重啟電腦)

$emca -config dbcontrol db -repos create

如果此命令還是失敗,可直接利用重建命令:

$emca -config dbcontrol db -repos recreate

根據(jù)提示,先輸入SID,再輸入Y繼續(xù);

輸入端口1521,輸入SYS密碼,輸入DBSNMP密碼,輸入SYSMAN 密碼,輸入Y繼續(xù)

完成。

5,檢查狀態(tài) emctl status dbconsole。

附emca常用命令:

創(chuàng)建一個(gè)EM資料庫

emca -repos create

重建一個(gè)EM資料庫

emca -repos recreate

刪除一個(gè)EM資料庫

emca -repos drop

配置數(shù)據(jù)庫的 Database Control

emca -config dbcontrol db

刪除數(shù)據(jù)庫的 Database Control配置

emca -deconfig dbcontrol db

重新配置db control的端口,默認(rèn)端口在1158

emca -reconfig ports

emca -reconfig ports -dbcontrol_http_port 1160

emca -reconfig ports -agent_port 3940

先設(shè)置ORACLE_SID環(huán)境變量后,啟動(dòng)EM console服務(wù)

emctl start dbconsole

先設(shè)置ORACLE_SID環(huán)境變量后,停止EM console服務(wù)

emctl stop dbconsole

先設(shè)置ORACLE_SID環(huán)境變量后,查看EM console服務(wù)的狀態(tài)

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

創(chuàng)建EM時(shí),提示的端口號(hào),應(yīng)為實(shí)例的斷口號(hào),比如1521,不是EM的端口號(hào)(比如1158)

EM的端口號(hào)在這個(gè)文件中可以查到10.2.0\db_1\sysman\config\emca.properties

然后,進(jìn)行em后,界面出來了,但報(bào)了一個(gè)錯(cuò):

Java.lang.Exception: Exception in sending Request :: null

很多功能不能用,提示重新登錄.

在Oracle論壇上查到了解決辦法:

找到下面的文件

10.2.0\db_1\ZYKNET_ORC2\sysman\config\emd.properties

其中的agentTZRegion缺省是GMT,改為你所在的時(shí)區(qū)即可,例如:

agentTZRegion=Asia/Chungking

關(guān)于時(shí)區(qū)的列表參考:10.2.0\db_1\sysman\admin\supportedtzs.lst

然后,重啟OracleDBConsole

=====2、操作時(shí)出錯(cuò)的情景

1. ?emca: 按要求配置了.bash_profile中的環(huán)境變量

點(diǎn)擊(此處)折疊或打開

ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME

ORACLE_HOSTNAME=srv1; export ORACLE_HOSTNAME

ORACLE_HOMENAME配置時(shí),開始配置了localhost

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

這個(gè)地方?DBSNMP用戶被locked了,需要解鎖

sysdba用戶: alter user sysman account unlock;即可

3. 由于開始時(shí)配置ORACLE_HOSTNAME=localhost,導(dǎo)致出錯(cuò),只能用命令emca -config dbcontrol db -repos recreate重新創(chuàng)建下

點(diǎn)擊(此處)折疊或打開

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 <<<<<<<<<<<

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

創(chuàng)建完畢,成功!!注意::用360瀏覽器打開時(shí),無法登陸,用firefox沒有問題,,這里對(duì)360瀏覽器吐槽下!!!!

總結(jié)

以上是生活随笔為你收集整理的oracle 怎么调整emctl,emca和emctl的日常用法及实例(经验保存)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。