解决 连接Oracle出现的 ORA-21561: OID ge

2020-05-12  本文已影响0人  bruce_wu
image.png

一、打开终端,查看 hostname

Bash
hostname
发现主机名不是 localhost ,对不对?

二、查看 hosts 文件

Bash
cat /etc/hosts
内容应该是:

Bash

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 不一致
三、解决办法

在hosts增加

Bash
127.0.0.1 myhostname # 刚才hostname查询出来的主机名
修改 hostname 与 hosts 里保持一致

Bash
sudo scutil --set HostName localhost

至此问题应该解决了

上一篇 下一篇

猜你喜欢

热点阅读