oracle连接错误ORA-21561: OID generation failed

连接oracle时出错:ORA-21561: OID generation failed

解决方案如下:

1.打开终端,查看 hostname
在终端下输入:

hostname

发现输出是 local 而不是 localhost

2.查看 hosts 文件

cd /etc  
open hosts

内容为:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost 

发现hostname 和 hosts 文件里的 hostname 不一致

3.修改 hostname 与 hosts 里保持一致

sudo scutil --set HostName localhost

重新连接 Oracle,问题即可解决。

你可能感兴趣的:(oracle连接错误ORA-21561: OID generation failed)