Oracle TNS name resolution with OpenLDAP
Use an OpenLDAP directory instead of Oracle Internet Directory to centralise TNS aliases.
An LDAP directory (OpenLDAP) can act as a central repository for Oracle TNS aliases, replacing Oracle Internet Directory. Two replicated Linux servers provide high availability.
Client configuration
In %ORACLE_HOME%\network\admin:
- Edit
sqlnet.oraso that LDAP is queried first:
names.directory_path = (LDAP,TNSNAMES)
- Add an
ldap.orafile:
DIRECTORY_SERVERS = (ldapserver01:389, ldapserver02:389)
DEFAULT_ADMIN_CONTEXT = "dc=example,dc=com"
DIRECTORY_SERVER_TYPE = OID
- Remove the local
tnsnames.orafile so aliases are resolved through LDAP.
Server configuration
Entries are edited with an LDAP administration client (for example LDAP Admin):
- connect to both LDAP servers;
- base DN:
dc=example,dc=com; - user:
CN=Manager,DC=example,DC=com; - to add an alias, copy an existing entry (right-click, copy) and adjust its attributes.
Verification
Test name resolution with a simple tnsping on the alias.
Notes
- Entries must be strictly identical on both LDAP servers.