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
Thread Next