Oracle 11g 修改主机名或者IP来解决EM无法重启
本文主讲Oracle 11g 更换主机名或者IP后引起EM (dbconsole) 启动失败的解决方法。
更换了主机名或者IP,如果只是单纯的pl/sql连接数据库,可以不用重新配置EM,只需要更改$ORACLE_HOME/network/admin下的listener.ora和tnsnames.ora这两个文件,把文件中:HOST=**** 改成对应的主键名或者IP即可。
如果需要要启动EM,以上的更改就不能达到我们的要求了,需要重新配置相关信息。
->set oracle_sid=oracle【“oracle”为安装的数据库的SID,可以在环境变量设置】
->emca -repos recreate
...........
Enter the following information:
Database SID: oracle
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: y
...........
->emca -config dbcontrol db
Enter the following information:
Database SID: oracle
Listener port number: 1521
Listener ORACLE_HOME [ /opt/oracle/product/11.2.0/OraHome ]:
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 ................ /opt/oracle/product/11.2.0/OraHome
Local hostname ................ obiee
Listener ORACLE_HOME ................ /opt/oracle/product/11.2.0/OraHome
Listener port number ................ 1521
Database SID ................ oracle
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
.....................
************************ 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: /opt/oracle/product/11.2.0/OraHome/obiee_oracle/sysman/config/emkey.ora. Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.
***********************************************************
Enterprise Manager configuration completed successfully
如果看到服务已经启动成功的字样,表示重新配置成功了。
EM地址可以在$ORACLE_HOME/install/readme.txt查看
EM 起停服务
启动:emctl start dbconsole
停止:emctl stop dbconsole