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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CJM

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

    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="Applicat ion" id="oSession"
    progid="OracleI nProcServer.XOr aSession"></object>

    <script runat="server" language="vbscr ipt">
    Sub Application_OnS tart

    oSession.Create DatabasePool 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=VBScri pt %>
    <%

    Option Explicit
    Response.Expire s = 0

    Dim OraSession
    Dim OraDatabase
    Dim rsEntryTypes

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

    Set OraSession = Server.CreateOb ject("OracleInP rocServer.XOraS ession")
    Set OraDatabase = OraSession.DbOp enDatabase("IFS P2", "uid/pwd",cint(0))

    Response.Write "Connected to " & OraDatabase.Con nect & "@" &
    OraDatabase.Dat abaseName
    Response.Write "OO4O Version: " & OraSession.OIPV ersionNumber
    Response.Write "Oracle Version: " & OraDatabase.RDB MSVersion

    Response.Write "End"
    Set OraSession = nothing
    Set OraDatabase = nothing
    %>


  • Sybrand Bakker

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

    On Tue, 26 Sep 2006 16:32:18 +0100, "CJM"
    <cjmnews04@REMO VEMEyahoo.co.uk wrote:
    >
    >Any thoughts?
    This is the most often posted error, as all people running into this
    problem think they are unique or are too lazy to search Google, or
    the Troubleshooting Section of the Oracle Net administrators manual.

    My suggestion is consequently obvious.

    I would urge you (or anyone exposed to the Evil Empire of Bill Gates)
    - to stop being lazy
    - look up Oracle errors in the Oracle documentation
    - search Google.

    --
    Sybrand Bakker, Senior Oracle DBA

    Comment

    • CJM

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


      "Sybrand Bakker" <postbus@sybran db.demon.nlwrot e in message
      news:sfpih258e8 iaqehbads6dugpp sf0ekgt9g@4ax.c om...
      On Tue, 26 Sep 2006 16:32:18 +0100, "CJM"
      <cjmnews04@REMO VEMEyahoo.co.uk wrote:
      >
      >>
      >>Any thoughts?
      >
      This is the most often posted error, as all people running into this
      problem think they are unique or are too lazy to search Google, or
      the Troubleshooting Section of the Oracle Net administrators manual.
      >
      My suggestion is consequently obvious.
      >
      I would urge you (or anyone exposed to the Evil Empire of Bill Gates)
      - to stop being lazy
      - look up Oracle errors in the Oracle documentation
      - search Google.
      >
      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


      Comment

      • Jim Kennedy

        #4
        Re: ORA-12154 Error - TNS:could not resolve the connect identifier specified


        "CJM" <cjmnews04@REMO VEMEyahoo.co.uk wrote in message
        news:4nsvg3Fc1f l2U1@individual .net...
        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="Applicat ion" id="oSession"
        progid="OracleI nProcServer.XOr aSession"></object>
        >
        <script runat="server" language="vbscr ipt">
        Sub Application_OnS tart
        >
        oSession.Create DatabasePool 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=VBScri pt %>
        <%
        >
        Option Explicit
        Response.Expire s = 0
        >
        Dim OraSession
        Dim OraDatabase
        Dim rsEntryTypes
        >
        %>
        <!-- #include virtual='/common/oo4oglobals.asp ' -->
        <%
        >
        Set OraSession = Server.CreateOb ject("OracleInP rocServer.XOraS ession")
        Set OraDatabase = OraSession.DbOp enDatabase("IFS P2", "uid/pwd",cint(0))
        >
        Response.Write "Connected to " & OraDatabase.Con nect & "@" &
        OraDatabase.Dat abaseName
        Response.Write "OO4O Version: " & OraSession.OIPV ersionNumber
        Response.Write "Oracle Version: " & OraDatabase.RDB MSVersion
        >
        Response.Write "End"
        Set OraSession = nothing
        Set OraDatabase = nothing
        %>
        >
        >
        Can you connect from that machine via sqlplus using uid/pwd@ifsp2 ? If not
        then solve that problem first.
        Jim


        Comment

        • Brian Peasland

          #5
          Re: OO4O: ORA-12154 Error - TNS:could not resolve the connect identifierspeci fied

          CJM wrote:
          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="Applicat ion" id="oSession"
          progid="OracleI nProcServer.XOr aSession"></object>
          >
          <script runat="server" language="vbscr ipt">
          Sub Application_OnS tart
          >
          oSession.Create DatabasePool 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=VBScri pt %>
          <%
          >
          Option Explicit
          Response.Expire s = 0
          >
          Dim OraSession
          Dim OraDatabase
          Dim rsEntryTypes
          >
          %>
          <!-- #include virtual='/common/oo4oglobals.asp ' -->
          <%
          >
          Set OraSession = Server.CreateOb ject("OracleInP rocServer.XOraS ession")
          Set OraDatabase = OraSession.DbOp enDatabase("IFS P2", "uid/pwd",cint(0))
          >
          Response.Write "Connected to " & OraDatabase.Con nect & "@" &
          OraDatabase.Dat abaseName
          Response.Write "OO4O Version: " & OraSession.OIPV ersionNumber
          Response.Write "Oracle Version: " & OraDatabase.RDB MSVersion
          >
          Response.Write "End"
          Set OraSession = nothing
          Set OraDatabase = nothing
          %>
          >
          >
          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
          dba@nospam.peas land.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

          Comment

          • CJM

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

            "Brian Peasland" <dba@nospam.pea sland.netwrote in message
            news:J6962F.9o6 @igsrsparc2.er. usgs.gov...
            >
            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.
            >
            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


            Comment

            • CJM

              #7
              Re: ORA-12154 Error - TNS:could not resolve the connect identifier specified


              "Jim Kennedy" <jim dot scuba dot kennedy at gee male dot comwrote in
              message news:HbSdnRU9Pq B994fYnZ2dnUVZ_ oydnZ2d@comcast .com...
              >
              Can you connect from that machine via sqlplus using uid/pwd@ifsp2 ? If
              not
              then solve that problem first.
              Jim
              >
              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


              Comment

              • sybrandb

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


                CJM wrote:
                "Sybrand Bakker" <postbus@sybran db.demon.nlwrot e in message
                news:sfpih258e8 iaqehbads6dugpp sf0ekgt9g@4ax.c om...
                On Tue, 26 Sep 2006 16:32:18 +0100, "CJM"
                <cjmnews04@REMO VEMEyahoo.co.uk wrote:
                >
                >Any thoughts?
                This is the most often posted error, as all people running into this
                problem think they are unique or are too lazy to search Google, or
                the Troubleshooting Section of the Oracle Net administrators manual.

                My suggestion is consequently obvious.

                I would urge you (or anyone exposed to the Evil Empire of Bill Gates)
                - to stop being lazy
                - look up Oracle errors in the Oracle documentation
                - search Google.
                >
                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
                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.

                --
                Sybrand Bakker
                Senior Oracle DBA

                Comment

                • CJM

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


                  "sybrandb" <sybrandb@gmail .comwrote in message
                  news:1159431864 .205155.306200@ b28g2000cwb.goo glegroups.com.. .
                  >
                  >
                  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,
                  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/c....htm#CEGJAGGH).
                  Nor does this page:
                  http://download-uk.oracle.com/docs/c....htm#ORA-12154.

                  Or this:


                  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.
                  trying to coerce people to do your
                  work for free.
                  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.
                  As for being pompous, I doubt whether I am pompous, but I'm not so sure
                  about you.
                  Your insults were just plain unjustified,
                  Whether it is an insult depends on whether you *are* pompous or not.



                  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.


                  ...and my assumptions were
                  correct.
                  You didn't look up the error in any Oracle manual, or you would have
                  known about tnsping.
                  >
                  Er, yeah... so you said.

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

                  Chris


                  Comment

                  Working...