My Oracle Support Banner

DBMS_LDAP Code Fails With Error: Ora-31204: Dbms_ldap: Pl/Sql - Invalid Ldap Session / "my_session := DBMS_LDAP.init(ldap_host,ldap_port);" Does Not Return Anything for my_session (Doc ID 1345057.1)

Last updated on APRIL 03, 2023

Applies to:

Oracle Internet Directory - Version 10.1.2 and later
Information in this document applies to any platform.

Symptoms

A working pl/sql code run as a non-dba user on one Database (DB) to Oracle Internet Directory (OID) returns error:

declare
*
ERROR at line 1:
ORA-31204: DBMS_LDAP: PL/SQL - Invalid LDAP Session.
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_LDAP", line 135
ORA-06512: at line 34


This is the first time the code is run on this one DB.

Running the same code on another DB works fine.

Also, after granting the user the dba role, the same code is successful.

 

Another symptom:
The code "my_session := DBMS_LDAP.init(ldap_host,ldap_port);" does not return anything for my_session.
The same code works fine for one database, but not for another.

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.