A connection name such as APP_CONN identifies the connection details a client needs. With directory naming, those details are maintained in a shared directory. Several clients can look up the same centrally maintained entry instead of maintaining a separate service mapping on each machine.
Oracle DBA Lesson 37 Part 1 — Directory Naming
By the end of this lesson, you should be able to follow a directory lookup, explain which client settings control it, and locate a connection failure in naming, listener or service access, or database authentication.
Follow a directory-based connection
APP_CONN resolves to a listener at dbhost:1521 and requests app_service.
- The client resolves
APP_CONNusing its configured naming methods. - When it uses directory naming, it sends a lookup request using LDAP, the Lightweight Directory Access Protocol.
- The directory finds the relevant entry and returns a connect descriptor. The descriptor contains the listener address and requested service.
- The client uses that descriptor to send a connection request to the listener. The requested service identifies suitable database handling for the connection.
- The database authenticates the user. A successful login establishes a database session.
The directory entry stays in the directory. The returned descriptor gives the client the information for its subsequent connection request. Directory access may itself require a configured bind or secure connection. This requirement concerns accessing directory information. The database login still follows the database's configured authentication rules.
Here APP_CONN is a net service name. Oracle also supports a specific directory object called a network service alias, which references another service entry rather than storing its own descriptor. See managing network address information.
Inspect the effective client configuration
An example sqlnet.ora setting is:
NAMES.DIRECTORY_PATH = (TNSNAMES, LDAP, EZCONNECT)
This is the lesson's selected order, not a statement of the default order. It tells the client to try local naming, directory naming, and Easy Connect in that sequence while resolving a connect identifier.
With this order, a matching local tnsnames.ora entry supplies the descriptor before the client needs LDAP. If no local entry resolves the name, the client can try directory naming. Naming-method progression concerns resolving a name. Connect-time failover concerns attempts using addresses in a resolved descriptor. A connection failure after a successful local resolution does not establish that Oracle will look up the same name through LDAP to repair the destination. See sqlnet.ora parameters.
For an explicitly configured directory, inspect the existing ldap.ora settings:
| Setting | What to understand |
|---|---|
DIRECTORY_SERVERS | The directory server host names and ports, including configured alternate servers. |
DEFAULT_ADMIN_CONTEXT | The directory entry containing the Oracle Context in which the client searches for the connection name. |
DIRECTORY_SERVER_TYPE | The supported directory type configured for this client. |
A reachable directory can still fail to supply the requested name when the entry is missing or the search context is wrong. Directory access, name spelling, and service-entry location all matter. See ldap.ora parameters.
Oracle configuration tools create directory usage settings. Some supported configurations discover directory information through DNS. The explicit ldap.ora path shown here is one configuration approach. The effective files depend on the installed client and its configuration, including the applicable TNS_ADMIN, LDAP_ADMIN, and Oracle home locations.
Work through a stale local entry
Suppose the directory maps APP_CONN to the current application service, but this client has a local entry with oldhost:1521/app_service.
With TNSNAMES first and a matching local entry, the client resolves from that local file and attempts its saved destination. A directory update therefore might not explain the behavior of that particular client. Inspect the mapping actually selected by the client making the connection.
Compare effective configuration when one machine works and another fails. Keep managed local overrides documented and maintained so their purpose and freshness are clear. See troubleshooting Oracle Net Services.
Use connection tests to locate the failure
From the affected client, inspect resolution and listener reachability:
tnsping APP_CONN
Review the reported naming adapter and descriptor. Check the host, port, and requested service. A name-resolution error points toward the name and naming configuration, including directory location, access, and search context. A successful TNSPING response establishes that the listener is reachable at the resolved address. It does not establish a successful database login or prove that the requested service accepts the account. See testing connections.
Attempt a database login:
sqlplus -L APP_USER@APP_CONN
Enter the password when prompted. Interpret the actual returned error: listener or network reachability, an unavailable requested service, and database authentication are different possible failure stages. Service and account conditions can change, so use the error and the attempted destination to guide the next check.
For a controlled comparison, use the same client and account with the known valid endpoint and service:
sqlplus -L APP_USER@//dbhost:1521/app_service
Easy Connect supplies those connection details directly. If this login succeeds while the alias remains unresolved, focus on the alias-resolution path. That successful attempt shows the supplied endpoint and account worked at that time. It does not repair a missing directory entry, incorrect context, or client naming configuration. Easy Connect must be enabled for the client, and ordinary host-name resolution and network access must still work.
Directory availability
A new lookup that needs the directory depends on directory availability. An already established database session uses its existing database connection and can continue if that connection and the database remain healthy.
A managed local mapping can offer another naming option when its order, contents, and destination are suitable. Cached descriptor behavior varies by client and configuration. Verify the actual behavior and lifetime before relying on a cache during an outage. No universal cache or automatic-fallback guarantee is assumed here.
No comments:
Post a Comment