Try breaking things down into smaller pieces to find out where it's breaking, so you can work on the solution. Start with a simple script that just dumps $ENV{'ORACLE_HOME'}, checks the existence (and permissions) of "$ENV{'ORACLE_HOME'}/network/admin/tnsnames.ora"; looks for the desired SID in that file, then tries to connect to that data base. If it works from a simple script, then your lager application must have some bug.

#!/usr/bin/perl use warnings; use strict; use DBI; print "ORACLE_HOME: $ENV{'ORACLE_HOME'}\n"; my $tnsnames = "$ENV{'ORACLE_HOME'}/network/admin/tnsnames.ora"; -e $tnsnames || die "$tnsnames does not exist\n"; -r $tnsnames || die "cannot read $tnsnames\n"; open( TNS, '<', $tnsnames ) || die "could not open $tnsnames for readi +ng"; my $sid = 'development'; my $found_it = 0; while (<TNS>) { if ( /\b$sid\b/ ) { print "found $sid\n"; $found_it++; last; } } die "didn't find $sid\n" unless $found_it; close TNS; print "connecting to $sid\n"; my ($user, $pass) = qw( ... ... ); my $dbh = DBI->connect("dbi:Oracle:$sid",$user,$pass,{ RaiseError => 1 + }) || die "could not connect: $!\n"; print "connected!\n"; print "doing a simple query\n"; my $result = $dbh->selectall_arrayref('select sysdate from dual'); print "sysdate: @{ [ map { @{ $_ } } @$result ] }\n"; $dbh->disconnect;

Ivan Heffner
Sr. Software Engineer, DAS Lead
WhitePages.com, Inc.

In reply to Re: (OT) DBD error Ora-12154 by Codon
in thread (OT) DBD error Ora-12154 by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.