Oracle XE stops working when host name chages

ε祈祈猫儿з 提交于 2019-12-25 11:54:34

问题


It has taken me weeks to solve this so I thought I would share:

I am hosting an Apex app on Oracle XE using Google compute CentOS image. I was trying to get a second server going using a snapshot but found that once created I got connect refused.

The database was running and I had not changed any firewall rules on centOS or Google Compute so could not understand how it would not work.

I spent weeks blaming the two firewalls.


回答1:


It turns out the Oracle stores host information in files used when the database starts and if this does not match the current server then the listener either will not be running or will be listening for the wrong things.

There are quite a few documents and help articles dealing with problems in these setup files "tnsnames.ors" and "listener.ora" but they are complex and at times contradictory. but there is one simple trick to get Oracle to fix it for you.

One off Fix:

All you have to do is rename the Listener.ora file to somthing else i.e. listener.ora.old and restart the DB and it will use the current servers host details and start working again.

If you need your VM to always work regardless of its hostname and IP

Simply rename the file as above before you create the snapshot then any new server will fix itself the first time it starts up.

Versions Tested

Oracle XE 11g Release 2

CentOS v7

Google Compute Engine Sep-2017

Hope it helps



来源:https://stackoverflow.com/questions/46107343/oracle-xe-stops-working-when-host-name-chages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!