在装oracle10g后,想试着打开EM,emctl start dbconsole,启动em,浏览器中输入http://IP:1158/em后,发面问题:
初步怀疑是监听的问题,lsnrctl status 正常,sqlplus sys/123456 as sysdba 正常,emctl start dbconsole也能正常启动,tnsping ora10g检测,sqlplus system/[email protected]也没问题,怪了,是哪出了问题。在网上查了下,还是listener.ora有问题,里面的host我写的是ip,先lsnrctl stop,将里面host改成localhost.localdomin,em就可正常访问。
网上很多解决方案是重装em
我也做了下试验,不过和原来一样,还得把host改为localhost.localdomain,才能使用
下面写下重装em的过程:
1.先将listener.ora里面的host改成localhost.localdomain,启动监听,要不em是删不掉的
2.emca -repos drop (删掉em)
Enter the following information:
Database SID: ora10g
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Database SID: ora10g
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: Y
3.重建em emca -config dbcontrol db -repos create
Do you wish to continue? [yes(Y)/no(N)]: Y
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------
Listener port number: 1521
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
Database hostname ................ localhost.localdomain
Listener port number ................ 1521
Database SID ................ ora10g
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
Listener port number ................ 1521
Database SID ................ ora10g
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
4.完成,访问 http://ip:1158/em
附: emca常用命令语法
emca -repos create 创建一个EM资料库
emca -repos recreate 重建一个EM资料库
emca -repos drop 删除一个EM资料库
emca -config dbcontrol db 配置数据库的 Database Control
emca -deconfig dbcontrol db删除数据库的 Database Control配置
emca -reconfig ports 重新配置db control和agent的端口
emca -repos create 创建一个EM资料库
emca -repos recreate 重建一个EM资料库
emca -repos drop 删除一个EM资料库
emca -config dbcontrol db 配置数据库的 Database Control
emca -deconfig dbcontrol db删除数据库的 Database Control配置
emca -reconfig ports 重新配置db control和agent的端口
注:通过查看$ORACLE_HOME/install/portlist.ini 文件可以知道当前dbcontrol正在使用的端口,默认dbcontrol http端口1158,agent端口3938。如果要重新配置端口,可以使用如下命令:
emca -reconfig ports -dbcontrol_http_port 1159
emca -reconfig ports -agent_port 3939
emctl常用命令语法:
emctl start dbconsole启动EM console服务,使用前需要先设置ORACLE_SID环境变量
emctl stop dbconsole停止EM console服务,使用前需要先设置ORACLE_SID环境变量
emca -reconfig ports -dbcontrol_http_port 1159
emca -reconfig ports -agent_port 3939
emctl常用命令语法:
emctl start dbconsole启动EM console服务,使用前需要先设置ORACLE_SID环境变量
emctl stop dbconsole停止EM console服务,使用前需要先设置ORACLE_SID环境变量
转载于:https://blog.51cto.com/wanglq/357070