2011-07-15

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 10.2.0.3 SQL*Net Fails With Error ORA-21561: OID Generation Failed [ID 559981.1]


Applies to:

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

Symptoms

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

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

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

SQL>

Changes

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

Cause

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

Solution

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.

    RăspundețiȘtergere
  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!

    RăspundețiȘtergere
  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.

    RăspundețiȘtergere
  4. Hello,

    I had the same problem and this solution fixed it.

    Thank you.

    RăspundețiȘtergere
  5. Thanks, I had exactly same problem. The /etc/hosts modification resolved the issue.

    RăspundețiȘtergere
  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)

    RăspundețiȘtergere