You are now on my old blog. Please update your bookmarks to my new blog
http://laurentschneider.com




09 October 2006

Migration of tnsnames.ora to LDAP (Sun Java System Directory Server)

In this post, I did show how easy it is to use OID to resolve your network service names.

Apart OID, AD (Microsoft Active Directory) is also supported.

However, I do not want to use such products, as my customer already have a Sun Java System Directory Server running.

It is quite easy. Here are the steps with the SunOne Console.

1) expand the schema
login to the Directory Server as cn=directory manager
click schema in the configuration tab
In the Attributes subtab, click create, and type it orclnetdescstring as attribute name, and select OctetString as Syntax, and uncheck multi-valued, click OK.
In the Object Classes subtab, Create a class named OrclService , add cn as required attribute and orclnetdescstring as allowed attribute. Click OK

2) start adding services
either with your prefered ldap GUI (like Siemens DirX Manager) or with command line
lsc01.diff
dn: ou=intranet, dc=lcsys, dc=ch
ou: intranet
objectClass: top
objectClass: organizationalunit

dn: ou=applications, ou=intranet, dc=lcsys, dc=ch
ou: applications
objectClass: top
objectClass: organizationalunit

dn: ou=TNSnames, ou=applications, ou=intranet, dc=lcsys,dc=ch
ou: TNSnames
objectClass: top
objectClass: organizationalunit

dn: cn=OracleContext, ou=TNSnames, ou=applications, ou=intranet, dc=lcsys, dc=ch
cn: OracleContext
objectClass: top
objectClass: orclservice

dn: cn=lsc01, cn=OracleContext, ou=TNSnames, ou=applications, ou=intranet, dc=lcsys, dc=ch
cn: lsc01
objectClass: top
objectClass: orclservice
orclnetdescstring: (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST=blade01.lcsys.ch)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = lsc01.lcsys.ch)))


which I can add with

ldapadd -h blade01 -p 34001 -D "cn=Directory Manager" -w *** -f lsc01.ldif

adding new entry ou=intranet, dc=lcsys, dc=ch

adding new entry ou=applications, ou=intranet, dc=lcsys, dc=ch

adding new entry ou=TNSnames, ou=applications, ou=intranet, dc=lcsys, dc=ch

adding new entry cn=OracleContext,ou=TNSnames, ou=applications, ou=intranet, dc=lcsys, dc=ch

adding new entry cn=lsc01, cn=OracleContext, ou=TNSnames, ou=applications, ou=intranet, dc=lcsys, dc=ch


Configuring sqlnet.ora and ldap.ora is the last step :
sqlnet.ora
TNSPING.TRACE_LEVEL = SUPPORT
TNSPING.TRACE_DIRECTORY = /tmp
NAMES.DIRECTORY_PATH= (LDAP)


ldap.ora
DIRECTORY_SERVERS= (blade01:34001)
DEFAULT_ADMIN_CONTEXT = "ou=TNSnames, ou=applications, ou=intranet, dc=lcsys, dc=ch"


try to tnsping, it should work. If it does not, check /tmp/tnsping.trc

$ tnsping LSC01

TNS Ping Utility for Solaris: Version 9.2.0.8.0 - Production on 09-OCT-2006 15:50:42

Copyright (c) 1997, 2006, Oracle Corporation. All rights reserved.

Used parameter files:
/export/home/schnela1/tmp/sqlnet.ora

Used LDAP adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = blade01)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = lsc01.lcsys.ch)))
OK (0 msec)




note that using something else than OID or AD is not supported

2 Comments:

Blogger Laurent Schneider said...

instead of using the GUI to extend the schema, you could modify the ldif files in $ORACLE_HOME/ldap/admin of an OID installation and replace the subschemacomponent by "schema" (SunOne)

20/10/06 10:36  
Anonymous Anonymous said...

I know this post was a while ago, but I'm wondering if you could give me some advice.

I'm trying to use ApacheDS Server to host the ldap entries, and I'm running into trouble.

My thought is that its the Schema entries:

dn: m-oid=2.99.1,ou=attributeTypes,cn=oracle,ou=schema
objectClass: metaAttributeType
objectClass: metaTop
objectClass: top
m-oid: 2.99.1
m-collective: FALSE
m-description: oracle
m-equality: caseIgnoreMatch
m-name: orclnetdescstring
m-nousermodification: FALSE
m-obsolete: FALSE
m-singlevalue: TRUE
m-syntax: 1.3.6.1.4.1.1466.115.121.1.40
m-usage: USER_APPLICATIONS

dn: m-oid=2.99,ou=objectClasses,cn=oracle,ou=schema
objectClass: metaObjectClass
objectClass: metaTop
objectClass: top
m-oid: 2.99
m-description: Oracle
m-must: orclnetdescstring
m-name: OrclService
m-obsolete: FALSE
m-supobjectclass: top
m-typeobjectclass: AUXILIARY

I don't know if some of these settings are wrong, or if its something else.

Does the location of the objects matter? The OID's? Also, will oracle do a SUB lookup or one BASE or ONE?

15/2/08 05:12  

Post a Comment

<< Home