Oracle Error: ORA-12154: TNS:could not resolve the connect identifier specified

Tags Oracle TNS

Problem

You receive the error message "Oracle Error: ORA-12154: TNS:could not resolve the connect identifier specified"

Possible Solutions

This is usually caused by a problem with the Oracle tnsnames.ora file installed on the workstation.

Solution 1: Confirm that there is a "Q" drive on your computer and that it is connected.

  1. If it is disconnected, reboot your machine and try again. If you are working off campus, ensure the Global Protect client in connected and try to access the Q drive again. If it is still disconnected, please contact the Support Desk.
  2. If you do not have a "Q" drive on your computer, you must request access to the CMS data center through the Security Request Form before a "Q" drive will appear on your computer. If you have already submitted a Security Request form and that request has been completed, but still do not have the "Q" drive after rebooting your computer, please contact the Technology Support Desk.

Solution 2: Update/overwrite the tnsnames.ora files on your computer

  1. Since the Oracle client can be installed in any location on the workstation, first determine where the client is installed
    1. Search for "PowerShell" on the Windows Start Menu and open it:

  1. Type “$env:path -split ';'” without the double quotes(leaving the single quotes) and press the “enter” key.  In this example, the Oracle client is installed at "C:\app\client\product\12.2.0\client_1\bin". The Oracle installation paths will look very similar and are most often near the top of the list. If you are unsure of which path is correct, please contact the Technology Support Desk.

NOTE: It is possible to have more than one Oracle client installed.  The following steps must be performed for each Oracle install path found.

  1. The prior step helps us determine where the Oracle client is installed, but to get to the location of the tnsnames.ora file on your computer, you must replace the "bin" part of that path with "network\admin" instead.
    So in this example, the path we see in the list we get from PowerShell is:
        C:\app\client\product\12.2.0\client_1\bin
    This means the location of the tnsnames.ora file we need to work with is in:
        C:\app\client\product\12.2.0\client_1\network\admin
  2. Now that we know where the tnsnames.ora file is located on your computer, copy the two files(sqlnet.ora and tnsnames.ora) found in "Q:\Technical\Oracle\Database\Copy the files in this subfolder to user computer" to the location determined in the prior step.
    So in this example, we would copy the files in:
        Q:\Technical\Oracle\Database\Copy the files in this subfolder to user computer
    to
        C:\app\client\product\12.2.0\client_1\network\admin
  3. Retry the action that gave you the "Oracle Error: ORA-12154: TNS:could not resolve the connect identifier specified" error message. If you still receive this message after following all of these steps, please contact the Technology Support Desk.
100% helpful - 1 review

Details

Article ID: 110220
Created
Tue 6/16/20 4:02 PM
Modified
Fri 9/2/22 5:01 PM