Question

Toad/Oracle has a mechanism where it can use LDAP to lookup a list of database endpoints. It uses a file called ldap.ora which looks like:

DIRECTORY_SERVERS= (server1.foo.bar.baz:1628:1629, server2.foo.bar.baz:1628:1629)
DEFAULT_ADMIN_CONTEXT = "dc=foo,dc=bar,dc=baz"
DIRECTORY_SERVER_TYPE = OID

I'd like to somehow invoke the LDAP lookup and export the list of database endpoints (including server, port, etc.) so that I can connect via JDBC/SQuirreL.

  1. Is there a way that I can generate the list of database endpoints given the LDAP servers?
  2. Or better yet is there some oracle / SQuirreL integration that does the LDAP lookup?

* Update *

I originally thought I needed the server/port for each database server to formulate a JDBC url. I have now found that I can connect to a database through the ldap directory server using a connection url like:

jdbc:oracle:thin:@ldap://server1.foo.bar.baz:1628/XXXX,cn=OracleContext,dc=foo,dc=bar,dc=baz

Where XXXX is the SID of a database. So, it now seems that all I need is a list of SID's. I'm hoping that I can do this in sqlplus.

Was it helpful?

Solution

Well, you can query LDAP for the data. (Do not know how SQuirreL can do this unless you modify the code).

You need to query your LDAP for (objectclass=orclDBServer) and the data you are looking for is in the attribute orclnetdescstring and will look some thing like:

orclnetdescstring: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ordb0001.yourdomain.com)(PORT=1523))(CONNECT_DATA=(SERVICE_NAME=db.iss.com)))

-jim

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top