Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: DBI and Oracle ORA-12505 error

by Tux (Abbot)
on May 13, 2013 at 14:52 UTC ( #1033301=note: print w/replies, xml ) Need Help??

in reply to DBI and Oracle ORA-12505 error

Does tnsping help?

Have you tried connecting using the TWO_TASK variable? Is it set or unset?

What is the result of

# Note that the SID is case sensitive in Ora 11! my $dbh = DBI->connect ("dbi:Oracle:sid=jupiter;host=jupitercluster", "user", "pass", { RaiseError => 1, PrintError => 1, ChopBlanks => 1, ShowErrorStatement => 1, FetchHashKeyName => "NAME_lc", }) or die $DBI::errstr;

Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^2: DBI and Oracle ORA-12505 error
by jmb (Novice) on May 13, 2013 at 15:42 UTC

    Thank you for your reply ! I apologize in advance for the French in the error messages below (all this is happening on a French Windows XP box).

    First of all, the TWO_TASK environment variable is not set in this Windows system. I have not tried to use it. Here is the output of the snippet that you suggested:
    C:\test>perl DBI connect('sid=JUPITER;host=jupitercluster','user',...) failed: ORA- +12505: TNS : le module d'écoute (listener) n'a pas pu résoudre le SID + donné dans le descripteur de connexion (DBD ERROR: OCIServerAttach) +at line 11
    As for tnsping, I guess that it gives a strong indication. Using it produces a TNS-03505 error for every single alias in the tnsnames.ora file ! This is strange because I can successfully use all the other tnsnames.ora aliases from within Perl/DBI, as well as using the Oracle SQL Developer client. I mean, except the one I am having a problem with, which does not work from within Perl/DBI, but *does* work using the Oracle SQL Developer client.
    c:\test> tnsping JUPITER or c:\test> tnsping jupiter TNS Ping Utility for 32-bit Windows: Version - Production on + 13-MAI-2013 17:17:40 Copyright (c) 1997 Oracle Corporation. All rights reserved. Fichiers de paramètres utilisés : C:\Oracle\network\admin\sqlnet.ora TNS-03505: Echec de la résolution du nom
    Here is the (short) content of sqlnet.ora:
    Any further suggestions ? Again, thanks a lot for your answer. And yes, learning about Oracle and Perl/Oracle is fun ;-)

      In your first code snippet, you are still using the uppercase SID. Try it lowercased!.

      tnsping works with the identifier, which most often is not the same as the SID.

      $ head -4 $ORACLE_HOME/network/admin/tnsnames.ora oradb_btest = ( DESCRIPTION = ( ADDRESS_LIST = ( ADDRESS = ( HOST = oradb )( PORT = 1521 )( PROTOCOL = TCP ))) ( CONNECT_DATA = ( SERVICE_NAME = basetest )) ) $ tnsping oradb_btest TNS Ping Utility for HPUX: Version - Production on 13-MAY-2 +013 18:24:26 Copyright (c) 1997, 2007, Oracle. All rights reserved. Used parameter files: /prod/oracle/v102/network/admin/sqlnet.ora Used TNSNAMES adapter to resolve the alias Attempting to contact ( DESCRIPTION = ( ADDRESS_LIST = ( ADDRESS = ( P +ROTOCOL = TCP)( PORT = 1521) ( HOST = oradb))) ( CONNECT_DATA = ( SER +VICE_NAME = basetest))) OK (90 msec) $

      Enjoy, Have FUN! H.Merijn

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1033301]
[Lady_Aleena]: Well, some of the data returned is taylored for the printing of certain elements.
[atcroft]: Lady_Aleena: Understandable.
[Lady_Aleena]: However, in this instance, the script will grow much larger, while the module will shrink.

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2017-05-29 02:51 GMT
Find Nodes?
    Voting Booth?