Question

I am looking to understand how to implement an OID connection string in .Net using the Oracle.DataAccess.dll .

The OID connection string is in this format: ldap://servname:389/instance,cn=OracleContext

When I use this as my datasource, I receive this error: ..is an invalid connection string attribute

What is the format to connect to Oracle's OID?

Thank you, Scott

Was it helpful?

Solution 2

After being diverted for almost two years, I came back to this issue and sort of have a solution.

First, Oracle notes that ldap support is not supported in the managed library for oracle. Boo. http://www.oracle.com/technetwork/database/windows/downloads/odpmbetainstall-1696475.html

Second, using this thread: How do I query LDAP from C# to resolve Oracle TNS hostname while using managed ODP.NET?

I was able to rig up an ldap lookup for the tns connection string, and ultimately pass that on to nhibernate.

I hope the Oracle eventually supports ldap.

OTHER TIPS

Oracle's idea is to configure the LDAP server (OID in your case) in the LDAP.ORA file in the TNS Admin directory (usually $ORACLE_HOME/network/admin). There you have something like:

DIRECTORY_SERVERS = (servname:389)
DEFAULT_ADMIN_CONTEXT = "dc=company,dc=com"
DIRECTORY_SERVER_TYPE = OID

You might also need to adapt the SQLNET.ORA file:

NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES)

Then your connection string is just:

Data Source=instance; User ID=scott; Password=tiger

(or even without user ID and password).

Update:

If you cannot change the TNS Admin directory, the only option I know of is to use connection strings containing all the details (server name, port, SID or service name). There are three formats:

TNS syntax:

Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=serername)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=instanceSID))); User ID=scott; Password=tiger

EZ Connect with a service name (note the single slashe between the server name and the service name):

Data Source=//servername:1521/servicename; User ID=scott; Password=tiger

EZ Connect with an SID (note the double slashes between the server name and the SID):

Data Source=servername:1521//instanceSID; User ID=scott; Password=tiger
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top