Solaris 8, Perl 5.8.7, DBI 1.5.1, DBD::Oracle 1.18a, Instant

Solaris 8, Perl 5.8.7, DBI 1.5.1, DBD::Oracle 1.18a, Instant

am 14.08.2006 19:17:18 von duncan_j_ferguson

Some advice please...

I am trying to build/package a perl module where I do not have to set
LD_LIBRARY_PATH before use (there can be a number of oracle
installations on the machines I want it for and cannot generically set
it in case I break something else, and cannot use those installs since I
cannot guarantee any oracle version being installed across the
machines), and want minimal hassle in setting it up for use.

I have done this so far by building DBD::Oracle with:

perl Makefile.PL LIBS="-L/usr/local/oracle -lclntsh -lnnz10"
PREFIX=/usr/local/oracle

(previous to setting LIBS, the clntsh library was resolved with a full
path in the Oracle.so, but not nnz10 - seen using ldd on Oracle.so)

When I run a simple test with

====
#!/bin/perl

use warnings;
use strict;

$ENV{ORACLE_HOME}="/usr/local/oracle";

use DBI;

my $dbh=DBI->connect(
"DBI:Oracle:host=servername;sid=DBSID;port=1521",
"user",
"pass",
{
RaiseError => 1,
PrintError=>0
}, ) or die("Failed to connect: $DBI::errstr\n");

print "Connected\n";
$dbh->disconnect();
====
I get the error
====
DBI connect('host=servername;sid=DBSID;port=1521','user',...) failed:
ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings,
permissions, etc. at /home/fergusod/tmp/oratest line 10
====
Setting NLS_LANG does not help. As soon as I set LD_LIBRARY_PATH
to /usr/local/oracle everything works (regardless of whether I specify
NLS_LANG in the script). Running ldd over the Oracle.so file shows all
libraries have been found and can be resolved using their full paths.

What do I need to change to include the ociei and/or occi libraries
being resolvable within the Oracle.so without having to modify
LD_LIBRARY_PATH before runtime? Adding them to the LIBS path for the
Makefile.PL does nothing (I guess since they arent used directly within
the library, they wont get included).

Also, is there any way to get the ORACLE_HOME defined within the
compiled pm as a default value, so it is used as and when ORACLE_HOME
isnt set in the environment, or will I have to wait until the "Todo"
item "Record ORACLE_HOME when building (auto::DBD::Oracle::mk)" is
sorted?

Thanks for any and all help.

Duncs



___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com

Re: Solaris 8, Perl 5.8.7, DBI 1.5.1, DBD::Oracle 1.18a, Instant

am 16.08.2006 20:34:56 von duncan_j_ferguson

For those that want to kno, I think I have managed to solve this problem
with

LIBS="-h ociei -L/usr/local/oracle -lclntsh -lnnz10 -lociei";

which records an entry in the Oracle.so for ociei library, and hen link
in the full path with the "-lociei"

No idea if this should be included within the Makefile.PL for DBD::Oracle.

Anyone any comments on that? If so, where/how would I submit it? I didnt
see any support info when i skimmed through the pod.

Duncs

On Mon, 2006-08-14 at 18:17 +0100, Duncan Ferguson wrote:
> Some advice please...
>
> I am trying to build/package a perl module where I do not have to set
> LD_LIBRARY_PATH before use (there can be a number of oracle
> installations on the machines I want it for and cannot generically set
> it in case I break something else, and cannot use those installs since I
> cannot guarantee any oracle version being installed across the
> machines), and want minimal hassle in setting it up for use.
>
> I have done this so far by building DBD::Oracle with:
>
> perl Makefile.PL LIBS="-L/usr/local/oracle -lclntsh -lnnz10"
> PREFIX=/usr/local/oracle
>
> (previous to setting LIBS, the clntsh library was resolved with a full
> path in the Oracle.so, but not nnz10 - seen using ldd on Oracle.so)
>
> When I run a simple test with
>
> ====
> #!/bin/perl
>
> use warnings;
> use strict;
>
> $ENV{ORACLE_HOME}="/usr/local/oracle";
>
> use DBI;
>
> my $dbh=DBI->connect(
> "DBI:Oracle:host=servername;sid=DBSID;port=1521",
> "user",
> "pass",
> {
> RaiseError => 1,
> PrintError=>0
> }, ) or die("Failed to connect: $DBI::errstr\n");
>
> print "Connected\n";
> $dbh->disconnect();
> ====
> I get the error
> ====
> DBI connect('host=servername;sid=DBSID;port=1521','user',...) failed:
> ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings,
> permissions, etc. at /home/fergusod/tmp/oratest line 10
> ====
> Setting NLS_LANG does not help. As soon as I set LD_LIBRARY_PATH
> to /usr/local/oracle everything works (regardless of whether I specify
> NLS_LANG in the script). Running ldd over the Oracle.so file shows all
> libraries have been found and can be resolved using their full paths.
>
> What do I need to change to include the ociei and/or occi libraries
> being resolvable within the Oracle.so without having to modify
> LD_LIBRARY_PATH before runtime? Adding them to the LIBS path for the
> Makefile.PL does nothing (I guess since they arent used directly within
> the library, they wont get included).
>
> Also, is there any way to get the ORACLE_HOME defined within the
> compiled pm as a default value, so it is used as and when ORACLE_HOME
> isnt set in the environment, or will I have to wait until the "Todo"
> item "Record ORACLE_HOME when building (auto::DBD::Oracle::mk)" is
> sorted?
>
> Thanks for any and all help.
>
> Duncs
>
>
>
> ___________________________________________________________
> To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com



___________________________________________________________
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html