Operating System - HP-UX
1745865 Members
4485 Online
108723 Solutions
New Discussion юеВ

Re: DBD::Oracle without Oracle Installation

 
Ralph Grothe
Honored Contributor

DBD::Oracle without Oracle Installation

Hello,

yet another DBD::Oracle round here, sorry.

I installed the 64 Bit builds for HP-UX 11.00 of gcc 3.4 and the Perl 8.4.0 prebuilt with this compiler version from Merijn's website
http://mirrors.develooper.com/hpux/

Then I got DBD::Oracle 1.15 from CPAN.

# perl -MDBD::Oracle -e 'print "$DBD::Oracle::VERSION\n"'
1.15

Because on this 11.00 box there isn't any Oracle stuff installed I exported the ORACLE_HOME branch from one of our Oracle9 DB servers, and nfs-mounted it on this box under
/opt/gnu/perl/oracle

After having set ORACLE_HOME accordingly, and TWO_TASK to the remote SID, and having set LD_LIBRARY_PATH=$ORACLE_HOME/lib, and ORACLE_USER=login/passwd of remote SID I could successfully run the "make test".
Then I did the final "make install".

I then wrote a DBI code snippet to test connecting remotely.
This script simply tries to get a dbh object and do a $dbh->ping() on it.
My simple connect string looks like this:

my $dsn = sprintf('dbi:Oracle:host=%s;port=%u;sid=%s', $host, $port, $sid);
my $dbh = DBI->connect($dsn, $login, $passwd, {RaiseError => 1})
or die $DBI::errstr;
print "successfully connected\n" if $dbh->ping();
$dbh->disconnect;

This works well while the nfs share with the ORACLE_HOME stuff is mounted.
I then unmounted the share and looked what shared DBD::Oracle lib relied on

chatr /opt/perl64/lib/site_perl/5.8.4/PA-RISC2.0-LP64/auto/DBD/Oracle/Oracle.sl|awk '$1~/^lib/'
libclntsh.sl.9.0
libcl.2
librt.2
libpthread.1
libnss_dns.1
libdl.1
libm.2
libqsmashr.sl

Everything apart from libclntsh.sl.9.0 and libqsmashr.sl I found also on the local box in /lib/pa20_64
Thus, I copied the missing libs from the DB server to my local box:

# ll /opt/gnu/perl/oracle/lib*

/opt/gnu/perl/oracle/lib:
total 35552
-rwxr-xr-x 1 root sys 13859696 Aug 26 16:24 libclntsh.sl.9.0
-r-xr-xr-x 1 root sys 13289288 Aug 26 16:24 libqsmashr.sl
-r-xr-xr-x 1 root sys 10312 Aug 26 16:37 libwtc9.sl

/opt/gnu/perl/oracle/lib32:
total 64
-rw-r--r-- 1 root sys 9344 Aug 26 16:52 libwtc9.a
-r-xr-xr-x 1 root sys 12288 Aug 26 16:52 libwtc9.sl

OK, I guess I won't need the 32 Bit libs anyway.
By repeated chatr-s on the libs I found that also libwtc9.sl was needed.
Albeit, these seem to be all the libraries my DBD::Oracle client needs.

When I now execute my test script while the DB share isn't nfs-mounted, I still get some duboius error message like this:

DBI connect('host=dbserver.rotten.com;port=4444;sid=STRANGE','login',...) failed: (UNKNOWN
OCI STATUS 1804) OCIInitialize. Check ORACLE_HOME and NLS settings etc. at script/conSTRANGE.pl line 19

The $ENV{ORACLE_HOME} is set correctly.
I also tried setting ORA_NLS33 to the ocommon subtree while nfs-mounting only this.
But this made no change.

Any Ideas what my client is still lacking?

Rgds.
Ralph
Madness, thy name is system administration
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: DBD::Oracle without Oracle Installation

Quick thoughts:

is the binary compatible?

IS this a simple NFS/networking issue.

Trying to figure out how the library is supposed to work with the filesystem unmounted.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ralph Grothe
Honored Contributor

Re: DBD::Oracle without Oracle Installation

SEP,

I'm sort of trying to find out what minimum library, header files, make files etc. are necessary to build DBD::Oracle without the need of a full Oracle installation.
Unfortunately the only reference for this task I found so far related to an install/linking against Oracle10g libs on a Linux platform.

I did a make realclean and step by step copied more of libraries, header and onject files over from the Oracle installation by deciding on what the make errors reported as missing.
Thus I ended up with some 50 MB of Oracle stuff that far.

# du -skx /opt/gnu/perl/oracle
56424 /opt/gnu/perl/oracle

Nevertheless, on running make I still end up with a SIGBUS during the linking without any further clues.
This is the tail where it breaks:

Running Mkbootstrap for DBD::Oracle ()
chmod 644 Oracle.bs
rm -f blib/arch/auto/DBD/Oracle/Oracle.sl
LD_RUN_PATH="/opt/gnu/perl/oracle/lib:/lib/pa20_64" /usr/bin/ld -b -L/usr/local/pa20_64/li
b -L/lib/pa20_64 Oracle.o dbdimp.o oci7.o oci8.o /opt/gnu/perl/oracle/rdbms/lib/defopt.o -o bli
b/arch/auto/DBD/Oracle/Oracle.sl -L/opt/gnu/perl/oracle/lib/ -lclntsh -lcl -lrt -lpthread -ldld -
lm -lqsmashr
sh: 426 Bus error(coredump)
*** Error exit code 138

Stop.
Madness, thy name is system administration
H.Merijn Brand (procura
Honored Contributor

Re: DBD::Oracle without Oracle Installation

I was amazed by your capability to improvise. It's that same road I would have taken. I'm clueless about your situation.

Add '-v' to the ld command in your makefile to see what actually happens

Post a stack trace of the coredump. That might hint people to ahh-I've-seen-that-before memory

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Ralph Grothe
Honored Contributor

Re: DBD::Oracle without Oracle Installation

The -v in the ld command line produced some 75 KB of error log which I don't want to clutter this thread with.
The majority of reported errors are UNDEF GLOBAL FUNCs and OBJECTs.
So it looks as if still some vital header file is missing.
I have to leave now and will continue digging on Monday.

Have nice weekend.
Madness, thy name is system administration