Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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 :-)
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.
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.
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?
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.
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?
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?
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.
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 :-)
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.