当主机名更改时,Oracle XE停止工作 [英] Oracle XE stops working when host name chages

查看:104
本文介绍了当主机名更改时,Oracle XE停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决这个问题花了我数周时间,所以我想分享一下:

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

我正在使用Google计算CentOS映像在Oracle XE上托管Apex应用程序. 我试图让第二台服务器使用快照运行,但是发现一旦创建,我的连接就会被拒绝.

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.

数据库正在运行,我没有在centOS或Google Compute上更改任何防火墙规则,因此无法理解它是如何工作的.

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.

推荐答案

原来,Oracle将主机信息存储在数据库启动时使用的文件中,如果与当前服务器不匹配,则监听器将不会运行或会听错话.

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.

在这些安装文件"tnsnames.ors"和"listener.ora"中,有很多文档和帮助文章来解决问题,但是它们很复杂,有时是矛盾的.但是有一个简单的技巧可以让Oracle为您修复它.

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.

一次修复:

您所要做的就是将Listener.ora文件重命名为其他名称(即listener.ora.old),然后重新启动数据库,它将使用当前服务器的主机详细信息并重新开始工作.

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.

如果您希望VM始终运行,而不考虑其主机名和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.

经过测试的版本

Oracle XE 11g第2版

Oracle XE 11g Release 2

CentOS v7

CentOS v7

Google Compute Engine 2017年9月

Google Compute Engine Sep-2017

希望有帮助

这篇关于当主机名更改时,Oracle XE停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