I have problem in deleting any LDAP entry using DBMS_LDAP.delete_s
function. My code looks like:
DECLARE
l_ldap_user VARCHAR2(256) := 'dc=example,dc=com';
l_session DBMS_LDAP.session;
...
BEGIN
...
l_retval := dbms_ldap.delete_s(l_session, l_ldap_user || ',cn=Tink');
...
END
/
I use Apache Directory Studio version 2.0.0 to store LDAP data and it looks like:
dn: dc=example,dc=com
objectclass: top
objectclass: domain
dc: example
userPassword:: e1NTSEF9YTZIYUF0U1BGSnFOQ2piZm9ENStpV3BMQnJ1VnBlT21IbFAraHc9P
Q==
dn: cn=Tink,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
objectClass: top
cn: Tink
sn: Tink
userPassword:: e1NTSEF9eDZBZUV2SzVEYmkrYlA2c0FCZU1zdk5YMzlUN1JUL3FOSk9KQmc9P
Q==
As a result I receive following error message:
Error report -
ORA-31202: DBMS_LDAP: LDAP client/server error: No such object.
NO_SUCH_OBJECT: failed for MessageType : DEL_REQUEST
Message ID : 2
Del request
Entry : 'dc=example,dc=com,cn=Tink'
org.apache.directory.api.ldap.model.message.DeleteRequestImpl@ac23db41:
ERR_268 Cannot find a partition for dc=example,dc=com,cn=Tink
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.DBMS_LDAP", line 1487
ORA-06512: at "SYS.DBMS_LDAP", line 709
ORA-06512: at line 69
31202. 00000 - "DBMS_LDAP: LDAP client/server error: %s"
*Cause: There is a problem either on the LDAP server or on the client.
*Action: Please report this error to the LDAP server administrator or
your Database administrator.
Help me please because I run out of ideas how repair this code.
Problem was in the line:
l_retval := dbms_ldap.delete_s(l_session, l_ldap_user || ',cn=Tink');
Correct reading nodes in LDAP is: leaf.domainname.domainname
Answer for this problem:
l_retval := dbms_ldap.delete_s(l_session, 'cn=Tink,' || l_ldap_user); --l_ldap_user = 'dn=domain,dn=com'.