Dr. Alex Dong's Blog

Centos6.8 安装 Oralce 11g R2 EM

查看用户状态

select username,account_status from dba_users;

一、修改sys密码

sqlplus /nolog;
conn /as sysdba;
alter user sys identified by sys

二、解锁sysman,dbsnmp,修改sysman,dbsnmp密码

alter user sysman account unlock;
alter user dbsnmp account unlock;
alter user sysman identified by sysman;
alter dbsnmp identified by dbsnmp;

三、数据准备

emca -repos recreate

四、配置文件布局

emca -config dbcontrol db

这时候会报如下错误:不能分配端口号

oracle.sysman.emcp.exception.EMConfigException: Failed to allocate port(s) in the specified range(s) for the following process(es): JMS [5540-5559],RMI [5520-5539],Database Control [5500-5519],EM Agent [3938] | [1830-1849]

解决法案:

4.1 vim \etc\hosts 去掉多余的地址和服务器名,确保服务器名和ip是正确的。

4.2 关闭服务器防火墙:
/etc/init.d/iptables stop

4.3 查找/home/data/app/oracle/product/11.2.0/db_1/sysman/config/emd.properties

找到 EMD_URL=<http or https>://<hostname>:<port>/emd/main/

要加上冒号后面的端口号。就可以了

五、测试

需要在阿里云后台打开数据库服务器安全组5500端口,再到NAT映射5500端口到公网比如15500端口。然后测试链接如下:

https://https://47.244.42.101:15500/em/

adminCentos6.8 安装 Oralce 11g R2 EM