ORA 12154 on OCIServerAttach

Hi!
I get an ORA 12154 when calling OCIServerAttach. The OCIEnvCreateand two OCIHandleAlloc calls are OK. This setup used to work with 32bit pcs. But on 64bit pcs the troubles arise.
If we do tnsping on the the same server name, it responds. So I can't quite see that anything should be wrong with the setup so far? Why can't my program find the same connection as tnsping? If there where syntax errors in sqlnames.ora, tnsnames.ora the tnsping wouldn't work, I guess?
Suggestions on where to look are very welcome!
Best regards,
Knut

Hi,
This forum is for "Oracle Developer Tools for Visual Studio", which is an actual product for a plugin for VS.
You're probably looking for the OCI forum.. Oracle Call Interface (OCI) .
Apart from TNSPing, does SQLPLUS connect without issue? And there's only a single home on this box so we're sure it's not a multiple home issue? If you have multiple homes, you need to create tnsnames.ora for each.
What version of client are you using? There is a known issue with older versions of Oracle client where a 32 bit app on a 64 bit box would get a 12154 if the app location was in a path that contained parenthesis (c:\program files (x86)) for example. It's not a 32 bit problem per se, just that 32 bit apps usually install by default to (x86) location. If that's the issue you're running into, current versions of client don't have that problem, or just install the app to a path without parens.
Hope it helps,
Greg

