I'd try to use $TWO_TASK i.c.w. $ORACLE_HOME/network/admin/tnsnames.ora

$ echo $TWO_TASK dbo_xyz0123 $ perl -ne'/^$ENV{TWO_TASK}\b/ .. /^$/ and print' $ORACLE_HOME/network +/admin/tns names.ora dbo_xyz0123 = ( DESCRIPTION = ( ADDRESS_LIST = ( ADDRESS = ( HOST = dbo )( PORT = 1521 )( PROTOCOL = TCP ))) ( CONNECT_DATA = ( SERVICE_NAME = xyz0123 ))) $ tnsping $TWO_TASK TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 29-NOV- +2018 14:38:39 Copyright (c) 1997, 2011, Oracle. All rights reserved. Used parameter files: /pro/oracle/v11.2/network/admin/sqlnet.ora Used TNSNAMES adapter to resolve the alias Attempting to contact ( DESCRIPTION = ( ADDRESS_LIST = ( ADDRESS = ( H +OST = dbo)( PORT = 1521)( PROTOCOL = TCP))) ( CONNECT_DATA = ( SERVIC +E_NAME = xyz0123))) OK (620 msec) $

And then simplify your perl code to

use DBI; my $dbh = DBI->connect ("dbi:Oracle:", $user, $pass, { RaiseError => 1 +, PrintError => 1});

If part one fails, part 2 will fail too and doesn't need debugging. If part 1 succeeds, *then* you need to start digging


Enjoy, Have FUN! H.Merijn

In reply to Re^6: DBI throwing segmentation fault by Tux
in thread DBI throwing segmentation fault by ksbehal

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.