Is it possible to perform an LDAP query through SQL in TOAD?
What connection type? The answer is yes for Oracle. I would have to check on other connection types.
Debbie
I can’t seem to get much help from our LDAP guys…apparently it is Sun Directory Server.
But what database type do you want to connect to? For Oracle follow these instructions.
To configure the Oracle client for LDAP
-
Obtain the LDAP.ORA file from your database administrator.
-
Copy the LDAP.ORA file to the folder where the SQLNET.ORA file for your Oracle client is located. The default folder is: ORACLE_HOME\network\admin
-
Open the SQLNET.ORA file and enter “(LDAP)” as the value for the NAMES.DIRECTORY_PATH as follows:
NAMES.DIRECTORY_PATH= (LDAP)
Note: If you are using multiple naming methods, add the (LDAP) value to existing parameter values. For example, if you are using both the TNSNAMES and LDAP naming methods, add LDAP to TNSNAMES as follows:
NAMES.DIRECTORY_PATH= (TNSNAMES, LDAP)
-
Save the SQLNET.ORA file.
-
Launch Toad and select File | New | Connection.
-
Create an LDAP connection following the procedure in Create Oracle Connections. In step 3, select a database on the LDAP server from the Database Name list.
Yes, I had done all of that, but the LDAP DB does not show as an option when attempting to do a new Oracle connection type.
When I asked the LDAP group here if it was an Oracle database, this is the answer I got:
Yes and no. Oracle LDAP generally refers to Oracle Internet Directory (which is an LDAP “shim” to allow LDAP access to an Oracle database). However, as you probably know, Oracle acquired Sun. And, they are keeping both OID and Sun’s Directory Server product line.
So, not much additional help. I apologize.
When you have ldap successfully configured the entries will just show up in the Oracle Database name drop down. They will not look any different and will be merged with any existing TNSname entries. Do you see any additional entries that are not in your tnsnames.ora file?
Debbie
I see all of the entries that are in my TNSnames file, but do not see the LDAP entry from the ldap.ora file. I am not sure I have that file formatted correctly since I had to create one because our admin didn’t send one.
It looks like this (obviously I’ve had to mask some of the actual data):
ldap.ora Network Configuration File: C:\oracle\product\10.2.0\network\admin\ldap.ora
Generated by Oracle configuration tools.
DEFAULT_ADMIN_CONTEXT = “o=companyname,c=us”
DIRECTORY_SERVERS = (dirxxx.corp.xxxxx.com:389:636)
DIRECTORY_SERVER_TYPE = OID
Obviously the OID part is incorrect since it is a Sun Directory Server…
Thank you for continuing to help figure this one out!
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (LDAP,TNSNAMES, EZCONNECT)
Other than those two things it should work without a problem. I tested with a 9i ldap server.
Debbie
I am not sure about the default_admin_context as we don’t use that here. But the rest looks correct. What does your sqlnet.ora file look like? It need to have ldap in the names.directory_path as shown below. Check that.
Yes, I had LDAP in the sqlnet.ora file as well.
I don’t know what it could be…very frustrating.
I am using Oracle 10g client…do you think that could be it?
Oracle 10g client should be fine.
You could try the following things:
-
take out the value for DEFAULT_ADMIN_CONTEXT.
-
Ping the server name you are using. Maybe this is not resolving and you need to use IP address, etc.
-
Find other internal user that uses LDAP. They don’t have to be using TDA. Just see how they have things configured.
Debbie