in reply to Re^2: DBI throwing segmentation fault
in thread DBI throwing segmentation fault

"perl_5.22 db.p" ... "Perl5.16", do you have multiple versions of perl installed?

'but can see logs like "cant establish oracle connection"'

You'll see these unless you set some environment variables before installing. See Re^3: DBI AND ORACLE 8 and the module documentation.

Replies are listed 'Best First'.
Re^4: DBI throwing segmentation fault
by ksbehal (Acolyte) on Nov 29, 2018 at 12:21 UTC
    Yes, first I had only Perl5.16 and it was having the same "Segmentation fault" later I tried it with Perl5.22 but error is same again.

      I trust you rebuild DBI/DBD::Oracle under 5.22 and didn't copy the files? Set export DBI_TRACE=9 then run a basic connection script:

      use strict; use warnings; use DBI; # declare your sid, user, pass etc variables here; my $dbh = DBI->connect("dbi:Oracle:host=$host;sid=$sid", $user, $passw +d );

      Specify the versions of DBI/DBD::Oracle, the version of instant client, the output of perl -V, maybe even the build log of cpanm DBD::Oracle. Remember the code/data formatting and readmore tags. How do I post a question effectively?

      Update fixed link..

        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