sqlplus remote connection giving ORA-21561

只谈情不闲聊 提交于 2019-11-27 20:53:47

问题


I have installed sqlplus based on instruction given here

sqlplus 'username/password@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.100)(PORT=1521))(CONNECT_DATA=(SID=ORCL)))'

This is giving me error

SQL*Plus: Release 11.2.0.4.0 Production on Fri Jul 10 16:10:38 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-21561: OID generation failed


Enter user-name: 

What is the solution for this problem?

PS: I have already added hostname and hosts have already have value.


回答1:


Append the name of your server to the hosts file.

If your /etc/hosts file looks like this:

127.0.0.1   localhost localhost.localdomain

It should be changed to:

127.0.0.1   localhost localhost.localdomain hostname

hostname can be obtained from the command "hostname".




回答2:


If you are using Mac add local computer name to your 127.0.0.1 in /etc/hosts

It will be like

127.0.0.1       localhost <local_computer_name>

Way to find local computer name

System Preferences>Sharing(search for it if you cant find) on the top you can see your local computer name

or you can use "hostname" command to get local computer name




回答3:


This issue can also be cause by wrong permissions on the /etc/hosts file. If it is not readable for the Oracle uid, the errors will show.

Make sure your /etc/hosts is readable by everybody:

$ ls -l /etc/hosts
-rw-r--r--    1 root     system        7446 Mar 28 23:03 /etc/hosts 
$



回答4:


Answer obtained here.

1 - Get your hostname:

$ hostname

new-host

2 - Change the contents of /etc/hosts:

$ sudo cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

$ sudo nano /etc/hosts

$ sudo cat /etc/hosts

127.0.0.1 localhost new-host

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

Hope this helps (:




回答5:


look at /etc/sysconfig/network change if needed the hostname




回答6:


try this, don't put single quotes

sqlplus username/password@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.100)(PORT=1521))(CONNECT_DATA=(SID=ORCL)))


来源:https://stackoverflow.com/questions/31338916/sqlplus-remote-connection-giving-ora-21561

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