http://qs321.pair.com?node_id=583300


in reply to DBI connect without an entry in TNSNAMES.ORA

ericdp

I guess its not possible to connect to SID without the entry in TNSNAMES.ORA. I've tried it before but it just doesn't work, because the listener on the remote machine will search for the SID defined in TNSNAMES.ORA

Hope that helps.
  • Comment on Re: DBI connect without an entry in TNSNAMES.ORA

Replies are listed 'Best First'.
Re^2: DBI connect without an entry in TNSNAMES.ORA
by ericdp (Novice) on Nov 10, 2006 at 15:11 UTC
    I was afraid of that. I was hoping giving a fully qualified connection string would be able to bypass the need for an entry in this file. I guess that Oracle has hooks into this file in order for the local client to connect.

    Thanks
    Eric

      You absolutely can connect from a client with no tnsnames.ora file, I do it all of the time, with the same syntax that you are using.

      You have obvoiusly not been using valuable tools that are available to you: the documentation for DBD::Oracle and oracle client tools

      The documentation for DBD::Oracle has a huge amount of documentation regarding connections and you can view it on the CPAN http://search.cpan.org/dist/DBD-Oracle/

      You have a bad SID/host combination in your script or in your environment. Read the DBD::Oracle documentation on connections and which piece of configuration data (DBI connection string; DBD environment variables; DBI environmant variables; Oracle client files and environment variables) interact. Especially the precedence.

      Here are some more options on how you could attempt to debug the issues:
      1. Verify all of your assumptions:
        • does the database instance actually reside on that server?
        • does the environment contain/lack all of the informaitn you expected
        • does the tnsnames.ora file exist and does it contain any entry that looks similar to the one to which you are trying to connect?
      2. Check for software bugs:
        • You know you are running old version of modules, check the Changelog for bugs related to connections for each version between the one you are using and the current version.

      Finally, when people are trying to help you and ask you questions, answer the questions.

      --
      Clayton