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