分类: Oracle
2011-08-17 17:31:31
在 10g 中,我们可能会经常遇到OEM不能正常使用的问题,但导致问题的原因不尽相同,最后绝大多数问题可以通过emca 这个命令来解决,详细的说明可以查看联机帮助,下面给出一些常用的命令及实例步骤.
1.创建repository
emca -repos create
2.创建DBconsole
emca -config dbcontrol db
3.重建
emca -config dbcontrol db -repos recreate
4.删除repository
emca -repos drop
isqlplusctl stop|start
emctl start|stop dbconsole
重建EM
先删除资料档案库
emca -deconfig dbcontrol db -repos drop
手工删除em资料库的方法,不能漏掉,否则创建时会报错
drop user sysman cascade;
drop user mgmt_view cascade;
drop role mgmt_user;
然后
emca -repos recreate
$ emca -repos create
STARTED EMCA at Aug 7, 2009 1:09:08 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: orah80
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: yes
Aug 7, 2009 1:09:19 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/product/10.2.0/cfgtoollogs/emca/orah80/emca_2009-08-07_01-09-08-PM.log.
Aug 7, 2009 1:09:20 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 7, 2009 1:13:41 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 7, 2009 1:13:41 PM
以DBA身份进入。但需要额外的配置。
http://ningoo.itpub.net/post/2149/200372
常用的命令
创建一个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 |