Similar Messages

  • Sql@loader-704  and ORA-12154: error messages when trying to load data with SQL Loader

    I have a data base with two tables that is used by Apex 4.2. One table has 800,000 records . The other has 7 million records
    The client recently upgraded from Apex 3.2 to Apex 4.2 . We exported/imported the data to the new location with no problems
    The source of the data is an old mainframe system; I needed to make changes to the source data and then load the tables.
    The first time I loaded the data i did it from a command line with SQL loader
    Now when I try to load the data I get this message:
    sql@loader-704 Internal error: ulconnect OCISERVERATTACH
    ORA-12154: tns:could not resolve the connect identifier specified
    I've searched for postings on these error message and they all seem to say that SQL Ldr can't find my TNSNAMES file.
    I am able to  connect and load data with SQL Developer; so SQL developer is able to find the TNSNAMES file
    However SQL Developer will not let me load a file this big
    I have also tried to load the file within Apex  (SQL Workshop/ Utilities) but again, the file is too big.
    So it seems like SQL Loader is the only option
    I did find one post online that said to set an environment variable with the path to the TNSNAMES file, but that didn't work..
    Not sure what else to try or where to look
    thanks

    Hi,
    You must have more than one tnsnames file or multiple installations of oracle. What i suggest you do (as I'm sure will be mentioned in ed's link that you were already pointed at) is the following (* i assume you are on windows?)
    open a command prompt
    set TNS_ADMIN=PATH_TO_DIRECTOT_THAT_CONTAINS_CORRECT_TNSNAMES_FILE (i.e. something like set TNS_ADMIN=c:\oracle\network\admin)
    This will tell oracle use the config files you find here and no others
    then try sqlldr user/pass@db (in the same dos window)
    see if that connects and let us know.
    Cheers,
    Harry
    http://dbaharrison.blogspot.com

  • 64-bit OCILogon() is fine, but 32-bit version always gives ORA-12154

    Hello,
    I am porting an application from Oracle 9.2 on Solaris 8 on Sparc to
    Oracle 10.2 on Solaris 10 on x64, using Sun C++ 5.8 on both.
    The Oracle installation was quite straightforward, and everything works fine, except that if I compile my app for 32-bit all I ever get from
    OCI is 'ORA-12154: TNS:could not resolve the connect identifier specified'
    sqlplus and tnsping, which are both 64-bit executables are also fine.
    Here is a little example program which writes a few BLOBs into
    an existing table:
    sun03%
    sun03% printenv
    HOME=/d0/sj
    SHELL=/bin/csh
    PATH=/usr/bin:/usr/ucb:/usr/bin:/etc:/usr/local/bin:/opt/csw/bin:/opt/sfw/bin:/u
    sr/dt/bin:/usr/ccs/bin:/usr/xpg4/bin:/opt/v11/SUNWspro/bin:/usr/openwin/bin:/usr
    /sbin:/usr/local/samba/bin:/opt/sfw/sbin:/usr/platform/sun4u/sbin:/usr/ccs/bin:/
    usr/sfw/bin:/d0/adam/Rational/releases/PurifyPlus.7.0/sun4_solaris2/bin:/usr/ORA
    /bin:/usr/sbin
    USER=sj
    PWD=/d0/sj/handover
    ORACLE_SID=oradev1
    ORACLE_HOME=/opt/oracle/product/10.2.0/db_1
    LD_LIBRARY_PATH=/usr/ORA/lib
    THREADS_FLAG=native
    LOGNAME=sj
    LIBPATH=/usr/ORA/lib:/usr/local/lib
    LANG=en_GB
    sun03%
    sun03%
    sun03% cat ora_prog1.h
    #define USERNAME "sj"
    #define PASSWORD "sj"
    #define ORASID "oradev1"
    #define NUM_OF_BLOBS 3
    #define BLOB_SIZE 32766
    sun03%
    sun03% cat ora_prog1.cpp
    #include <stdlib.h>
    #include <stdio.h>
    #include <assert.h>
    #include <oci.h>
    #include <oratypes.h>
    #include <string>
    #include "ora_prog1.h"
    using namespace std;
    #define OCI_CHECK(errhp, htype, status, OCIfunc) \
    do { if (OCI_SUCCESS != ((status) = (OCIfunc)))                                             \
    string msg = checkerr((dvoid *)(errhp), (ub4)(htype), (sword)(status), (text *)0, \
    (sb4)0, (text *)__FILE__, (sb4)__LINE__); \
    cleanup(msg); \
    } } while(0)
    // get the error from the DB
    void errprint(dvoid errhp, ub4 htype, sb4 errcodep,
    string& msg)
    text errbuf[512];
    if (errhp)
    sb4 errcode;
    if (errcodep == (sb4 *)0)
    errcodep = &errcode;
    (void) OCIErrorGet((dvoid *)errhp, (ub4) 1, (text *) NULL, errcodep,
    errbuf, (ub4) sizeof(errbuf), htype);
    char outBuffer[1024];
    (void) sprintf(outBuffer, "Error - %.*s\n", 512, errbuf);
    msg += outBuffer;
    // generate and return the appropriate error message
    string checkerr(dvoid errhp, ub4 htype, sword status, text note,
    sb4 code, text *file, sb4 line)
    string msg = "";
    // make sure that each print fits into this buffer
    char outBuffer[1024];
    sb4 errcode = 0;
    if (status != OCI_SUCCESS)
    (void) sprintf(outBuffer, "OCI Error %ld occurred at File %s:%ld\n",
    (long)status, (char *)file, (long)line);
    msg += outBuffer;
    if (note)
    (void) sprintf(outBuffer, "File %s:%ld (code=%ld) %s\n",
    (char *)file, (long)line, (long)code, (char *)note);
    msg += outBuffer;
    switch (status)
    case OCI_SUCCESS:
    break;
    case OCI_SUCCESS_WITH_INFO:
    (void) sprintf(outBuffer, "Error - OCI_SUCCESS_WITH_INFO\n");
    msg += outBuffer;
    errprint(errhp, htype, &errcode, msg);
    msg += outBuffer;
    break;
    case OCI_NEED_DATA:
    (void) sprintf(outBuffer, "Error - OCI_NEED_DATA\n");
    msg += outBuffer;
    break;
    case OCI_NO_DATA:
    (void) sprintf(outBuffer, "Error - OCI_NO_DATA\n");
    msg += outBuffer;
    break;
    case OCI_ERROR:
    errprint(errhp, htype, &errcode, msg);
    break;
    case OCI_INVALID_HANDLE:
    (void) sprintf(outBuffer, "Error - OCI_INVALID_HANDLE\n");
    msg += outBuffer;
    break;
    case OCI_STILL_EXECUTING:
    (void) sprintf(outBuffer, "Error - OCI_STILL_EXECUTE\n");
    msg += outBuffer;
    break;
    case OCI_CONTINUE:
    (void) sprintf(outBuffer, "Error - OCI_CONTINUE\n");
    msg += outBuffer;
    break;
    default:
    break;
    return msg;
    // Display info or fail
    void cleanup(string& msg)
    fprintf(stderr, "Oracle failed message:\n%s",
    msg.c_str());
    exit(1);
    int main()
    sword ociret;
    OCIEnv *envhp;                  // environment handle
    OCIError *errhp;                // error handle      
    OCISvcCtx *svchp;               // service context
    OCIStmt *stmthp;                // statement handle  
    OCILobLocator *lobLoc;
    OCIBind *bindp = 0;
    OCIDefine *defnp = 0;
    char stmt[1024];
    char data = (char )malloc(BLOB_SIZE);
    OCI_CHECK((dvoid *)0, (ub4)0, ociret,
    OCIEnvCreate(&envhp, OCI_DEFAULT, (dvoid *)0,
    0, 0, 0, (size_t)0, (dvoid **)0));
    OCI_CHECK(envhp, OCI_HTYPE_ENV, ociret,
    OCIHandleAlloc((dvoid *)envhp, (dvoid **)&errhp,
    OCI_HTYPE_ERROR, 0, (dvoid **) 0));
    // Create a handle for writing SQL statements - this is reused with various stmts
    OCI_CHECK(envhp, OCI_HTYPE_ENV, ociret,
    OCIHandleAlloc((dvoid *)envhp, (dvoid **)&stmthp,
    OCI_HTYPE_STMT, (size_t)0, (dvoid **)0));
    // Simplified logon for a single user session for one DB connection
    OCI_CHECK(errhp, OCI_HTYPE_ERROR, ociret,
    OCILogon(envhp, errhp, &svchp,
    (CONST OraText *)USERNAME, strlen(USERNAME),
    (CONST OraText *)PASSWORD, strlen(PASSWORD),
    (CONST OraText *)ORASID, strlen(ORASID)));
    // Allocate the LOB descriptors
    OCI_CHECK(envhp, OCI_HTYPE_ENV, ociret,
    OCIDescriptorAlloc((CONST dvoid *)envhp,
    (dvoid **)&lobLoc, OCI_DTYPE_LOB, 0, 0));
    for(int i = 0; i < NUM_OF_BLOBS; i++)
    memset(data, 'A'+i, BLOB_SIZE);
    sprintf(stmt, "INSERT INTO TEST_TABLE VALUES (%d, :1)", i);
    // Set the LOB to empty in order that it may be involved in an insert
    ub4 lobEmpty = 0;
    OCI_CHECK(errhp, OCI_HTYPE_ERROR, ociret,
    OCIAttrSet(lobLoc, OCI_DTYPE_LOB, &lobEmpty, 0,
    OCI_ATTR_LOBEMPTY, errhp));
    // Prepare to insert the empty LOBs
    OCI_CHECK(errhp, OCI_HTYPE_ERROR, ociret,
    OCIStmtPrepare(stmthp, errhp,
    (text *)stmt, (ub4)strlen(stmt),
    OCI_NTV_SYNTAX, OCI_DEFAULT));
    // Bind the BLOB to the parameter
    OCI_CHECK(errhp, OCI_HTYPE_ERROR, ociret,
    OCIBindByPos(stmthp, &bindp, errhp,
    (ub4)1, (dvoid *)&lobLoc, (sb4)-1,
    SQLT_BLOB, 0, 0, 0, 0, 0, OCI_DEFAULT));
    // Execute the statement
    OCI_CHECK(errhp, OCI_HTYPE_ERROR, ociret,
    OCIStmtExecute(svchp, stmthp, errhp,
    (ub4)1, (ub4)0,
    (CONST OCISnapshot *)NULL, (OCISnapshot *)NULL,
    OCI_DEFAULT));
    // Lock the row for update
    sprintf(stmt, "SELECT DATA FROM TEST_TABLE WHERE ID=%d FOR UPDATE", i);
    // Prepare a statement that will read the LOB
    OCI_CHECK(errhp, OCI_HTYPE_ERROR, ociret,
    OCIStmtPrepare(stmthp, errhp,
    (text *)stmt, (ub4)strlen(stmt),
    OCI_NTV_SYNTAX, OCI_DEFAULT));
    // Define space to hold the result of the query
    OCI_CHECK(errhp, OCI_HTYPE_ERROR, ociret,
    OCIDefineByPos(stmthp, &defnp, errhp,
    (ub4)1, &lobLoc, -1,
    SQLT_BLOB, 0, 0, 0, OCI_DEFAULT));
    // Execute the statement
    OCI_CHECK(errhp, OCI_HTYPE_ERROR, ociret,
    OCIStmtExecute(svchp, stmthp, errhp,
    (ub4)1, (ub4)0,
    (CONST OCISnapshot *)NULL, (OCISnapshot *)NULL,
    OCI_DEFAULT));
    ub4 expected_len = BLOB_SIZE;
    // Write data in one go
    OCI_CHECK(errhp, OCI_HTYPE_ERROR, ociret,
    OCILobWrite(svchp, errhp, lobLoc,
    &expected_len, (ub4)1,
    data, BLOB_SIZE, OCI_ONE_PIECE, 0, 0, 0, SQLCS_IMPLICIT));
    assert(expected_len == BLOB_SIZE);
    OCI_CHECK(errhp, OCI_HTYPE_ERROR, ociret,
    OCITransCommit(svchp, errhp, OCI_DEFAULT));
    // Cleanup by freeing the descriptor
    (void)OCIDescriptorFree(lobLoc, OCI_DTYPE_LOB);
    sun03%
    sun03%
    sun03% CC -xtarget=native64 -I/usr/ORA/rdbms/public -L/usr/ORA/lib -lclntsh -o ora_prog1 ora_prog1.cpp
    sun03% ora_prog1
    Compiled for 64-bit the program runs silently.
    But if I redirect my paths to the 32-bit libraries and
    recompile for 32-bit, OCILogon always fails:
    sun03%
    sun03%
    sun03% setenv LIBPATH /usr/ORA/lib32:/usr/local/lib
    sun03% setenv LD_LIBRARY_PATH /usr/ORA/lib32
    sun03% CC -I/usr/ORA/rdbms/public -L/usr/ORA/lib32 -lclntsh -o ora_prog1 ora_prog1.cpp
    sun03% ora_prog1
    Oracle failed message:
    OCI Error -1 occurred at File ora_prog1.cpp:143
    Error - ORA-12154: TNS:could not resolve the connect identifier specified
    sun03%
    Recompiling for 32-bit like this works fine on Oracle 9.2 on Solaris 8,
    so I have obviously missed something simple in my installation.
    Any help would be appreciated.
    Thanks
    -- Steve

    Hi prajithparan,
    I am facing the same problem on my Dual Core AMD running Solaris 11.06 x96-64. As long as I compile and link using the flag '-m64' everything work fine. But I use '-m32' or none getting 32 bit binaries I got the same error:
    'ORA-12154: TNS:could not resolve the connect identifier specified'
    even my LD_LIBRARY_PATH is set as below:
    echo $LD_LIBRARY_PATH
    /oracle/app/product/10.2.0/lib32
    Also I have to mention that SQLPLUS and TNSPING works fine on my side too. So I suppose that there is something wrong with trying to use 32 bit ORACLE libraries. Any idea?
    Please find attached my output (my APP is OCI / C based but not OCCI / C++):
    ./cdemouni user comext password noftnc dblink test stmt "select table_name from all_tables"
    option --user (-u) with value  comext
    option --password (-p) with value  noftnc
    option --dblink (-d) with value  test
    option --stmt (-s) with value  select table_name from all_tables
    OCIServerAttach( test -- 4 )
    FAILED: OCIServerAttach(), RC = -1
    Error [ OCI error 12154 ]- ORA-12154: TNS:could not resolve the connect identifier specified
    Regards,
    Ioan

  • Data Services ORA-12154 - TNS - Entries o.k.!

    Hi Experts!
    There is a problem when executing a job:
    - Windows Server Enterprise 2007 Service Pack2
    - 64 - bit Operating - System (Business Objects Dataservices was installed in directory "C:\Programm Files (x86)" )
    - Oracle Client ist installed on Server and Client
    - all TNS - Entires are entered in tnsnames.ora - File (Client and Server)
    - Source: Oracle 9i
    - Target: Oracle 11g
    - Designer 12.2.2.3
    - JobServer 12.2.2.3
    - JobEngine 12.2.2.3
    - Repository 12.2.2.0000
    In Designer - Tool we are able to preview Data (Source and Target) in Client AND Server, so TNS - Entries should be correct (Client and Server). 
    We have installed a Designer on Client AND Server, the problem and the behaviour is the same on both sides.
    When executing the job this message appears:
    "OCI call <OCIServerAttach> for connection <BOHAI_PROD> failed: <ORA-12154: TNS:could not resolve the connect identifier
    specified>."
    A TNSPing for TNS - Entries is o.k.! (Source and Target) 
    Any Help?
    Thanks!

    Hi,
    I changed the Logon settings of the Data Services Windows - Service to "Local account".
    The problem is solved.
    Anyhow, can you tell me how to use TNS Listner Services. I don't konw this Service.
    Thank you very much!
    With kind regards!

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

    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 17001] Oracle Error code: 12154, message: ORA-12154: TNS:could not resolve the connect identifier specified at OCI call OCIServerAttach. [nQSError: 17014] Could not connect to Oracle database. (HY000)
    1). I have TNS entries under MW_HOME/OracleBI/network/admin
    2). TNSPING works fine.
    3). JDBC source set up on WLS side..
    what else do I need to do?

    Show the full exception stack trace. This doesn't seem to relate to WebLogic. Does the WebLogic console
    show the DataSource as running? Are you in fact using the WebLogic DataSource?

  • ORA-12154: TNS:Could not connect to Oracle database.

    Hi All,
    I'm getting the following error while trying to access OBIEE dashboard.
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 12154, message: ORA-12154: TNS:could not resolve the connect identifier specified at OCI call OCIServerAttach. [nQSError: 17014] Could not connect to Oracle database. (HY000)
    I have oracle 10g R2, I can connect my database using SQLPLUS. I am not able to do Update Row Count from Admin tool also. If anyone come across this issue, please share your experience. Anyhelp would be appreciated.
    Thanks,
    Ravi

    The problem is OBIEE server not able to read the tnsnames.ora file. That depends upon the what you set as ORACLE_HOME. that can be find with tnsping command at command line. Follow this article about setting up oracle home and oci drivers
    http://oraclebizint.wordpress.com/2007/10/03/oracle-bi-ee-101332-identifying-oracle-homes-for-oci-drivers/
    please make sure that your DB-home is the first entry in your PATH environment variable.
    Have you created TNS_ADMIN environment variable. Create a environment variable TNS_ADMIN which maps to location where tnsnames.ora file located.
    let me know if you are not able to load after this steps.
    - Madan

  • Connect to Remote Database - ORA-12154

    When attempting to use OCI to attach to a remote database I cannot resolve the service name.
    However, I am able to connect using tnsping.
    Example output is:
    bash-2.03$ bin/msgoptim mo password mo
    Message Optimiser - Version 1.0
    Oracle DB Initialising
    Database Access Error - ORA-12154: TNS:could not resolve service name
    Abort (core dumped)
    bash-2.03$ tnsping mo
    TNS Ping Utility for Solaris: Version 8.1.7.0.0 - Production on 03-APR-2003 11:28:14
    (c) Copyright 1997 Oracle Corporation. All rights reserved.
    Attempting to contact (ADDRESS=(PROTOCOL=TCP)(HOST=qld)(PORT=1521))
    OK (0 msec)
    The remote database name is fed to the OCIServerAttach call as in :
    checkerr( errhp, OCIServerAttach( svrhp, errhp, (text*) server.c_str(),
    (sb4) server.length(), 0));
    Am I doing this in the correct location, or am I missing something else in the process for remote databases.
    I have no trouble connecting to a local database with a empty string in the OCIServerAttach call.
    Thanks in anticipation.

    ORA-12154: "Could not resolve service name"
    ORA-12541: "No listener"
    ORA-12154: "Could not resolve service name"
    When you try to connect to your database through Developer, try using the connect_string you've been using with .world added to it (sometimes it's appended to your connect_string automatically, and if your sqlnet.ora file has NAMES.DEFAULT_DOMAIN and NAME.DEFAULT_ZONE set to anything other than 'world' then you may have to create a new sqlnet.ora file and set NAMES.DEFAULT_DOMAIN and NAME.DEFAULT_ZONE to world for it to work properly.
    ORA-12541: "No listener"
    You just need to verify that the listener is running and also is listening for the SID or CONNECT_DATA value being sent be PL/SQL Developer. For example, if the listener on your remote machine is listening for 'pl_sql' but when you try to connect to the remote database the PL/SQL Developer is sending a request to connect to 'plsql', then there is 'no listener' listening for 'plsql' and it fails. IF you can connect to the remote database via sqlplus, but then when you try it from PL/SQL Developer and it fails, that means the listener is in fact running, but not listening for the correct string being sent to it by the application.
    Hope this helps.
    Roy

  • 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

  • DNS Set Up system throw as ORA-12154; TNS :could not resolve the connect id

    Hi,
    While i'm creating DNS set up system throws below message
    unable to connect
    SQLState=08004
    DNS Set Up for instantclient(win32-10.2.0.4) system throw as ORA-12154; TNS :could not resolve the connect identified specified.
    operationg system:xp
    dir path:C:\Oracle\instantclient10_2
    TNSNAMES.ORA(C:\Oracle\instantclient10_2\NetWork\ADMIN) Contants
    YourTNSName =sankar
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST =localhost)(PORT =1521))
    (CONNECT_DATA =
    (SID =sankar)
    (SERVER = DEDICATED)
    dir contains:
    sqresus.dll,
    sqresja.dll
    sqoras32.dll
    sqora32.dll
    oraociei10.dll
    oraocci10.dll
    orannzsbb10.dll
    ojdbc14.jar
    ocijdbc10.dll
    ociw32.dll
    oci.dll
    classes12.jar

    user7197586 wrote:
    Hi
    I have been created one DBLink it's created but when i am trying to access the data through the link it's raise error as
    "ORA-12154: TNS:could not resolve the connect identifier specified"
    CREATE
    PUBLIC DATABASE LINK
    Vrd_tcplink
    CONNECT TO
    "SAPVRD"
    IDENTIFIED BY
    "manager123"
    USING
    'VRD_TCP.WORLD'
    created this above dblink
    Kindly Suggest to wau out.
    Regards,
    Sachin
    When using a dblink, the database with the link is acting as a client to the remote database ... exactly like sqlplus running on the db server.
    read: http://edstevensdba.wordpress.com/2011/02/26/ora-12154tns-03505/ ora-12154tns-03505

  • ORA-12154 when using Database Link

    We're running 11r2 on our servers. I have a primary db and a standby db, using Data Guard. The standby is open for read-only querying. We are not using ASM.
    The primary (and thus the standby) have a PUBLIC database link to a third db server.
    When I run a query against the database link on the primary: select * from test@MyDBlink; Everything works fine.
    When I run the same query against the database link on the standby: select * from test@MyDBlink; I get ORA-12154: TNS:could not resolve the connect identifier.
    I check that the db link exists on the standby. It does.
    I go to command prompt on the standby and run "tnsping MyDBlink". It executes fine. It says "Used TNSNAMES adapater to resolve the alias" and sure enough, MyDBlink is referenced in the TNSNAMES.ORA.
    I also run "tnsping IP-of-MyDBlink" to doublecheck. No issues.
    What is going on that is blocking the db link on the standby? Many reports utilize that standby and I'd hate to deny them the functionality of a db link.
    Thanks

    893968 wrote:
    We're running 11r2 on our servers. I have a primary db and a standby db, using Data Guard. The standby is open for read-only querying. We are not using ASM.
    The primary (and thus the standby) have a PUBLIC database link to a third db server.
    When I run a query against the database link on the primary: select * from test@MyDBlink; Everything works fine.
    When I run the same query against the database link on the standby: select * from test@MyDBlink; I get ORA-12154: TNS:could not resolve the connect identifier.
    I check that the db link exists on the standby. It does.
    I go to command prompt on the standby and run "tnsping MyDBlink". It executes fine. It says "Used TNSNAMES adapater to resolve the alias" and sure enough, MyDBlink is referenced in the TNSNAMES.ORA.
    I also run "tnsping IP-of-MyDBlink" to doublecheck. No issues.
    What is going on that is blocking the db link on the standby? Many reports utilize that standby and I'd hate to deny them the functionality of a db link.
    ThanksMost people with this problem don't understand that the dblink is just another client, no different than sqplus running on the same machine - and therefore the link uses the tnsames in the ORACLE_HOME of the database containing the link. But it seems from the steps you've described that you've grasped that. The only thing I can think of off the top of my head is when you try sqlplus from the standby server you are hitting a different tnsnames than the one the database is using.

  • ORA-12154 while installing Oracle 10g on windows 7

    Hi,
    I am trying to install Oracle 10g express edition on my machine (core 2 duo 2.93) running on Windows 7.
    The installation moves on perfectly for the 1st step and while running the 2nd step (Net configuration Assistant), it gives the ORA-12154 error.
    The contents of my configuration files at this point are as follows:
    Listener.ora
    =============
    SID_LIST_ORCL =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = ORCL)
    (ORACLE_HOME = F:\oracle\product\10.2.0\db_1)
    (PROGRAM = extproc)
    ORCL =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    =============
    And that of tnsnames.ora is:
    =============
    ORCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = ORCL)
    =============
    After some googling around, I have found and installed the Microsoft Loopback adapter too (since my LAN is DHCP enabled) and also tried to turn on the firewall on my machine to check if it is not a problem with the port 1521 being blocked by the firewall.
    However, even after all that I still get the error "ORA-12154: TNS:could not resolve the connect identifier specified." while running the Net configuration Assistant and/or running SQL Plus to connect to the SID - ORCL.
    I can only see one service running in my services by the name : OracleOraDb10g_home1TNSListenerORCL
    Any suggestions or advice on the error would be much welcome.
    Is it anything related to Windows 7 ? Because I have managed to install using the same installer on another machine which runs Windows XP and everything seems fine there.
    Thanking you all in anticipation.
    Shreyas

    user12753151 wrote:
    Hmmm.. but then I'd have expected some installation error. I have read around that people have managed to install oracle on windows 7.
    The error displayed seems to be indicating that there is some configuration or permissions issue.Check that the user has permission to write in the ORACLE_HOME\network\admin - UAC might be blocking that.
    Install with software only, and run netca & dbca separately to create the database after the s/w install. (That's the way it is done in production anyway, so get used to it.)
    But yes - you still may have problems. Those who did fake it out on Windows 7 usually understand what to do. If you are smart enough to actually do it, my hat is off to you.

  • While logging I am getting error ORA-12154:

    I am getting this error, while logging.
    ERROR:
    ORA-12154: TNS:could not resolve service namePls Wat I need to do,

    hi coolguy,
    my sqlnet.ora file is
    # SQLNET.ORA Network Configuration File: C:\oracle\ora92\network\admin\sqlnet.ora
    # Generated by Oracle configuration tools.
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)and my tnsnames.ora file is
    # TNSNAMES.ORA Network Configuration File: C:\oracle\ora92\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    EXTPROC_CONNECTION_DATA.ASTSERVER40.COM =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
        (CONNECT_DATA =
          (SID = PLSExtProc)
          (PRESENTATION = RO)
    SANDB.ASTSERVER40.COM =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = ast16)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = sandb)
    INST1_HTTP.ASTSERVER40.COM =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = ast16)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = SHARED)
          (SERVICE_NAME = MODOSE)
          (PRESENTATION = http://HRService)
      )and my computer name:
    Full computer name:  ast16.astserver40.com
    Domain                  :  astserver40.comand I tested in command prompt, with tnsping which is mentioned you I am getting this error
    C:\>tnsping sandb
    TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 21-NOV-20
    07 11:20:22
    Copyright (c) 1997 Oracle Corporation.  All rights reserved.
    Used parameter files:
    C:\oracle\ora92\network\admin\sqlnet.ora
    TNS-03505: Failed to resolve namewhere's the problem....
    Message was edited by:
    user594309

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

    Hi,
    I have an Oracle8 database installed and able to connect it from my Desktop running Windows 2000 Server.
    I have setup my PL/SQL developer ver 6 on my laptop running Windows XP Pro SP2 and the oracle client with Net8 service setup. Able to logon via sqlplus command.
    However, when i run the PL/SQL program and enter the logon info, it couldn't connect and prompt me this error.
    Thanks for your help in advance.
    Warmest regards,
    Tony Ang
    Singapore
    MSN: [email protected]

    Tony,
    Can you please post the error details that you are getting while connecting from PL/SQL developer.
    The error ORA-12154 is generaly TNS:could not resolve service name .
    Also perfrom these steps
    1)Verify that a tnsnames.ora file exists.
    2)Verify that there are not multiple copies of the tnsnames.ora file.
    3)In the tnsnames.ora file, verify that the net service name specified in your connect string is mapped to a connect descriptor.
    4)Verify that there are no duplicate copies of the sqlnet.ora file.
    5)If you are using domain names, verify that your sqlnet.ora file contains a NAMES.DEFAULT_DOMAIN parameter. If this parameter does not exist, you must specify the domain name in your connect string.
    6)If you are not using domain names, and this parameter exists, delete it or disable it by commenting it out.
    7)If you are connecting from a login dialog box, verify that you are not placing an "@" symbol before your connect net service name.
    Hope this helps.
    Thanks
    Rajeev

  • A question about CREATE PUBLIC DATABASE LINK and ORA-12154 error

    Dear all,
    I have a problem about public database link creation and I would appreciate if you could kindly give me a hand. I have the following connection parameters in my
    tnsnames.ora file:
    DGPAPROD.WORLD =
         (DESCRIPTION =
           (ADDRESS_LIST =
            (ADDRESS = (COMMUNITY=tcp.world)
              (PROTOCOL=TCP)(HOST=ORASR001)(PORT=1521)
           (CONNECT_DATA = (SID = DGPAPROD))
    ...Having the above mentioned parameters I can connect to this remote database directly in a SQL*Plus shell:
    $ sqlplus username/[email protected] works pretty well and the connection is established without any problem.
    Now, what I would like to do is to create a public database link to this remote database in order to avoid the user/connection switching for viewing the
    content of this database. I proceeded according to the syntax indicated in the Oracle online documentation:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5005.htm#SQLRF01205
    Therefore I run the following in order to create a public database link
    CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING 'DGPAPROD.WORLD';Apparently there is no error and the link is created successfully. However it cannot resolve the remote host and whenever I run the following query
    (myenterprise is the name of a table in that remote database)
    SELECT *
    FROM myenterprise@SR001_dblink
    ERROR at line 1:
    ORA-12154: TNS:could not resolve the connect identifier specifiedWhat causes this problem?
    Thanks in advance,
    Kind Regards,
    Dariyoosh

    spajdy wrote:
    You must have defined DGPAPROD.WORLD in tnsnames.oar on server where you DB is runnig.Hello there,
    Thanks a lot for this nice solution. In fact I had to add the connection parameters into the tnsnames.ora file of the server on which the link was created (not the tnsnames.ora of my oracle client stored on the localhost)
    After a bit googling I found another solution that allows to create the database link:
    CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING '(DESCRIPTION =  (ADDRESS_LIST =  (ADDRESS = (COMMUNITY=tcp.world)
    (PROTOCOL=TCP)(HOST=ip_adresse)(PORT=1521)))(CONNECT_DATA = (SID = GPAPROD)))';Thanks a lot for your help!
    Kind Regards,
    Dariyoosh
    Edited by: dariyoosh on 18 nov. 2009 07:15

  • Ora-12154 after creation of second database

    DB 10g ver 10.1.0.2.0
    OS Windows server 2003 32bit +sp1
    Summary:
    Due to the addition of extra storage to the server I decided to rebuild from scratch, and all was working correctly until I came to create a second database on the server, once this is created I get ORA-12154 errors at logon for both databases.
    Full:
    Installation of Windows and Oracle are fine, creation of the first database also works correctly and connection is without problems e.g sqlplus user/pass@database1 allows me to logon.
    On creation of the second database the same command: sqlplus user/pass@database1 or sqlplus user/pass@database2 gives me an ORA-12154 error.
    If in the command prompt window I set ORACLE_SID=database1 then try sqlplus user/pass it connects without problems, the same for database2, although sqlplus user/pass@database1 still fails.
    I have checked tnsnames.ora, all looks fine, I used the net configuration assistant to generate the entries and used the connection test to verfiy all was ok, both connection tests worked fine.
    I can tnsping both database1 and database2 and lsnrctl status shows
    Service "database1" has 1 instance(s).
    Instance "database1", status READY, has 1 handler(s) for this service...
    Service "database1XDB" has 1 instance(s).
    Instance "database1", status READY, has 1 handler(s) for this service...
    Service "database2" has 1 instance(s).
    Instance "database2", status READY, has 1 handler(s) for this service...
    Service "database2XDB" has 1 instance(s).
    Instance "database2", status READY, has 1 handler(s) for this service...
    I have searched through back posts and the web and as yet have not been able to find how to resolve this. Any pointers or ideas as to why I cannot use the sqlplus user/pass@database to connect?
    TIA
    Will
    .

    Hi,
    Thanks for the quick reply, I created the listener using the net configuration assistant, I assumed this would add all necessary configuration entries?
    I have added an extra section as suggested to the listener.ora, it now reads
    # listener.ora Network Configuration File: c:\oracle\product\10.1.0\db_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
         (GLOBAL_DBNAME = dm)
         (ORACLE_HOME = c:\oracle\product\10.1.0\db_1)
         (SID_NAME = dm)
        (SID_DESC =
         (GLOBAL_DBNAME = medline)
         (ORACLE_HOME = c:\oracle\product\10.1.0\db_1)
         (SID_NAME = medline)
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = c:\oracle\product\10.1.0\db_1)
          (PROGRAM = extproc)
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = TCP)(HOST = well-mccarthy02)(PORT = 1521))
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )Is this correct, I have bounced the listener and still get ora-12154 errors on connection.
    running lsnrctl services gives:
    LSNRCTL for 32-bit Windows: Version 10.1.0.2.0 - Production on 21-FEB-2006 13:28
    :10
    Copyright (c) 1991, 2004, Oracle.  All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=well-mccarthy02)(PORT=15
    21)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
      Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:0 refused:0
             LOCAL SERVER
    Service "dm" has 2 instance(s).
      Instance "dm", status UNKNOWN, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:1 refused:0
             LOCAL SERVER
      Instance "dm", status READY, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:0 refused:0 state:ready
             LOCAL SERVER
    Service "dmXDB" has 1 instance(s).
      Instance "dm", status READY, has 1 handler(s) for this service...
        Handler(s):
          "D000" established:0 refused:0 current:0 max:1002 state:ready
             DISPATCHER <machine: WELL-MCCARTHY02, pid: 1680>
             (ADDRESS=(PROTOCOL=tcp)(HOST=well-mccarthy02)(PORT=1505))
    Service "medline" has 2 instance(s).
      Instance "medline", status UNKNOWN, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:0 refused:0
             LOCAL SERVER
      Instance "medline", status READY, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:1 refused:0 state:ready
             LOCAL SERVER
    Service "medlineXDB" has 1 instance(s).
      Instance "medline", status READY, has 1 handler(s) for this service...
        Handler(s):
          "D000" established:0 refused:0 current:0 max:1002 state:ready
             DISPATCHER <machine: WELL-MCCARTHY02, pid: 2804>
             (ADDRESS=(PROTOCOL=tcp)(HOST=well-mccarthy02)(PORT=1677))
    The command completed successfullywith the original listener.ora file lsnrctl services gave
    LSNRCTL for 32-bit Windows: Version 10.1.0.2.0 - Production on 21-FEB-2006 13:36
    :13
    Copyright (c) 1991, 2004, Oracle.  All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=well-mccarthy02)(PORT=15
    21)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
      Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:0 refused:0
             LOCAL SERVER
    Service "dm" has 1 instance(s).
      Instance "dm", status READY, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:0 refused:0 state:ready
             LOCAL SERVER
    Service "dmXDB" has 1 instance(s).
      Instance "dm", status READY, has 1 handler(s) for this service...
        Handler(s):
          "D000" established:0 refused:0 current:0 max:1002 state:ready
             DISPATCHER <machine: WELL-MCCARTHY02, pid: 1680>
             (ADDRESS=(PROTOCOL=tcp)(HOST=well-mccarthy02)(PORT=1505))
    Service "medline" has 1 instance(s).
      Instance "medline", status READY, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:0 refused:0 state:ready
             LOCAL SERVER
    Service "medlineXDB" has 1 instance(s).
      Instance "medline", status READY, has 1 handler(s) for this service...
        Handler(s):
          "D000" established:0 refused:0 current:0 max:1002 state:ready
             DISPATCHER <machine: WELL-MCCARTHY02, pid: 2804>
             (ADDRESS=(PROTOCOL=tcp)(HOST=well-mccarthy02)(PORT=1677))
    The command completed successfully

