Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-31202: DBMS_LDAP: LDAP client/server error: UnKnown Error

User_7P5HEAug 3 2011 — edited Aug 4 2011
I'm trying to get a connection with my novell edirectory, but I get the error ORA-31202: DBMS_LDAP: LDAP client/server error: UnKnown Error.

Any idea what it's wrong??

Thanks in advanced.

The code it's...

DECLARE

retval PLS_INTEGER;
my_session DBMS_LDAP.session;
my_attrs DBMS_LDAP.string_collection;
my_message DBMS_LDAP.message;
my_entry DBMS_LDAP.message;
entry_index PLS_INTEGER;
my_dn VARCHAR2(256);
my_attr_name VARCHAR2(256);
my_ber_elmt DBMS_LDAP.ber_element;
attr_index PLS_INTEGER;
i PLS_INTEGER;
my_vals DBMS_LDAP.STRING_COLLECTION ;
ldap_host VARCHAR2(256);
ldap_port VARCHAR2(256);
ldap_user VARCHAR2(256);
ldap_passwd VARCHAR2(256);
ldap_base VARCHAR2(256);

BEGIN
retval := -1;

-- Please customize the following variables as needed
ldap_host := 'edir.inside.enterprise.com';
ldap_port := '389';
ldap_user := 'cn=admin,o=enterprise';
ldap_passwd:= 'password';
ldap_base := 'ou=sites,o=enterprise';
-- end of customizable settings

DBMS_OUTPUT.PUT('DBMS_LDAP Search Example ');
DBMS_OUTPUT.PUT_LINE('to directory .. ');
DBMS_OUTPUT.PUT_LINE(RPAD('LDAP Host ',25,' ') || ': ' || ldap_host);
DBMS_OUTPUT.PUT_LINE(RPAD('LDAP Port ',25,' ') || ': ' || ldap_port);

-- Choosing exceptions to be raised by DBMS_LDAP library.
DBMS_LDAP.USE_EXCEPTION := TRUE;


my_session := DBMS_LDAP.init(ldap_host,ldap_port);

DBMS_OUTPUT.PUT_LINE (RPAD('Ldap session ',25,' ') || ': ' ||
RAWTOHEX(SUBSTR(my_session,1,8)) ||
'(returned from init)');

-- bind to the directory
retval := DBMS_LDAP.simple_bind_s(my_session,ldap_user, ldap_passwd);

DBMS_OUTPUT.PUT_LINE(RPAD('simple_bind_s Returns ',25,' ') || ': '
|| TO_CHAR(retval));


EXCEPTION

WHEN OTHERS THEN

DBMS_OUTPUT.PUT_LINE(' Error code : ' || TO_CHAR(SQLCODE));
DBMS_OUTPUT.PUT_LINE(' Error Message : ' || SQLERRM);
DBMS_OUTPUT.PUT_LINE(' Exception encountered .. exiting');


END;
/
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 1 2011
Added on Aug 3 2011
1 comment
9,028 views