ORA-21561 : OID generation failed

The error below may happen also during creation of a new database.
The problem is that /etc/hosts is not properly configured (usually  It does not contain an entry for the name of the server )

Connection Via SQL*Net Fails With Error ORA-21561: OID Generation Failed [ID 559981.1]

Applies to:

Oracle Net Services - Version: to
Information in this document applies to any platform.
Checked for relevance on 14-JAN-2010.


 After upgrading to version, SQL*Plus connections fail with the following error:
ORA-21561 : OID generation failed
-bash-2.05b$ sqlplus username/password@tns_connect_string
SQL*Plus: Release - Production on Fri Mar 7 16:15:10 2008

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

ORA-21561 : OID generation failedEnter user-name: <username>/<password> @ <tns connect string>
Connected to:
Oracle Database 10g Enterprise Edition Release - 64bit Production
With the Partitioning and Data Mining options



It is likely that a recent upgrade to has taken place.


Incorrect /etc/hosts mapping for the client machine or no mapping at all. 


Check the client's /.../hosts file and verify that the local node is correctly identified with a mapping for both the short and fully qualified name of the host.

6 comentarii:

  1. Thanks for this solution, I spent one hour googling and only your blog gave correct solution.

  2. Thank you so much for writing this article. I spent so much time trying to figure out why I was getting this obtuse "ERROR: ORA-21561: OID generation failed" error, and it turned out this was exactly the solution! Thanks again!

  3. Got the same problem recently on the CentOS 5.6 with oracle DB 11.2 / InstaClient 11.2 in the Python/cx_Oracle stockpile.

    hostname modification didn't work, but running it all Pyton as a superuser solved the problem. Apparently it appeared when CentOS updated their sudo package.

  4. Hello,

    I had the same problem and this solution fixed it.

    Thank you.

  5. Thanks, I had exactly same problem. The /etc/hosts modification resolved the issue.

  6. Thank you, I had the same problem with Perl using DBI and DBD::Oracle using instantclient 11.2 and was getting the same error until I put the fully qualified hostname in /etc/hosts

    Let's hope that's enough keywords for google to pick up this post as the answer, because Oracle's forums certainly didn't do the job (it doesn't help that there's many many reasons this error can be thrown)