]> git.sur5r.net Git - openldap/blob - servers/slapd/back-sql/docs/install
documentation update. this reflects recent changes (redesign, referral and multiple...
[openldap] / servers / slapd / back-sql / docs / install
1 1. Build
2 To build slapd with back-sql under Unix you need to build and install
3 iODBC 2.50.3 (later versions should probably work, but not earlier). 
4 Then, at top of OpenLDAP source tree, run
5 "configure <other options you need> --enable-sql", then "make" -
6 this should build back-sql-enabled slapd, provided that you have iODBC 
7 libraries and include files in include/library paths, "make install"...
8 In other words, follow installation procedure described in OpenLDAP 
9 Administrators Guide, adding --enbale-sql option to configure, and
10 having iODBC libraries installed an accessible by compiler.
11
12 Under Win32/MSVC++, I modified the workspace so that back-sql is built into
13 slapd automatically, since MS odbc32.dll is included in standard library pack,
14 and it does no bad even if you don't plan to use it. I also could provide
15 precompiled executables for those who don't have MSVC.
16 Note that Win32 port of OpenLDAP itself is experimental, and thus doesn't
17 provide very convenient build environment (yet).
18
19 2. Tune datasources and slapd.conf
20 Next, you need to define ODBC datasource with data you want to publish
21 with help of back-sql. Assuming that you have your data in some SQL-compliant
22 RDBMS, and have installed proper ODBC driver for this RDBMS, this is as simple
23 as adding a record into odbc.ini (for iODBC), or using ODBC wizard in
24 Control Panel (for odbc32).
25 Next, you need to add appropriate "database" record to your slapd.conf.
26 See samples provided in "back-sql/RDBMS_DEPENDENT/" subdirectory. 
27
28 Several things worth noting about ODBC:
29 - "dbname" directive stands for ODBC datasource name (DSN),
30   not the name of your database in RDBMS context
31 - ODBC under Unix is not so common as under Windows, so you could have
32   problems with Unix drivers for your RDBMS. Visit http://www.openlinksw.com,
33   they provide a multitier solution which allows connecting to DBMSes on
34   different platforms, proxying and other connectivity and integration issues.
35   They also support iODBC, and have good free customer service through
36   newsserver (at news.openlinksw.com).
37 - be carefull defining RDBMS connection parameters, you'll probably need only
38   "dbname" directive - all the rest can be defined in datasource. maybe you
39   will want to use dbuser/dbpasswd to override credentials defined in datasource
40 - full list of configuration directives supported is available in file "guide"
41
42 3. Creating and using back-sql metatables
43 Read the file "concept" to understand, what metainformation you need to add,
44 and what for... ;)
45 See SQL scripts and slapd.conf files in samples directory.
46 Find subdirectory in "rdbms_depend/" corresponding to your RDBMS (Oracle,
47 MS SQL Server and mySQL are listed there currently), or copy and edit
48 any of these to conform to SQL dialect of your RDBMS (please be sure to send
49 me scripts and notes for new RDBMSes ;).
50
51 Execute "backsql_create.sql" from that subdirectory (or edited one),
52 so that the tables it creates appear in the same
53 context with the data you want to export through LDAP (under same DB/user, 
54 or whatever is needed in RDBMS you use). You can use something like
55 "mysql < xxx.sql" for mySQL, Query Analyzer+Open query file for MS SQL,
56 sqlplus and "@xxx.sql" for Oracle.
57
58 You may well want to try it with test data first, and see how metatables
59 are used. Create test data and metadata by running testdb_create.sql,
60 testdb_data.sql, and testdb_metadata.sql scripts (again, adopted for your
61 RDBMS, and in the same context as metatables you created before), and
62 tune slapd.conf to use your test DB.
63
64 4. Testing
65 To diagnose back-sql, run slapd with debug level TRACE ("slapd -d 5" will go).
66 Then, use some LDAP client to query corresponding subtree (for test database,
67 you could for instance search one level from "o=sql,c=RU"). I personally used
68 saucer, which is included in OpenLDAP package (it builds automatically under
69 Unix/GNU configure and for MSVC I added appropriate project to workspace).
70 And also Java LDAP browser-editor (see link somewhere on OpenLDAP site) to
71 test ADD/DELETE/MODIFY operations on Oracle and MS SQL.
72
73 See file "platforms" if you encounter connection problems - you may find
74 a hint for your RDBMS or OS there. If you are stuck - please contact me at
75 mit@openldap.org, or (better) post an issue through OpenLDAP's Issue Tracking
76 System (see http:/www.openldap.org/its).