LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-29-2009, 10:53 AM   #1
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 52

Rep: Reputation: 15
LDAP use with Oracle database


Hi,

I have a system that has an oracle database of employees in my building. What I am trying to do is use LDAP with that database since it already contains all the entries that I would need. Is there any way for me to use the oracle database as the backend for my LDAP software? Thanks in advance for any feedback.
 
Old 07-29-2009, 12:37 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

You might want to re-think this approach (if it is at all possible....).

Using 2 databases (in this case one RDB: oracle and one directory based: ldap), while either of those can do that particular job isn't the way to go.

If ldap needs to be used, you could make a smart sql query to extract the relevant data out of oracle, edit it (automated?) and put it into an ldif formatted file for use with ldap.

Probably not what you wanted to read, but my 2c nonetheless :-)
 
Old 07-29-2009, 01:21 PM   #3
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 52

Original Poster
Rep: Reputation: 15
Thank you for the input. I had thought about doing that actually. My boss just wanted me to find a way to use oracle with LDAP, and you always have to listen to the boss man right? :-)
Maybe I can get him to come around.
 
Old 07-30-2009, 06:26 AM   #4
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
Quote:
Originally Posted by nhay View Post
you always have to listen to the boss man right?
Yes, you listen, then you gently explain why they're wrong and how to do it properly, because that's your function.

To answer the original question...
Oracle is a Relational Database. It does well with multiple tables of related data. LDAP is based on a tree structured database... it is basically a binary tree indexed flat-file. Using Oracle as a backend to LDAP would be hugely inefficient, as Oracle simply isn't optimised for the sort of access LDAP requires.
That, and the fact that Oracle licenses are expensive, and pretty much all LDAP servers come with Sleepycat or something bundled.
 
Old 08-10-2009, 09:19 AM   #5
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 52

Original Poster
Rep: Reputation: 15
Sorry for the late reply on this. I was wondering if anyone had an idea as to how to get the extracted data into ldif format. I can extract the data to an ldif file using spool but of course this isn't in correct ldif format. Any suggestions?
 
Old 08-10-2009, 09:38 AM   #6
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
Can you give an example of the data. Situations vary wildly as to what is or is not the correct LDIF format. Schema's will be different across different systems and so on.
 
Old 08-10-2009, 09:47 AM   #7
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 52

Original Poster
Rep: Reputation: 15
Here's an example of what I'd be looking for:

dn: cn=test,dc=example,dc=com
myname: John Doe
group: My Group
myemail: jdoe@example.com
office: Willis 545
officephone: 555 5555
cellphone: 555 1234
objectclass: employee
 
Old 08-10-2009, 09:54 AM   #8
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
Do all these elements exist in the Oracle db currently? If so, a simple script in your language of choice would create the LDIF.
What LDAP server are you using?

Also, can you clarify exactly what you are trying to achieve here. Export data from Oracle to LDAP, or what?
 
Old 08-10-2009, 10:03 AM   #9
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 52

Original Poster
Rep: Reputation: 15
What I am trying to do is extract information from the Oracle database and somehow get it into ldif format so I can update the LDAP database.

Are you asking which version of LDAP server I'm using?
 
Old 08-10-2009, 10:07 AM   #10
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
No, which server... possibilities are RedHat, Fedora, Mozilla, OpenLDAP and many more.
They each import data differently.
I would also recommend getting JXplorer to help you navigate your directory.

Also, do all the elements you mention in the sample exist in the Oracle db?

Have you any familiarity with any scripting languages?

Last edited by nowonmai; 08-10-2009 at 10:08 AM.
 
Old 08-10-2009, 10:56 AM   #11
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 52

Original Poster
Rep: Reputation: 15
I'm using OpenLDAP I believe. As for the elements, I created my LDAP schema independent of the Oracle db so the information in the ldif may not exist in that exact form in the database. As for scripting languages I've only briefly worked with javascript, php, and perl.
 
Old 08-10-2009, 03:17 PM   #12
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 52

Original Poster
Rep: Reputation: 15
I just talked with my boss and he'd like me to write this script in Perl. I've done some basic perl modules in my time but haven't gone too in depth. I'm reading up on it right now. I welcome any suggestions to point me in the right direction though :-)

Thanks in advance.
 
Old 08-11-2009, 06:29 AM   #13
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
If it was me, and it was a one-off Oracle -> LDAP transfer, I'd run a simple select SQL script to a text file, and then parse this with awk to create the LDIF.

If you need to use Perl, though, you want to look at the DBD::Oracle CPAN module and DBI in general.

I'd still be interested in knowing the overarching reasoning behind what you are trying to achieve here. I get the actual things you are trying to do, but I just don't get why... not that it's any of my business, but I might be able to give some overall guidance rather than a step-by-step how-to.

Last edited by nowonmai; 08-11-2009 at 06:34 AM.
 
Old 08-11-2009, 10:00 AM   #14
nhay
Member
 
Registered: Jul 2009
Location: Durham, NH
Distribution: Fedora
Posts: 52

Original Poster
Rep: Reputation: 15
Well we have an oracle database of the employees in my building. When a new employee comes in they are added to our systems and to the database as well. My boss wants LDAP to be used so that users can have a good way to look up information about other users in the building (office, email, etc.). What I need to do is make it so that the LDAP database updates when the oracle database updates so that this is all done automatically. I don't know if that makes it more clear or not.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Oracle database help baks Programming 2 07-23-2007 03:55 AM
LXer: Oracle(R) Database Standard Edition One and Oracle Enterprise Linux on HP Set New World Record for Price Performance with TPC-C Benchmark LXer Syndicated Linux News 0 06-12-2007 06:01 PM
Difference between Oracle Server and Oracle Database ganninu Programming 3 02-27-2007 02:06 AM
Oracle database. chuck77 Linux - General 1 03-02-2006 09:24 AM
ldap using Oracle backend cristophus Linux - Software 0 02-16-2006 04:53 AM


All times are GMT -5. The time now is 09:35 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration