Oracle OEM 重建(一)

2014-11-24 18:29:26 · 作者: · 浏览: 3

OEM重建出现的问题(很多类似的,浪费了N多时间):


2009-4-10 3:38:49 oracle.sysman.emcp.EMReposConfig createRepository


配置: ORA-01920:用户名'MGMT_VIEW'与另外一个用户名或角色名发生冲突


ORA-06512:在line 40


oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-01920:用户名'MGMT_VIEW'与另外一个用户名或角色名发生冲突


ORA-06512:在line 40



2009-4-10 3:03:10 oracle.sysman.emcp.EMReposConfig unlockAccounts


配置: ORA-06550:第1行,第62列:


PLS-00201:必须声明标识符'SYSMAN.MGMT_VIEW_PRIV'


ORA-06550:第1行,第62列:


PL/SQL: Statement ignored




OEM常用的命令,及实例步骤.


创建一个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


-------------


手工重新配置dbconsole的步骤
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
根据提示,先输入SID,再输入Y继续;
输入端口1521,输入SYS密码,输入DBSNMP密码,输入SYSMAN 密码,输入Y继续
完成。


-----------------------



FROM METALINK


422729.1 How to change the Hostname when Oracle10Gand ASM being useds




[url=https://metalink2.oracle.com/help/usaeng/Search/search.html#file: 422729.1]https://metalink2.oracle.com/help/usaeng/Search/search.html#file: 422729.1[/url] Type: HOWTO


Modified Date : 13-NOV-2008 Status:MODERATED



Applies to:


Oracle Server - Enterprise Edition - Version: 10.1 to 10.2



Information in this document applies to any platform.Goal



How to change the Hostname of the Windows when the10Gwith ASM being used


Solution


When changing the Hostname, 4 files would be affected.


1) Tnsnames.ora


2) listener.ora


3) Oraclecsservice


4) Enterprise Manager



** Note: AfterChanging the HostnameandBefore Starting the Services,please check the below **



1) Tnsnames.oraandListener.ora



** If theIpaddress is refered in these files,then there willnotbeany problem,elseyouneedtochangetheHostnamein theTnsnamesof theClientsconnecting to the server and theListeneron theServer


Tnsnames:


(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) -- Tnsnames


Listener:


LISTENER =


(DESCRIPTION_LIST =


(DESCRIPTION =


(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))


(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) >>>> in


Listener


)


)


Oraclecsservice



TheHostnamewill behard-codedin theCSService, so we need toRecreatethe Service


Steps to Recreate the CSService


Goto Oracle_Home/bin



Directory of L:/oracle/product/10.2.0/db10g/BIN


L:/oracle/product/10.2.0/db10g/BIN>localconfig delete


Step 1: stopping local CSS stac