Troubleshooting PHP ORA-12154

I have studied the php troubleshooting faq - I have php5+apache2 set up on what I think are two identical servers. One works, the other doesn't. Both establish ORACLE_HOME and TNS_ADMIN in the httpd script right before starting httpd.
I have a test file where I to getenv on both ORACLE_HOME and TNS_ADMIN and print them out - they look fine.
Then the script tries to connect to the database. In the server that fails, I get the error "_oci_open_server: Error while trying to retrieve text for error ORA-12154" as if it is clueless about ORACLE_HOME. What gives? How can I troubleshoot?

Ahah! The trick is to make sure that the /home/oracle folder is chmod to 755 from the default 700. All the installed files are neatly 755 except if the baseline /home/oracle folder is 700 httpd can never look in there!

Similar Messages

  • CONCSUB failed due to ORA-12154: TNS:could not resolve service name

    Hiall,
    While bringing up concurrent managers getting the below error.
    Cause: CONCSUB failed due to ORA-12154: TNS:could not resolve service name
    I just cloned the instance.
    urgent help is appreciated as I am missing the dead line to complete clone.
    Regards,
    Siva

    Pleas post OS and EBS version
    Please check the listener is up and running on DB tier.
    TROUBLESHOOTING GUIDE: ORA-12154 & TNS-12154 TNS:could not resolve service name [ID 114085.1
    Edited by: 3Amigos on Nov 21, 2010 9:16 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • ORA- 12154 Error: while php connect to oracle?

    While I use OCILogon connect to Oracle9i,show error message as follow:
    Warning: ociopen_server: Error while trying to retrieve text for error ORA-12154 in /var/www/html/inc/sev.inc.php on line 57
    most of people think of its tnsname' problem,but I modify my tnsnames.ora,and sqlplus can connect with correct username and password.
    page source as follow:
    <?
    function db_connect()
    //putenv("ORACLE_SID=test");
    //putenv("NLS_LANG=SIMPLIFIED CHINESE.ZHS16CGB231280");
    putenv("ORACLE_HOME=/home/oracle/OraHome1");
    $connect = OCILogon("system","manager","test");
    if ($connect)
    return $connect;
    else
    return -1;
    ?>
    server Env: linux red hat 8.0,apache 2.0.44,php4.3.1,oracle9.2.0
    please! Thank in advance!

    Do you have more than ONE oracle homes created?
    Does your PATH env. variable correctly references the ORACLE_HOME directory?

  • Php connect to oracle 8i,it occur ORA-12154

    Warning: ociopen_server: Error while trying to retrieve text for error ORA-12154 in /SOHU/community/bbs/html/inc/dbcon.php3 on line 4

    Do you have more than ONE oracle homes created?
    Does your PATH env. variable correctly references the ORACLE_HOME directory?

  • Instantclient - oci8 - ORA-12154

    I've read all the relevant threads in the forum and still I am receiving the same error:ORA-12154.
    I am using instantclient (Downloaded from OTN) in Linux.
    I use the /php/DB/oci8.php interface and the object DB_oci8() in order to connect.
    while from the same file.php, where I am trying to connect, I display the environment vars and they seem OK, PHP cannot find the tnsnames.ora and eventually the database I call.
    If I use the whole description copied from the tnsnames, then it is connected!
    WHAT is wrong with that?
    Please help.
    Thanks in advance,
    J.Lagos

    Whereabouts are you setting the Oracle environment variables? Setting them in the PHP script or in httpd.conf apparently doesn't work, you have to set them in the shell before apache is started.
    You need ORACLE_HOME and LD_LIBRARY_PATH set, and possibly TNS_ADMIN if you're using a tnsnames.ora file.
    We've recently had this problem, but setting the variables beforehand fixed it.
    See the troubleshooting faq on PHP and Oracle for more info on this problem:
    http://www.oracle.com/technology/tech/php/htdocs/php_troubleshooting_faq.html
    Hope it helps!

  • Error while trying to retrieve text for error ORA-12154

    Hello,
    I try to install php 5.1.2 on a WIN2003 server and IIS6 with the OCi8 extension without success from several days.
    On my server I've a 920 oracle client and the 10.1 instant client, I copy the tnsnames.ora in the instant client's directory.
    I've declare many environnement variables :
    - NLS_LANG : AMERICAN_AMERICA.WE8MSWIN1252
    - TNS_ADMIN : E:\...\oracle\instantclient_10_1
    - ORA_NLS33 : E:\..\oracle\920\ocommon\nls\ADMIN\DATA
    With the php command line the oci_connect function correctly works : the php command line use the instant client's tnsnames.ora. I can query with success my database.
    When I try to load a web php script (the same as the php command line script) I have the following error " Error while trying to retrieve text for error ORA-12154" ( oci_connect( $user , $pass, $sid ) . The $sid variable have the value of an alias declared in the tnsnames.ora.
    If I replace the sid's alias by something like this " (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xx.xx.xx.xx)(PORT=1521)))(CONNECT_DATA=(SID=xx)" in the oci_connect function, I have another error : Error while trying to retrieve text for error ORA-12705.
    A web page with the phpinfo function displays the following messages about oci8 extension : It seems to be correct.
    oci8
    OCI8 Support enabled
    Revision $Revision: 1.269.2.8 $
    Active Persistent Connections 0
    Active Connections 0
    Temporary Lob support enabled
    Collections support enabled
    Do you have any idea ? Thanks a lot

    The web server is not seeing the Oracle environment correctly. You need to set PATH to the instant client libraries. ORA_NLS33 is not used for Oracle 10g clients. Perhaps you have some library conflict with two versions of Oracle on the machine?
    These may help:
    http://www.oracle.com/technology/tech/php/htdocs/php_troubleshooting_faq.html#envvars
    http://blogs.oracle.com/opal/2006/05/01

  • Php3 + oracle + apache - ORA-12154

    Hi,
    I build php3 with oracle support, installed oracle 8.1.5 on
    RedHat 6.0 and used dbassit and netasst to configure it.
    Oracle works fine. I can use sqlplus and read table from Acces.
    But, when I try to log on oracle with php3, it does not work :
    ORA-12154
    here what i try to run :
    <?php
    print "<HTML><PRE>";
    $db = "WWWITT";
    $c1 = ocilogon("scott","tiger",$db);
    ?>
    here my tnsnames.ora :
    WWWITT.ITTRALEE.IE =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = apache)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = WWWITT)
    here my sqlnet.ora:
    TRACE_UNIQUE_CLIENT = on
    NAMES.DEFAULT_DOMAIN = ittralee.ie
    TRACE_LEVEL_CLIENT = USER
    TRACE_LEVEL_SERVER = USER
    SQLNET.EXPIRE_TIME = 0
    here my listener.ora :
    LISTENER =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = apache)(PORT = 1521))
    (PROTOCOL_STACK =
    (PRESENTATION = TTC)
    (SESSION = NS)
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = orapache)
    (ORACLE_HOME = /opt/oracle/oracle8.1.5)
    (SID_NAME = WWWITT)
    TRACE_LEVEL_LISTENER = USER
    so what did i did wrong ?
    thanks, ronan
    null

    Hi,
    You may require ODBC access to your Oracle database; this can be
    provided by Openlink Software at http://www.openlinksw.com. We
    have many clients using PHP scripts on Linux/Unix to connect
    with Oracle running on remote servers (or the same machine).
    Good luck!
    Guest (guest) wrote:
    : Ok..I think I know what's the problem is. Ok, here are 2
    : scripts, working and NOT working:
    : NOT WORKING:
    : <? $conn = ocilogon("username", "password","DB"); ?>
    : Error: Warning: oci8_open_server: Error while trying to
    retrieve
    : text for error ORA-12154
    in /usr/local/apache/htdocs/oracle.php3
    : on line 4
    : WORKING: <? putenv("ORACLE_HOME=/path/to/oracle");
    : $conn = ocilogon("username","password","DB"); ?>
    : Works for me...!
    : Hope this will help!
    null

  • TNS error ORA-12154

    Hi all,
    One of our client is trying to connect to our database from his local pc. We are able to connect to the database fine from here.
    But when he connects from his pc via vpn it gives him this error:
    Ora-12154: TNS:could not resolve the connect identifier specified.
    I checked the path and the Oracle client is in the path on his pc. Tnsping works. Not sure what else I should check. I do not have access to his pc, I just have to troubleshoot on the phont.
    Below is his sqlnet.ora and tnsnames.ora.
    # SQLNET.ORA Network Configuration File: C:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora
    #NAMES.DIRECTORY_PATH= (TNSNAMES)
    # tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora
    # Generated by Oracle configuration tools.
    alp =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = alm)(PORT = 1525))
    (CONNECT_DATA =
    (SID = alp)
    (SERVER = DEDICATED)
    Please give me your suggestions.
    Thanks.
    Edited by: user553564 on Oct 3, 2008 7:55 AM

    When you do the tnsping, does it say using tnsnames or hostname? I've noticed it can be a bit confusing when you have a host running oracle that is not in your tnsnames.ora, it will successfully tnsping, because the host has a listener running, but you can't attach because the connection string is different. For example, I can tnsping a host named POLARIS, which is not in my tnsnames.ora, but it is in DNS and is running XE. D'Oh!
    You might consider trying a service_name that matches your lsnrctl status output, rather than SID in the tnsnames.ora. It's also possible the user has multiple tnsnames.ora (especially if several things have been installed), and is picking up the wrong one. Try changing things the connect name to something just plain weird and see if it makes a difference. See if there is TWO_TASK in your environment, too.
    Other reasons I'm going bald: case sensitivity of the SID; having two nearly identical entries in the tnsnames.ora and not scrolling down while editing; sqlnet.ora strangenesses; and I've "seen" (in earlier versions, anyways), invisible characters causing problems.

  • ORA-12154: TNS:could not resolve the connect identifier

    I am simply trying to move a site from a Windows 2003 32bit server to a Windows 2008 R2 64-bit. The database was on and is remaining on the 2008 server. Trying to run the new site results in:
    ORA-12154: TNS:could not resolve the connect identifier
    This error pops up more than a few times in the forums but do not seem unique to my situation where I know the connection string works fine from another server. Any insights?

    Working
    Microsoft Windows [Version 5.2.3790]
    (C) Copyright 1985-2003 Microsoft Corp.
    C:\>SET
    ALLUSERSPROFILE=C:\Documents and Settings\All Users
    APPDATA=C:\Documents and Settings\Cherie.Jarvis\Application Data
    ARCGISHOME=D:\Program Files\ArcGIS\
    CLIENTNAME=ZEKIAH-PC463
    ClusterLog=C:\WINDOWS\Cluster\cluster.log
    CommonProgramFiles=C:\Program Files\Common Files
    CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
    COMPUTERNAME=CFLGIS1
    ComSpec=C:\WINDOWS\system32\cmd.exe
    FP_NO_HOST_CHECK=NO
    HOMEDRIVE=C:
    HOMEPATH=\Documents and Settings\Cherie.Jarvis
    LOGONSERVER=\\BATMAN
    NUMBER_OF_PROCESSORS=4
    ORACLE_HOME=D:\Ora11g\Administrator\product\11.1.0\db_1
    OS=Windows_NT
    Path=D:\Program Files\ArcGIS\ArcSDE\ora11gexe\bin;D:\Ora11g\Administrator\produc
    t\11.1.0\db_1\bin;D:\Ora11g\Administrator\product\11.1.0\db_1;D:\Ora11g_Client32
    \product\11.1.0\client_3;D:\Ora11g_Client32\product\11.1.0\client_3\bin;C:\WINDO
    WS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files (x86)\Microsoft
    SQL Server\90\Tools\binn\;C:\Program Files\ArcGIS\ArcSDE\ora11gexe\bin
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    PROCESSOR_ARCHITECTURE=AMD64
    PROCESSOR_IDENTIFIER=EM64T Family 6 Model 23 Stepping 10, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=170a
    ProgramFiles=C:\Program Files
    ProgramFiles(x86)=C:\Program Files (x86)
    PROMPT=$P$G
    PYTHONPATH=D:\Program Files\ArcGIS\bin
    SDEFORCEXDR=1
    SDEHOME=C:\Program Files\ArcGIS\ArcSDE\ora11gexe\
    SESSIONNAME=RDP-Tcp#461
    SystemDrive=C:
    SystemRoot=C:\WINDOWS
    TEMP=C:\DOCUME~1\CHERIE~1.JAR\LOCALS~1\Temp\1
    TMP=C:\DOCUME~1\CHERIE~1.JAR\LOCALS~1\Temp\1
    TNS_ADMIN=D:\Ora11g\Administrator\product\11.1.0\db_1\NETWORK\ADMIN
    USERDNSDOMAIN=CFLHD.LOCAL
    USERDOMAIN=CFLHD
    USERNAME=Cherie.Jarvis
    USERPROFILE=C:\Documents and Settings\Cherie.Jarvis
    VS90COMNTOOLS=D:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\
    windir=C:\WINDOWS
    C:\Documents and Settings\Cherie.Jarvis>
    Not Working
    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.
    C:>set
    AGSSERVERJAVA=C:\Program Files (x86)\ArcGIS\Server10.0\
    ALLUSERSPROFILE=C:\ProgramData
    ANT_HOME=D:\Software\apache-ant-1.8.1
    APPDATA=C:\Users\cherie.jarvis\AppData\Roaming
    CLIENTNAME=ZEKIAH-PC463
    CommonProgramFiles=C:\Program Files\Common Files
    CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
    CommonProgramW6432=C:\Program Files\Common Files
    COMPUTERNAME=CFLGIS2
    ComSpec=C:\Windows\system32\cmd.exe
    FP_NO_HOST_CHECK=NO
    HOMEDRIVE=C:
    HOMEPATH=\Users\cherie.jarvis
    JAVA_HOME=D:\Program Files\Java\jdk1.6.0_22
    LOCALAPPDATA=C:\Users\cherie.jarvis\AppData\Local
    LOGONSERVER=\\BATMAN
    NUMBER_OF_PROCESSORS=16
    ORACLE_HOME=D:\ORA11G\Administrator\product\11.1.0\db_1
    OS=Windows_NT
    Path=D:\app\Zekiah\product\11.1.0\client_2;D:\app\Zekiah\product\11.1.0\client_2
    \bin;D:\Program Files (x86)\PHP\;D:\Ora11g_Client32\product\11.1.0\client_1\bin;
    D:\Ora11g\administrator\product\11.1.0\db_1\bin;C:\Windows\system32;C:\Windows;C
    :\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program F
    iles\ArcGIS\ArcSDE\ora11gexe\bin;D:\Program Files (x86)\MySQL\MySQL Server 5.1\b
    in;D:\Program Files\Java\jdk1.6.0_22\bin;D:\Software\apache-ant-1.8.1\bin;D:\Pro
    gram Files\TortoiseSVN\bin
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    PHPRC=D:\Program Files (x86)\PHP\
    PROCESSOR_ARCHITECTURE=AMD64
    PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 44 Stepping 2, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=2c02
    ProgramData=C:\ProgramData
    ProgramFiles=C:\Program Files
    ProgramFiles(x86)=C:\Program Files (x86)
    ProgramW6432=C:\Program Files
    PROMPT=$P$G
    PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    PUBLIC=C:\Users\Public
    SDEHOME=D:\Program Files\ArcGIS\ArcSDE\ora11gexe\
    SESSIONNAME=RDP-Tcp#0
    SystemDrive=C:
    SystemRoot=C:\Windows
    TEMP=C:\Users\CHERIE~1.JAR\AppData\Local\Temp\2
    TMP=C:\Users\CHERIE~1.JAR\AppData\Local\Temp\2
    USERDNSDOMAIN=CFLHD.LOCAL
    USERDOMAIN=CFLHD
    USERNAME=Cherie.Jarvis
    USERPROFILE=C:\Users\cherie.jarvis
    VISUALSVN_SERVER=D:\Program Files (x86)\VisualSVN Server\
    windir=C:\Windows

  • Ora-12154 VMWare Server Number of virtual CPUs

    Installation of Oracle 10g completed successfully with 2 virtual CPUs configured. Listener and database services start automatically and the system behaves normally.
    Restart VM, modify the Virtual CPU from 2 to 1, Listener and database services show as started, but the databases does not start. The alert log shows no attempt was made to start the db. Listener.log shows ora-12154.
    A manual attempt to start of the database shows ora-12154. (via sqlplus)
    Restart VM, switch back to 2 CPUs, (making no configuration changes to the listener.ora, tnsnames.ora or anything else) and the database starts ok.
    Any ideas on how many Virtual CPUs configured could be affecting the start of the db?
    Thanks!
    Configuration:
    OS Version: Windows 2003 Server
    Oracle Version : 10.2.0.4 Enterprise Edition
    Virtual CPUs: 2
    Virtual Memory: 1G

    Hi user624886
    Can you please read that in metalink
    Doc ID:      Note:114085.1
    Subject:      TROUBLESHOOTING GUIDE: TNS-12154 TNS:could not resolve service name
    Did you set proper tnsnames.ora file?
    Here are the steps:
    http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14212/troublestng.htm#CEGJAGGH
    and also:
    http://ayyudba.blogspot.com/2007/11/good-article-on-ora-12154.html

  • ORA-12154 after 10g Developer installed

    Guys
    Not seen any specific references to these exact circumstances, and this may be in the wrong forum, but please bear with me .....
    I've recently installed Oracle Developer Suite 10.1.2.0.2 on to my PC. Now, every time I try to connect to any Oracle database via PL/SQL Developer, Impromptu/Cognos etc, I get;
    ORA-12154: TNS:could not resolve the connect identifier specified
    Everything worked fine before the Developer install. As far as I can see my PC has exactly the same files and settings as before, as my old PC that was dumped a couple of weeks ago and as colleague's PCs who have not installed Oracle 10g Developer and are happily accessing databases.
    Is there something the install amends that may have impacted?? Something that I need to be aware of or accomodate??
    Thanks in advance for any help
    Ian

    You are about the 100000000 person with this problem.
    This problem occurs when not reading the installation manual, not trying to find out what is going on, and jumping to the Usenet or this forum rightaway to ask this boring question AGAIN.
    Why do people never pay attention? Why can't they be bothered to read the troubleshooting section in the Net administrators manual?
    Why does everyone need to be spoon fed.
    The answer is for the 100000001 time:
    You have installed Developer in a different Oracle_home, you now have TWO different tnsnames.ora, and you need either
    - to synchronize them
    or
    - to set TNS_ADMIN string variable in HKLM\software\oracle to the old tnsnames.ora directory.
    Can't anyone sue Bill Gates for causing a worldwide epidemia of laziness?
    Sybrand Bakker
    Senior Oracle DBA

  • ORA-12154 could not resolve the connect indentifier specified

    [http://www.freeimagehosting.net/image.php?793d240bb3.jpg]
    when i try to install oracle 10g i find this problem i wish you help me

    user473080 wrote:
    [http://www.freeimagehosting.net/image.php?793d240bb3.jpg]
    when i try to install oracle 10g i find this problem i wish you help meIn the future please work from a command line and use copy and paste to put commands and results in your posts. Many people's corporate nets block access to blog sites.
    I have recently blogged extensively on this very subject. See edstevensdba.wordpress.com. I can't post a link to the exact article, because my corporate website blocks access to blog sites. I have also, many many times posted on this error in this forum, which a cursory search would have turned up. But once again, back by popular request:
    =================================
    ORA-12154: TNS:could not resolve the connect identifier specified
    This error means one thing, and one thing only. The client could not find the specified entry in the tnsnames.ora file being used.
    As a follow-on to that statement, remember that when you use a dblink, the database in which the link is defined is acting as a client to the database that is the target of the link. So in this case, the tnsnames.ora file on the host of your source should have an entry for your target db, as defined in the db_link.
    And for the umpteenth time ... this error has <b><i><u>NOTHING</u></i></b> to do with the status of a listener. The connection request never got far enough to reach a listener. If anyone tells you to check a listener in response to ora-12154, they are not paying attention, or do not understand how TNS works. This error is the equivalent of not being able to place a telephone call because you don't know the number of the party you want to reach. You wouldn't debug that situation by going to the other guy's house and testing his telephone, or by going to the phone company and testing the switchboard. And you don't debug a ORA-12154 by checking the listener. If I had a top ten list of "Incredibly Simple Concepts (tm)" that should be burned into the brain of everyone who claims to be an Oracle DBA, it would include "ORA-12154 Has Nothing To Do With The Listener".
    =================================
    A couple of important points.
    First, the listener is a server side only process. It's entire purpose in life is to receive requests for connections to databases and set up those connections. Once the connection is established, the listener is out of the picture. It creates the connection. It doesn't sustain the connection. One listener, with the default name of LISTENER, running from one oracle home, listening on a single port, will serve multiple database instances of multiple versions running from multiple homes. It is an unnecessary complexity to try to have multiple listeners or to name the listener as if it belongs to a particular database. That would be like the telephone company building a separate switchboard for each customer.
    Additional notes on the listener: One listener is capable of listening on multiple ports. But please notice that it is the listener using these ports, not the database instance. You can't bind a specific listener port to a specific db instance. Similarly, one listener is capable of listnening on multiple IP addresses (in the case of a server with multiple NICs) But just like the port, you can't bind a specific ip address to a specific db instance.
    Second, the tnsnames.ora file is a client side issue. It's purpose is for address resolution - the tns equivalent of the 'hosts' file further down the network stack. The only reason it exists on a host machine is because that machine can also run client processes.
    Assume you have the following in your tnsnames.ora:
    larry =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = curley)
      )Now, when you issue a connect, say like this:
    $> sqlplus scott/tiger@larrytns will look in your tnsnames.ora for an entry called 'larry'. Finding it, tns sends a request through the normal network stack to (PORT = 1521) on (HOST = myhost) using (PROTOCOL = TCP), asking for a connection to (SERVICE_NAME = curley).
    Where is (HOST = myhost) on the network? When the request gets passed from tns to the next layer in the network stack, the name 'myhost' will get resolved to an IP address, either via a local 'hosts' file, via DNS, or possibly other less used mechanisms. You can also hard-code the ip address (HOST = 123.456.789.101) in the tnsnames.ora.
    Next, the standard networking process delivers the message to port 1521 on myhost. Hopefully, there is a listener on myhost configured to listen on port 1521, and that listener knows about SERVICE_NAME = curley. If so, the listener will spawn a server process to act as the intermediary between your client and the database instance. Communication to the server process will be on a randomly selected available port. At that point the listener is out of the process and continues to user port 1521 to await other connection requests.
    What can go wrong?
    First, there may not be an entry for 'larry' in your tnsnames. In that case you get "ORA-12154: TNS:could not resolve the connect identifier specified" No need to go looking for a problem on the host, with the listener, etc. If you can't place a telephone call because you don't know the number (can't find your telephone directory (tnsnames.ora) or can't find the party you are looking for listed in it (no entry for larry)) you don't look for problems at the telephone switchboard.
    Maybe the entry for larry was found, but myhost couldn't be resolved to an IP address (say there was no entry for myhost in the local hosts file). This will result in "ORA-12545: Connect failed because target host or object does not exist"
    Maybe there was an entry for myserver in the local hosts file, but it specified a bad IP address. This will result in "ORA-12545: Connect failed because target host or object does not exist"
    Maybe the IP was good, but there is no listener running: "ORA-12541: TNS:no listener"
    Maybe the IP was good, there is a listener at myhost, but it is listening on a different port. "ORA-12560: TNS:protocol adapter error"
    Maybe the IP was good, there is a listener at myhost, it is listening on the specified port, but doesn't know about SERVICE_NAME = curley. "ORA-12514: TNS:listener does not currently know of service requested in connect descriptor"
    Third: If the client is on the same machine as the db instance, it is possible to connect without referencing tnsnames and without going through the listener.
    Now, when you issue a connect, say like this:
    $> sqlplus scott/tigertns will attempt to establish an IPC connection to the db instance. How does it know the name of the instance? It uses the current value of the enviornment variable ORACLE_SID. So...
    $> export ORACLE_SID=fred
    $> sqlplus scott/tigerIt will attempt to connect to the instance known as "fred". If there is no such instance, it will, of course, fail. Also, if there is no value set for ORACLE_SID, the connect will fail.
    check executing instances to get the SID
    [oracle@vmlnx01 ~]$ ps -ef|grep pmon|grep -v grep
    oracle    4236     1  0 10:30 ?        00:00:00 ora_pmon_vlnxora1set ORACLE_SID appropriately, and connect
    [oracle@vmlnx01 ~]$ export ORACLE_SID='vlnxora1
    [oracle@vmlnx01 ~]$ sqlplus scott/tiger
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 22 10:42:37 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing optionsNow set ORACLE_SID to a bogus value, and try to connect
    SQL> exit
    [oracle@vmlnx01 ~]$ export ORACLE_SID=FUBAR
    [oracle@vmlnx01 ~]$ sqlplus scott/tiger
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 22 10:42:57 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    ERROR:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux Error: 2: No such file or directory
    Enter user-name: Now set ORACLE_SID to null, and try to connect
    [oracle@vmlnx01 ~]$ export ORACLE_SID=
    [oracle@vmlnx01 ~]$ sqlplus /scott/tiger
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 22 10:43:24 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    ERROR:
    ORA-12162: TNS:net service name is incorrectly specifiedOk, that is how we get from the client connection request to the listener. What about the listener's part of all this?
    The listener is very simple. It's job is to listen for connection requests and make the connection (server process) between the client and the database instance. Once that connection is made, the listener is out of the picture. If you were to kill the listener, all existing connections would continue. The listener is configured with the listener.ora file, but if that file doesn't exist, the listener is quite capable of starting up with all default values. One common mistake with the listner configuration is to specify "HOST=localhost" or "HOST=127.0.01". This is a NONROUTABLE ip address. LOCALHOST and ip address 127.0.0.1 always mean "this machine on which I am sitting". So, all computers are known as "localhost" or "127.0.0.1". If you specify this address, the listener will only be capable of receiving requests from the machine on which it is running. If you specified that address in your tnsnames file - on a remote client machine - the request would be routed to the machine on which the requesting client resides. Probably not what you want.
    =====================================

  • ODBC-datasource generating ORA-12154 (possible listener issue)

    Hi,
    I am trying to configure ao ODBC-datasoure from a client (using instant client 11.2) to a 11.2g Oracle DB server. The database listener is configured to use a non standard port 1700 in this case.
    There is a firewall between the client and the server which is configured to allow connections to the database server on the specified port, when I use telnet from the client to the server, the connection opens on this port, but when I try to test the odbc-datasource I have configured ig et the error ORA-12154.
    The link below outlines the details of the error:
    http://ora-12154.ora-code.com/
    To the context should be added, that there is no problem to use SQL Plus from a computer behind the firewall to connect to the database server using the TNS name that is being used in the ODBC-datasource.
    I have tried to configure the odbc-datasource using both a tns_names.ora file, and also directly in the odbc-datasource using //[ip address] : [port]/TNS_NAME. Both ways of configuring the odbc-datasource generates the same error. I am currently suspecting that the error might be due to some sort of connection redirection on the part of the tns listener on the database server which triggers the firewall to terminate the connection. Could this be the case?
    Does anyone have any suggestions what this error might be caused by. Any suggestions on how to continue my troubleshooting would also be valueble. Further, what kind of configuration would need to be inplace, on the tns-listener / database server side to make this sort of configuration to work.
    Finally, I should also ask that I have tested the same ODBC-datasource configuration in a test system without any firewall inbetween, and that configuration works fine, so there seems to be no problem with the client software configuration per se.
    Any help is apprichated.
    /Eaglecoth

    Cabelcow wrote:
    I managed to solve this issue myself.
    Since there seems to be some problem locating the server I added "HOSTNAME" to the following line in the SQLNET.ORA file on the server:
    names.directory_path = (HOSTNAME,TNSNAMES)
    This solved the issue by using the following syntax in the ODBC Configuration:
    TNS Service Name: [ip-address]:[port]/[TNS NAME]
    Where the TNS_NAME should be that of the TNS_NAME for the database defined in the TNSNAMES_ORA at the server. Note that this value is case sensetivetnsnames.ora is ONLY used by the client side application. It is the tns complement to the local 'hosts' file. It is used by the CLIENT to resolve an alias (tns net service name) to a host (ultimately an ip), port, and service name. Your assertion that the tns_name should be ... hmm, now that I read that again, are you saying that the tnsnames entry on the client should match the one in the tnsnames file on the server? If so, yes and no. There is no technical requirement that they match. It is simply that it is usually assumed that the one on the server is correct and may be used as a model for what to do on the client. The server - acting as a server - doesn't even use the tnsnames.ora file. It exists on the server only to support any client process that may happen to be running on the same box as the db.
    Maybe this will help you understand the connections
    =================================
    ORA-12154: TNS:could not resolve the connect identifier specified
    This error means one thing, and one thing only. The client could not find the specified entry in the tnsnames.ora file being used.
    As a follow-on to that statement, remember that when you use a dblink, the database in which the link is defined is acting as a client to the database that is the target of the link. So in this case, the tnsnames.ora file on the host of your source should have an entry for your target db, as defined in the db_link.
    And for the umpteenth time ... this error has <b><i><u>NOTHING</u></i></b> to do with the status of a listener. The connection request never got far enough to reach a listener. If anyone tells you to check a listener in response to ora-12154, they are not paying attention, or do not understand how TNS works. This error is the equivalent of not being able to place a telephone call because you don't know the number of the party you want to reach. You wouldn't debug that situation by going to the other guy's house and testing his telephone, or by going to the phone company and testing the switchboard. And you don't debug a ORA-12154 by checking the listener. If I had a top ten list of "Incredibly Simple Concepts (tm)" that should be burned into the brain of everyone who claims to be an Oracle DBA, it would include "ORA-12154 Has Nothing To Do With The Listener".
    =================================
    A couple of important points.
    First, the listener is a server side only process. It's entire purpose in life is to receive requests for connections to databases and set up those connections. Once the connection is established, the listener is out of the picture. It creates the connection. It doesn't sustain the connection. One listener, with the default name of LISTENER, running from one oracle home, listening on a single port, will serve multiple database instances of multiple versions running from multiple homes. It is an unnecessary complexity to try to have multiple listeners or to name the listener as if it belongs to a particular database. That would be like the telephone company building a separate switchboard for each customer.
    Additional notes on the listener: One listener is capable of listening on multiple ports. But please notice that it is the listener using these ports, not the database instance. You can't bind a specific listener port to a specific db instance. Similarly, one listener is capable of listnening on multiple IP addresses (in the case of a server with multiple NICs) But just like the port, you can't bind a specific ip address to a specific db instance.
    Second, the tnsnames.ora file is a client side issue. It's purpose is for address resolution - the tns equivalent of the 'hosts' file further down the network stack. The only reason it exists on a host machine is because that machine can also run client processes.
    Assume you have the following in your tnsnames.ora:
    larry =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = curley)
      )Now, when you issue a connect, say like this:
    $> sqlplus scott/tiger@larrytns will look in your tnsnames.ora for an entry called 'larry'. Finding it, tns sends a request through the normal network stack to (PORT = 1521) on (HOST = myhost) using (PROTOCOL = TCP), asking for a connection to (SERVICE_NAME = curley).
    Where is (HOST = myhost) on the network? When the request gets passed from tns to the next layer in the network stack, the name 'myhost' will get resolved to an IP address, either via a local 'hosts' file, via DNS, or possibly other less used mechanisms. You can also hard-code the ip address (HOST = 123.456.789.101) in the tnsnames.ora.
    Next, the standard networking process delivers the message to port 1521 on myhost. Hopefully, there is a listener on myhost configured to listen on port 1521, and that listener knows about SERVICE_NAME = curley. If so, the listener will spawn a server process to act as the intermediary between your client and the database instance. Communication to the server process will be on a randomly selected available port. At that point the listener is out of the process and continues to user port 1521 to await other connection requests.
    What can go wrong?
    First, there may not be an entry for 'larry' in your tnsnames. In that case you get "ORA-12154: TNS:could not resolve the connect identifier specified" No need to go looking for a problem on the host, with the listener, etc. If you can't place a telephone call because you don't know the number (can't find your telephone directory (tnsnames.ora) or can't find the party you are looking for listed in it (no entry for larry)) you don't look for problems at the telephone switchboard.
    Maybe the entry for larry was found, but myhost couldn't be resolved to an IP address (say there was no entry for myhost in the local hosts file). This will result in "ORA-12545: Connect failed because target host or object does not exist"
    Maybe there was an entry for myserver in the local hosts file, but it specified a bad IP address. This will result in "ORA-12545: Connect failed because target host or object does not exist"
    Maybe the IP was good, but there is no listener running: "ORA-12541: TNS:no listener"
    Maybe the IP was good, there is a listener at myhost, but it is listening on a different port. "ORA-12560: TNS:protocol adapter error"
    Maybe the IP was good, there is a listener at myhost, it is listening on the specified port, but doesn't know about SERVICE_NAME = curley. "ORA-12514: TNS:listener does not currently know of service requested in connect descriptor"
    Third: If the client is on the same machine as the db instance, it is possible to connect without referencing tnsnames and without going through the listener.
    Now, when you issue a connect, say like this:
    $> sqlplus scott/tigertns will attempt to establish an IPC connection to the db instance. How does it know the name of the instance? It uses the current value of the enviornment variable ORACLE_SID. So...
    $> export ORACLE_SID=fred
    $> sqlplus scott/tigerIt will attempt to connect to the instance known as "fred". If there is no such instance, it will, of course, fail. Also, if there is no value set for ORACLE_SID, the connect will fail.
    check executing instances to get the SID
    [oracle@vmlnx01 ~]$ ps -ef|grep pmon|grep -v grep
    oracle    4236     1  0 10:30 ?        00:00:00 ora_pmon_vlnxora1set ORACLE_SID appropriately, and connect
    [oracle@vmlnx01 ~]$ export ORACLE_SID='vlnxora1
    [oracle@vmlnx01 ~]$ sqlplus scott/tiger
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 22 10:42:37 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing optionsNow set ORACLE_SID to a bogus value, and try to connect
    SQL> exit
    [oracle@vmlnx01 ~]$ export ORACLE_SID=FUBAR
    [oracle@vmlnx01 ~]$ sqlplus scott/tiger
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 22 10:42:57 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    ERROR:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux Error: 2: No such file or directory
    Enter user-name: Now set ORACLE_SID to null, and try to connect
    [oracle@vmlnx01 ~]$ export ORACLE_SID=
    [oracle@vmlnx01 ~]$ sqlplus /scott/tiger
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 22 10:43:24 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    ERROR:
    ORA-12162: TNS:net service name is incorrectly specifiedOk, that is how we get from the client connection request to the listener. What about the listener's part of all this?
    The listener is very simple. It's job is to listen for connection requests and make the connection (server process) between the client and the database instance. Once that connection is made, the listener is out of the picture. If you were to kill the listener, all existing connections would continue. The listener is configured with the listener.ora file, but if that file doesn't exist, the listener is quite capable of starting up with all default values. One common mistake with the listner configuration is to specify "HOST=localhost" or "HOST=127.0.01". This is a NONROUTABLE ip address. LOCALHOST and ip address 127.0.0.1 always mean "this machine on which I am sitting". So, all computers are known as "localhost" or "127.0.0.1". If you specify this address, the listener will only be capable of receiving requests from the machine on which it is running. If you specified that address in your tnsnames file - on a remote client machine - the request would be routed to the machine on which the requesting client resides. Probably not what you want.
    =====================================

  • Strange problem with ORA-12154 from only one client

    Hi all,
    I have a strange problem.
    I have three 11.2.0.1 databases on three different hosts.
    For simplicity lets say:
    Host1: database ovm1a
    Host2: database ovm7a
    Host3: database ovm8a
    I have a database schema in all three databases named EHJ. In all three databases, there are fixed user
    database links to the other databases. So EHJ in ovm1a has two links, one to ovm7a and one to ovm8a. The EHJ schema in ovm7a has two fixed user links to the EHJ schema in the ovm1a and ovm8a databases. And the same is true for the EHJ schema in the third database, ovm8a.
    If I log into the EHJ schema for each of the three databases, I can successfully select over the database links. I've been using the SQL statement: select count(*) from user_users@dblink_name;
    For each of the two links in each of the three databases, the query returns 1 so I know the database links are working properly and I have my networking setup properly.
    Now, here is the weirdness.
    I have an Oracle Application Server where our Oracle Forms and Reports run. The Oracle client on this install is 10.1.0.5. I've got a tnsnames.ora file setup on this Oracle App server to connect to all three databases ovm1a, ovm7a and ovm8a. I can successfully use the 10.2.0.5 client SQL*PLUS to connect to the EHJ schema in the ovms1, ovms7 and ovms8 databases.
    However, (and only when) connected to the ovm1a database from this client, attempts to select over the link throw the famous error: ORA-12154: TNS:could not resolve the connect identifier specified
    This error happens with both links in the ovm1a database when connected via this one client.
    BUT, if I connect using the same 10.1.0.5 client to the EHJ schema in the ovm7a or ovm8a databases, the database links in those two databases are working just fine.
    I'm pulling my hair out trying to figure this out.
    I've tried using SQL*PLUS from my desktop machine (10g R2 client) connecting to the EHJ schema on all three databases and the db links all work fine.
    Any help in trying to troubleshoot this would be greatly appreciated.
    Cheers

    JSebastian wrote:
    I have an Oracle Application Server where our Oracle Forms and Reports run. The Oracle client on this install is 10.1.0.5. I've got a tnsnames.ora file setup on this Oracle App server to connect to all three databases ovm1a, ovm7a and ovm8a.But the client (and tnsnames.ora) in question here is actually one (each) of the three databases, right? I.e. error is thrown by the db server, acting as client (db link side).
    >
    However, (and only when) connected to the ovm1a database from this client, attempts to select over the link throw the famous error: ORA-12154: TNS:could not resolve the connect identifier specified Connected how, as opposed to when you "successfully select..."?
    This error happens with both links in the ovm1a database when connected via this one client.Does Oracle config files on ovma1 host differ from the other two db hosts?
    Does
    SQL> select property_name,property_value from database_properties
      2  where property_name in ('GLOBAL_DB_NAME','NLS_RDBMS_VERSION');
    SQL> select owner,db_link,host from dba_db_links;return as expected on all three db's?
    I've tried using SQL*PLUS from my desktop machine (10g R2 client) connecting to the EHJ schema on all three databases and the db links all work fine.Make sure you are connecting to correct databases. (Simply, three tns aliases could all be pointing to the same database.)
    Edited by: orafad on May 25, 2011 11:24 PM

  • ODBC 10.2 test connection success but MSAccess/Office throws ORA-12154

    I've run into a difficult-to-solve problem. I'm troubleshooting an MSAccess to Oracle connection via Oracle ODBC driver issue.
    MSAccess was giving ORA "long" datatype error (can't remember error number) when using 11.2.1 driver against a years-old, tried-n-true app that was previously well behaved (only diff is use of that app with newer Oracle ODBC driver). Web search revealed problems with 11.2 ODBC driver and MSOffice tools so decided to swith to older ODBC driver. Had 10.2 ODBC driver also installed so switched to that. Now get ORA-12154 every time I try to connect with MSAccess via Oracle ODBC. Using the ODBC Admin (32 bit) allows SUCCESSFUL connection as does tnsping & other tools that use Oracle Net. Only MSAccess (or other MSOffice tools) do not.
    I've verified no other tnsnames.ora files or sqlnet.ora files available and have even gone as far as completely removing all things Oracle from the PC and reinstalling only the 10.2 client (custom mode; installed only the Oracle NET and ODBC 10.2 driver). I've turned on tracing to ADMIN level and read the trace files. trace for MSAccess call vs trace for ODBC administrator call yields nearly identical trace files till "niotns" step where the ODBC admin proceeds to connect and the MSAccess call just gives a few other coments then stops. NO apparent error messages. tnsnames IS found so don't understand why giving ORA-12154.
    All tools connect (tnsping works, SQL*Plus connects, ODBC admin test sucessful, TOAD connects) EXCEPT MSAccess. Problem is I have many, many MSAccess legacy apps/tools and cannot go without the fully working ODBC connection between MSAccess and Oracle.
    Help... desparate for new ideas to try since I've spent many hours searching and tried all known troubleshooting steps.
    Any ideas appreciated.
    Thanks,
    Mike

    Hi Mike,
    I have a similar error. I can connect to database with TNSPING, and I can also connect with SQL Developer. But I am unable to connect with Access using ODBC, I get ORA-12154 error. Am also completely stumped. So if anyone can help, I would appreciate it too.
    (P.S. I have tried on a number of PCs here in the office, on one PC I have here I can connect using Access and ODBC, I can see the tables, I pick on a table, it says "linking", but it never links - it just hangs forever.)
    Thanks for any pointers,
    Tom

Maybe you are looking for

  • Blackberry 8330 Curve Korean Language

    I can't seem to figure out how to get korean to show up on my blackberry instead of black boxes.  Anyone know how to fix it?

  • Has anyone else noticed issue with in and out points of Ratings?

    Hi, I have noticed that for some clips, the end point of a rating (i.e. Rejected) is the same as the in point of another rating (e.g. Favourite). How can this be? Is FCPX treating the out point as the frame after the selected section of a clip, rathe

  • How to eliminate a field created by Application Enhancement Tool

    Hello All, I´ve created some fields with Application Enhancement Tool and now i need to delete one of then. When i select at webclient to delete it, system says that i need to do manual steps to eliminate the field. Can anybody tell me what are this

  • Is anyone else significantly disappointed with Apple TV?

    I bought it on the basis that I could stream TV from my iPad - various 'on demand' services in the UK allow you to watch it on your ipad but don't allow it to be broadcast to another device.  Whilst I appreciate that suppliers of 'on demand' services

  • "..." folders on mac.

    One of the email attachments I downloaded on my mac had a folder name starting with a "..." . As I understand anything starting with a "..." on mac is automatically hidden on mac. I therefore can neither see nor open that folder in my finder. I need