SQLSTATE [HY000]: OCISessionBegin: ORA-21561: OID generation failed

I get the following error when I try to execute a PDO OCI SQL query on one of my web servers:

SQLSTATE[HY000]: OCISessionBegin: ORA-21561: OID generation failed 

I confirmed that the Oracle server is accessible from the machine and the network configuration looks fine. Google returns very few, and not very useful results.

Anyone else come across this or offer any suggestions to fix it?

+8
oracle php pdo oci
source share
3 answers

I decided to abandon the use of PDO and simply tried to use the OCI_Connect () function to connect to the database and received the following message:

 "ORA-24408: could not generate unique server group name" 

... I fought a bit with this, and the answer is here: ORA-24408: it is not possible to create a unique server group name

I just post it here if someone encounters a similar error. Hope that helps someone.

+1
source share

I ran into the same problem. I tried to connect to the database on my localhost. This is how I solved it.

  • Get hostname

     > hostname localhost.idc.company.com 
  • Add this name to the / etc / hosts file

     127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 localhost.idc.company.com 
+12
source share

This can be fixed by simply editing your hosts file:

Find out the name of your local hosting system by simply typing "hostname" in the terminal / command line. Suppose your machine is called "the_machine", and then edit the / etc / hosts file to: 127.0.0.1 localhost the_machine

  • $ hostname:

    the_machine

  • $ vi / etc / hosts:

127.0.0.1 localhost the_machine

  1. $ python Connect_to_Oracle_DB.py

Hooray!

+1
source share

All Articles