[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: OpenLDAP + Oracle 10g - ldapsearch returns no result, ldapmodify returns failure



Hi Pierangelo,

Thanks for pointing out and thank Zhang Pu gave me a lot help also.

I am able to perform ldapsearch and got the result.

As next step, I added a new person object using the following
ldif data and added without any errors on console.

  [root@agito-rm root]# cat tk_0.ldif 
  dn: cn=Person0,o=sql,c=RU
  objectClass: Person
  cn: Person0
  sn: A

  [root@agito-rm root]# /usr/openldap/bin/ldapadd -x -D
"cn=root,o=sql,c=RU" -w cisco -f tk_0.ldif 
  adding new entry "cn=Person0,o=sql,c=RU"

But, I can not find this new entry when I performed another ldapsearch.

I use SQLplus to perform "select * from ldap_entries" and found out that
KEYVAL value for this new entry is "0".

ID  DN                                 DN_RU  OC_MAP_ID  PARENT  KEYVAL

1   o=sql,c=RU                                3          0        1  
2   cn=Mitya Kovalev,o=sql,c=RU               1          1        1  
3   cn=Torvlobnor Puzdoy,o=sql,c=RU           1          1        2  
4   cn=Akakiy Zinberstein,o=sql,c=RU          1          1        3  
5   cn=Akakiy Z002,o=sql,c=RU                 1          1        4  
6   cn=Person0,o=sql,c=RU                     1          1        0  


Shouldn't this KEYVAL be "5" ?

>From the 'slapd -d -1' log, looks like it passed in "0" instead of "5":

   backsql_add(): executing "INSERT INTO ldap_entries
(id,dn,oc_map_id,parent,keyval) 
                  VALUES ((select max(id) +1 from
ldap_entries),?,?,?,?)" for dn "cn=Person0,o=sql,c=RU"
                  for oc_map_id=1, parent_id=1, keyval=0

And

I also performed "select * from persons" and found out that
the value for NAME column is 1 "blank space" for this new entry.

ID  NAME  
1   Mitya Kovalev  
2   Torvlobnor Puzdoy  
3   Akakiy Zinberstein  
4   Akakiy Z002  
5     	


Could it be some sql statement problems in testdb_metadata_wo_d.sql?


slapd.conf, all sql scripts and 'slapd -d -1' message logs are attached.


Thank for helping,
-Tohru
 

 | -----Original Message-----
 | From: Pierangelo Masarati [mailto:ando@sys-net.it] 
 | Sent: Wednesday, June 08, 2005 11:47 PM
 | To: Tohru Kao (tohru)
 | Cc: openldap-software@OpenLDAP.org
 | Subject: Re: OpenLDAP + Oracle 10g - ldapsearch returns no 
 | result, ldapmodify returns failure
 | 
 | Tohru Kao (tohru) wrote:
 | 
 | >Hi,
 | >
 | >I am currently investigating how to use Oracle as backend
 | >for OpenLDAP.  I got to the point that Oracle and ODBC
 | >has installed and running correctly. 
 | >
 | >I am able to use 'iodbctest' to perform SQL query; 
 | >but there is no result coming back using ldapsearch and 
 | >failure using ldapmodify.
 | >
 | >Here are the steps I performed:
 | >
 | >I am using a box running RedHat Enterprise Linux ES 3 update 5:
 | >- Install Oracle 10g
 | >- Install OpenLink ODBC Oracle Driver
 | >- Install and Recompiled OpenLDAP 2.2.26
 | >- Imported all sql that included in this email:
 | >  - backsql_create.sql
 | >  - testdb_create_wo_d.sql
 | >  - testdb_data_wo_d.sql
 | >  - testdb_metadata_wo_d.sql
 | >  (those are modified from original scripts under 
 | >   openldap-2.2.26/servers/slapd/back-sql/rdbms_depend/oracle)
 | >
 | >- Start sladp using 'sladp -d 5'
 | >
 | >- run ldapsearch -x -b "o=sql,c=RU" "(objectclass=*)"
 | >  Return result is:
 | >    # search result
 | >    search: 2
 | >    result: 0 Success
 | >
 | >- run ldapmodify -x -D "cn=root,o=sql,c=RU" -w cisco -f tk_0.ldif 
 | >  Return result is:
 | >    modifying entry "cn=Person0,o=sql,c=RU"
 | >    ldap_modify: No such object (32)
 | >
 | >I have attached 2 zip files and my slapd.conf in this email.
 | >
 | >I appreciate any suggestions or comments on this.
 | >
 | >Thank you very much,
 | >-Tohru Kao
 | >
 | > 
 | >  
 | >
 | The last line of your slapd.conf appears to be corrupted.  I 
 | suggest you 
 | add the
 | 
 | has_ldapinfo_dn_ru   no
 | 
 | statement; see slapd-sql(5) for details (this should be off 
 | by default, 
 | I fear).
 | 
 | p.
 | 
 | 
 |     SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: 
 | +390382476497
 | 

Attachment: debug-logs.zip
Description: debug-logs.zip

Attachment: testdb_and_slapd_conf.zip
Description: testdb_and_slapd_conf.zip