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

Discussion in 'ASP General' started by CJM, Sep 26, 2006.

  1. CJM

    CJM Guest

    I have a working web application (ASP) which links to an Oracle 10g DB via
    OO4O. I'm trying to port it to either of two test servers, but in fact, I
    can't get it to work with either - 'Unable to make connection, ORA-12154:
    TNS:could not resolve the connect identifier specified'. This error occurs
    in the applications global.asa file where I'm trying to set up a connection
    pool:

    <object runat="Server" scope="Application" id="oSession"
    progid="OracleInProcServer.XOraSession"></object>

    <script runat="server" language="vbscript">
    Sub Application_OnStart

    oSession.CreateDatabasePool 2, 40, 200, "IFSP2", "uid/pwd", 0 <==
    error occurs here

    End Sub
    </script>

    I'm not sure where I have gone wrong. I originally installed the
    InstantClient (and ODBC add-on) on it's own. I created SQL.ORA and
    TNSNAMES.ORA files, and the NLS_LANG and TNS_ADMIN environment variables and
    I prepended the Path environment variable with the path to the top-level
    oracle folder. So far so good - I can create a DSN which connects to the DB
    OK, and Oracle SQL Developer recognised the TNS names I supply and can
    connect to the DB that way too.

    I then installed the Oracle .NET tools package, which includes within it
    Oracle Objects for OLE. The installation proceeded as expected, but short of
    getting my application to work, I dont know of any way to confirm that it is
    working.

    The application itself is using Anonymous authentication for the time being,
    though it will eventually be using Integrated Windows Authentication, so I
    cant see the any problems server-side. What is more, I assume that OO4O is
    reading the TNS names in the same way that the ODBC Administrator and Oracle
    SQL Developer do, which makes this problem even more curious.

    I've also tried the code listed below to see if a straight-forward
    connection (as opposed to pooling) would work but it didnt.

    Any thoughts?

    Thanks in advance.

    Chris


    Test.asp:

    <%@ Language=VBScript %>
    <%

    Option Explicit
    Response.Expires = 0

    Dim OraSession
    Dim OraDatabase
    Dim rsEntryTypes

    %>
    <!-- #include virtual='/common/oo4oglobals.asp' -->
    <%

    Set OraSession = Server.CreateObject("OracleInProcServer.XOraSession")
    Set OraDatabase = OraSession.DbOpenDatabase("IFSP2", "uid/pwd",cint(0))

    Response.Write "Connected to " & OraDatabase.Connect & "@" &
    OraDatabase.DatabaseName
    Response.Write "OO4O Version: " & OraSession.OIPVersionNumber
    Response.Write "Oracle Version: " & OraDatabase.RDBMSVersion

    Response.Write "End"
    Set OraSession = nothing
    Set OraDatabase = nothing
    %>
     
    CJM, Sep 26, 2006
    #1
    1. Advertisements

  2. CJM

    CJM Guest

    I would urge you to:
    - Stop wasting bandwidth on slagging off Microsoft - do you think that your
    opinion of Bill Gates should be a factor in my companies choice of platform
    for an Oracle database?
    - Stop acting pompous by accusing people of being lazy without due cause.
    - Stop assuming that people haven't looked up the error in the Oracle
    documentation - perhaps they have but either havent found the inspiration
    they need or maybe they *do* have a 'unique' problem.
    - Stop assuming that people havent searched google - perhaps they have but
    haven't been able to find the signal within all that noise...

    If you had bothered to actually read my post, it will have been apparent
    from the information that I provided that I have been through some logical
    steps to debug this problem. I've basically outlined my installation
    procedure (which was the same as was done on my development server - which
    *does* work), so it the problem is as common and routine as you suggest, the
    solution should be fairly obvious - in which case, why not just say it.

    Can anybody else reading this please assume that I've been looking in what I
    think are the right places, and that I either haven't come across the right
    solution or if I have, I haven't understood it.

    CJM
     
    CJM, Sep 27, 2006
    #2
    1. Advertisements

  3. CJM

    Jim Kennedy Guest

    Can you connect from that machine via sqlplus using uid/pwd@ifsp2 ? If not
    then solve that problem first.
    Jim
     
    Jim Kennedy, Sep 27, 2006
    #3
  4. I'm not an expert with ASP, but is IFSP2 the TNS entry you are using to
    denote the database to connect to? If so, then verify that it is defined
    correctly in your TNSNAMES.ORA configuration file. Also, verify that you
    can TNSPING that entry, "tnsping ifsp2". If not, then you have either 1)
    configured your tnsnames incorrectly, 2) have an incorrect sqlnet.ora
    configuration file, or 3) your software cannot see these files.

    HTH,
    Brian

    --
    ===================================================================

    Brian Peasland

    http://www.peasland.net

    Remove the "nospam." from the email address to email me.


    "I can give it to you cheap, quick, and good.
    Now pick two out of the three" - Unknown
     
    Brian Peasland, Sep 27, 2006
    #4
  5. CJM

    CJM Guest

    Yes, IFSP2 is the DB alias. It is defined correctly - AFAIK, the test server
    was set up the same way as the development server, and shares the same
    TNSNAMES.ORA file (and other config).

    I didnt know about TNSPING, but it worked a treat - all aliases resolve to
    the right locations.

    I'm not sure, but I think I have made some progress... I'll post back
    if/when I can confirm it.

    Thanks for your response, Brian.

    Chris
     
    CJM, Sep 27, 2006
    #5
  6. CJM

    CJM Guest

    I haven't tried SQLPlus yet (not really up to speed on it) but I can TNSPING
    the DB and the same page also connects via ADO (using the same TNS names) so
    they appear to be configured correctly.

    As I've just mentioned to Brian, I think I may have made some progress, so
    I'll review my position if/when I confirm this.

    CJM
     
    CJM, Sep 27, 2006
    #6
  7. CJM

    sybrandb Guest

    Quoting from your further contributions in this thread

    'I didnt know about TNSPING, but it worked a treat - all aliases
    resolve to
    the right locations.'

    So obviously my assumptions weren't assumptions. I was correct, and you
    just weren't speaking the truth, trying to coerce people to do your
    work for free.

    As for being pompous, I doubt whether I am pompous, but I'm not so sure
    about you.
    Your insults were just plain unjustified, and my assumptions were
    correct.
    You didn't look up the error in any Oracle manual, or you would have
    known about tnsping.
     
    sybrandb, Sep 28, 2006
    #7
  8. CJM

    CJM Guest

    Really?

    Your assumptions were wrong.

    I was speaking the truth:
    - I did google for help prior to posting.
    - I did check my off-line Oracle documentation
    - I did check on-line Oracle documentation
    - Searched previous posts in this NG

    As for TNSPING, it didnt demonstrate the problem nor find the solution. More
    specifically the Oracle page dedicated to the error doesnt suggest using
    TNSPING for anything
    (http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14212/troublestng.htm#CEGJAGGH).
    Nor does this page:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14219/net12150.htm#ORA-12154.

    Or this:
    http://download-uk.oracle.com/docs/cd/B19306_01/gateways.102/b16222/net.htm#sthref484

    Moreover, my OP clearly states that I succeeded in defining and using a
    System DSN - in essence this proves the same as TNSPING - that the listener
    is available and working and that the TNS names are correctly configured.

    Even now you have no idea as to the cause of the problem. It seems a reboot
    solved the problem, but why? So while hardly unique, it appears the problem
    was non-standard and I was right to consult my peers within this group. No
    amount of searching online was likely to reveal the solution.
    Coerce: verb; to achieve by force or threat.

    Hmmm....

    I haven't issued any threats as far as I know, but I was certainly trying to
    get my peers in this group to help me. For free, too. [The cheek of it! -
    Ed.]

    Although they never came up with the solution, they were potentially going
    to save me some work. But surely that is the purpose of these peer-support
    newsgroups?

    Moreover, I always try to help at least one person each time someone helps
    me. Obviously, not being an Oracle expert, I'm not much help here, but
    hopefully there might be a grateful recipient in one of the other NGs I
    frequent.
    Whether it is an insult depends on whether you *are* pompous or not.

    http://groups.google.com/group/comp...21?lnk=gst&q=Sybrand&rnum=13#7a2066eafb253721

    The general concensus seems to be that you have the right aptitude but the
    wrong attitude.

    I think every technical NG has someone like you, which must be reassuring
    for you, if not for the rest of us. I'll let each other participant in this
    NG make up their own minds as to what you are. And what I may be for that
    matter.

    http://www.politicsforum.org/images/flame_warriors/flame_47.php
    Er, yeah... so you said.

    Thanks once again to those who did their best to help.

    Chris
     
    CJM, Sep 28, 2006
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.