Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm receiving the following error when trying to do a PDO OCI SQL query on one of my web servers:

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

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

Has anyone else run into this, or have any suggestions on how to resolve?

like image 415
Camden S. Avatar asked Oct 29 '13 16:10

Camden S.


2 Answers

I was facing the same issue. I was trying to connect to database on my localhost. This is how I solved it.

  • Get the hostname

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

    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 localhost.idc.company.com
    
like image 92
Mustafa Hussain Avatar answered Sep 27 '22 17:09

Mustafa Hussain


I decided to forego the use of PDO and just tried to use an OCI_Connect() function to connect to the database and received the following message:

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

... I did battle with that a while back and the answer is here: ORA-24408: could not generate unique server group name

I'm just posting it here in case anyone encounters a similar error. Hope that helps someone.

like image 41
Camden S. Avatar answered Sep 27 '22 17:09

Camden S.