ORA-24408: could not generate unique server group name

一台新虚拟机,CentOS 6.5系统,用lnmp一键安装包安装好Nginx + PHP环境,再安装Oracle客户端,准备搭建PHP连接Oracle,访问oracle.php,测试连接Oracle的时候,出错:

ORA-24408: could not generate unique server group name

度娘了好久,都说是主机名的事,但也都没有说明白原理,最后谷叔告诉我一个链接http://stackoverflow.com/questions/10484231/ora-24408-could-not-generate-unique-server-group-name

LZ也是遇到这样的问题,Camden S.给出的回答很详细:

You can downgrade to 10g if you want (it evidently doesn't care about this) but that's not necessary...

The 11g instant client requires a /etc/hosts file entry for your hostname pointing to 127.0.0.1. The normal "localhost" entry is not sufficient on it's own.

Assuming your host name is foomachine, there are two places you'll need to check:

In /etc/hosts, make sure you have any entry like - add it if it's not there:

127.0.0.1   foomachine

And also make sure the /etc/sysconfig/network file also has 

HOSTNAME=foomachine

That should do the trick.

 

这下就明白了,要在/etc/sysconfig/network中设置HOSTNAME,同时在/etc/hosts中保证127.0.0.1后面有刚才设置的HOSTNAME。

设置好以后重启系统,成功连接Oracle。

特此笔记,以免忘记。

posted @   享受代码  阅读(2470)  评论(0编辑  收藏  举报
编辑推荐:
· 为什么说在企业级应用开发中,后端往往是效率杀手?
· 用 C# 插值字符串处理器写一个 sscanf
· Java 中堆内存和栈内存上的数据分布和特点
· 开发中对象命名的一点思考
· .NET Core内存结构体系(Windows环境)底层原理浅谈
阅读排行:
· 为什么说在企业级应用开发中,后端往往是效率杀手?
· 本地部署DeepSeek后,没有好看的交互界面怎么行!
· 趁着过年的时候手搓了一个低代码框架
· 推荐一个DeepSeek 大模型的免费 API 项目!兼容OpenAI接口!
· 用 C# 插值字符串处理器写一个 sscanf
点击右上角即可分享
微信分享提示