Maybe you are looking for

  • Help me !

    Caros senhores boa noite, Após várias indicações de amigos e muitos elogios a marca HP resolvi comprar no dia 10.05.2010 uma impressora Modelo HP OFFICEJET PRO 8000 A809 SERIES, a qual iria utilizar para uso em meus trabalhos academicos e serviços do

  • Bootcamp drivers on leopard CD say not compatible with windows 7 RC ?

    have installed windows 7 RC 32-bit using bootcamp 2.0 and installed all ok (running via 10.5.7). however, when i try to install windows drivers from OSX DVD (10.5.1 retail), it says it only works with XP or Vista and then it jumps straight to the fin

  • Error in SMW01:Allocation of the tax for country RO, sequence 1, value 0 no

    Hi, when materials are replicated we found a queue existing in SMQ1 and SMQ2. When i have checked in SMW01 for the Log it showed me the error "Allocation of the tax for country RO, sequence 1, value 0 not possible" Then i clicked on Show BDoc Message

  • VSS Lic on 4500 with Sup7L-E ?

    Hi, Does anyone know the correct way to lic VSS on a 4500 SUP7L-E ? At http://www.cisco.com/en/US/docs/switches/lan/catalyst4500/release/note/OL_27990-01.html Under Table 5 - Support by Image Type; VSS is listed as available on IP Base (SUP7E only) a

  • KM file picker for new WPC editors

    Hi there, I'm using new WPC editors and I want to insert some picture from KM into paragraph. However, the displayed popup only allows that users input the full URL. I'm aware of a "KM file picker" for old editors with tinyMCE (missing "KMPicker.htm"