Merry Christmas & Happy 2027! Less downtime. More good times. Celebrating 13 years of sorlavit.com
Skip to content
Sorlavit KimIT Support, Network & Infrastructure Services Let’s talk

Articles are written in English. The Thai translation button opens Google Translate; code and commands stay in their original form.

Oracle Database / Connections & Oracle Net

ORA-12154: resolve a connect identifier in the actual client environment

Find the Oracle client configuration actually used by a failing application, resolve its alias and complete a password-prompted login after the naming correction.

Start hands-on practice ↓

Compiled for Sorlavit Kim · Published · Updated · 4 min read

Problem

A connection can fail before contacting the database when the client cannot resolve its alias. Compare the application's Oracle client configuration with the terminal used for testing.

Start with this diagnostic

Run each example in the tool named in the guide: SQL, RMAN, DGMGRL or the host command shell. Replace example names with approved values. To query DBA and V$ views, use authorized catalog access in the correct database container. Do not add broad permissions just to run an example.

tnsping APPDB

What the results mean

Run this from the application's Oracle client home. Its output identifies the naming method and descriptor it resolved; successful probing does not authenticate a database account.

Fix the cause and check again

Check the intended TNS_ADMIN, alias spelling and naming-method configuration. Correct the descriptor in the configuration actually read by the application, then repeat a real login using a password prompt.

Before you make a change

Do not place database passwords on command lines or assume a terminal and service read the same configuration.

Practical guide

Download worksheet

Detailed practical guide

Prepare your workspace and inputs

Record the application executable or service, its operating-system identity, Oracle client home and expected service alias. APP_LAB and db.example.invalid below are placeholders; obtain the actual test endpoint and service name from the database owner.

Platform context: Oracle Database 19c client with TNSPING and SQL*Plus; a permitted test service and a test account. SQL*Plus and application client homes may differ.

Scenario to reproduce or investigate

A terminal connects successfully but the application reports ORA-12154. The two processes can read different naming files or use different client libraries, so restarting the database does not repair the client naming decision.

Evidence to record in your worksheet
  • Actual target and platform release
  • Exact inputs or substituted values
  • Baseline result
  • Per-step expected and observed output
  • Failure encountered and corrective action
  • Final acceptance and recovery state
  1. Locate the client used in each process context

    Use the branch matching the operating system to identify command resolution and TNS_ADMIN. Compare these observations with the application service environment. Do not assume your interactive PATH proves which library a long-running service has loaded.

    Command, configuration or input

    Linux shell:
    command -v tnsping
    command -v sqlplus
    printenv TNS_ADMIN
    
    Windows Command Prompt:
    where tnsping
    where sqlplus
    echo %TNS_ADMIN%
    Expected result

    The record names the actual application client configuration and notes any difference from the successful terminal.

    If it fails

    If the app uses JDBC thin or another client without TNSPING, use that driver’s documented naming configuration instead; do not force an unrelated Oracle home onto the application.

  2. Resolve the exact alias and inspect the attempted descriptor

    Run TNSPING from the matching client environment. Record the naming method, configuration file and attempted descriptor shown by that installed client. If local naming is intended, correct only the alias in the actual tnsnames.ora copy after preserving it. The example descriptor is illustrative and cannot connect until approved values replace the placeholders.

    Command, configuration or input

    tnsping APP_LAB
    
    Example tnsnames.ora entry:
    APP_LAB =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = db.example.invalid)(PORT = 1521))
        (CONNECT_DATA = (SERVICE_NAME = app_lab.example.invalid))
      )
    Expected result

    The client resolves APP_LAB to the owner-confirmed host, port and SERVICE_NAME. A new network or listener error means naming progressed to a different layer.

    If it fails

    If ORA-12154 remains, check exact alias spelling, syntax, active TNS_ADMIN and configured naming methods. If TNSPING reports a listener problem, follow that problem separately rather than repeatedly editing the alias.

  3. Prove authentication and application recovery separately

    Connect with SQL*Plus using a password prompt rather than putting a password in command history. Run only a read-only confirmation and repeat the actual application operation under its own identity and environment. A TNSPING OK result is not a database login test.

    Command, configuration or input

    sqlplus -L app_test@APP_LAB
    
    After the password prompt, in SQL*Plus:
    SELECT SYS_CONTEXT('USERENV','SERVICE_NAME') FROM dual;
    EXIT
    Expected result

    The login reaches the approved service and the original application operation succeeds using the corrected naming configuration.

    If it fails

    An authentication error belongs to the account or authentication layer; do not change the service descriptor to bypass it. If only SQL*Plus works, compare application environment and loaded driver settings again.

Check the result before marking this passed

The matching client resolves the correct descriptor, password-prompted authentication succeeds and the original application operation is rechecked. Listener reachability alone does not close the incident.

Record the observed result and evidence location in the downloaded worksheet. Mark unresolved or untested conditions explicitly.

Recovery and cleanup

Retain the original naming file and exact environment values. Restore only the changed client configuration if the correction breaks other supported aliases; database restart is not part of this naming-only procedure.

Apply to actual work and known limits

Use the actual Oracle client type and service-owner values. This guide is for a client alias-resolution failure; it does not validate another driver’s TLS wallet, authentication or service registration.

Authored against the cited documentation. Execution on the stated vendor product or physical equipment remains to be verified.

Source & further reading

Oracle 19c connection testing

Independently written summary reviewed on 2026-11-04. The example illustrates a possible application; it is not a client case study.

Share this article

Back to all articles