DBD::O...::Linux(3pm)
β¨ DBD::Oracle::Troubleshooting::Linux π
okay bestie, so this is a page from the User Contributed Perl Documentation β it's DBD::Oracle::Troubleshooting::Linux(3pm), and it's basically the group chat where everybody who's ever tried to get DBD::Oracle running on Linux screams into the void together. It's not a manpage about a program, it's a manpage about pain, and also about how to fix that pain. Let's go. π«Ά
πΈ VERSION
version 1.83 β yeah that's the one we're on, periodt.
π SELinux and httpd
so if SELinux is running, it can straight up prevent DBD::Oracle from working inside an Apache process β specifically, it blocks Apache from loading the shared libraries that DBD::Oracle needs (libclntsh.so or libnnz12.so). Rude.
The classic symptom? You'll see a line like this in your Apache error logs, and you will know:
[Tue Apr 17 13:22:45 2012] [error] Can't load '.../DBD/Oracle/Oracle.so' for
module DBD::Oracle: libnnz11.so: cannot enable executable stack as shared
object requires: Permission denied at .../DynaLoader.pm line 190.\n at
.../startup.pl line 17\nCompilation failed in require at ...
The fix, and it's giving hero energy:
/usr/sbin/setsebool -P httpd_execmem
π Installing with Instantclient .rpm files.
ngl there's nothing fancy here, you just gotta set up your permissions like this:
- Have permission for RWE on
/usr/lib/oracle/10.2.0.3/client/β or wherever else you RPMed to, bestie, I'm not the directory police π - Set
export ORACLE_HOME=/usr/lib/oracle/10.2.0.3/client - Set
export LD_LIBRARY_PATH=$ORACLE_HOME/lib - If you're planning to use
tnsnamesto connect to remote servers, and yourtnsnames.orafile is not in$ORACLE_HOME/network/admin, you're gonna need toExport TNS_ADMIN=dirto point DBD::Oracle at wherever yourtnsnames.orafile actually lives
π undefined symbol: __cmpdi2 comes up when Oracle isn't properly linked to the libgcc.a library.
okay so this one is a whole saga. In version 8, this got corrected by changing the SYSLIBS entry in $ORACLE_HOME/bin/genclntsh to include "-L/usr/lib/gcc-lib/i386-redhat-linux/3.2 -lgcc".
They tried this. It did not work. π When the program was then run, it generated the error "unable to find libgcc" β which is iconic in the worst way possible, because that was literally the library they were trying to describe. The audacity.
Turns out, now you need to edit that same file and append `gcc -print-libgcc-file-name` (including the backquotes!). Do that, then run "genclntsh", and the libclntsh gets properly generated and the linkage with DBD::Oracle proceeds properly. slay β¨
π₯ cc1: invalid option tune=pentium4'"` error
if you get this, it seems like either your Perl or your OS was compiled with a different version of GCC, or the GCC sitting on your system is ancient. either way, no biggie!
- run
Perl Makefile.PL - edit the
Makefileand remove the offending'-mtune=pentium4'text - save and exit
- do the
make installand it should work fine for you π
π¦ Oracle 9i Lite
the advice here is simple: use the regular Oracle9i, not the lite version. that's it. that's the tip.
another great source of help was: http://www.puschitz.com/InstallingOracle9i.html
just getting 9i and 9i lite installed, that whole thing. they use fvwm2 (nvidia X driver) as a window manager, which does not work with the 9i install program β works fine with the default Gnomish (nv X driver) though. could've been the X driver too, honestly, who's to say π
with Redhat9 it is REAL important to set LD_ASSUME_KERNEL to 2.4.1.
they didn't try this, but it may be possible to install what's needed by only downloading the first disk β saving some 1.3GB of download fun. generous of the universe tbh.
they installed a custom install from the client group. the packages installed were the Programmers section and sqlplus. they noticed that the Pro*C went on as a result of checking the Programmers section β they assume, anyway. π
once Oracle was installed properly, the DBD::Oracle install went as smooth as just about every other CPAN module. β¨
π Oracle 10g Instantclient
the Makefile.PL will now work for Oracle 10g Instantclient. to have both the Compile and the test.pl work, you must first have the LD_LIBRARY_PATH correctly set to your "instantclient" directory. (http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html)
the present version of the make creates a link on your "instantclient" directory as follows: "ln -s libclntsh.so.10.1 libclntsh.so". it's needed for both the makefile creation and the compile, but it is not needed for the test.pl. it should be removed after the compile.
if the Makefile.PL or make fails, try creating this link directly in your "instantclient" directory. π
π Oracle Database 10g Express Edition 10.2
to get 10Xe to compile correctly, they had to add $ORACLE_HOME/lib to the LD_LIBRARY_PATH β same as you would for an install against 10g Standard Edition, Standard Edition One, or Enterprise Edition.
π§ UTF8 bug in Oracle 9.2.0.5.0 and 9.2.0.7.0
DBD::Oracle seems to hit some sort of bug with the above two versions of the DB. the bug seems to hit when you have the Oracle database charset: US7ASCII and the Oracle nchar charset: AL16UTF16, and it has also been reported with the Oracle database charset: WE8ISO8850P1 and Oracle nchar charset: AL32UTF16.
so far there is no patch for this π but here are some workarounds:
use DBD::Oracle qw( SQLCS_IMPLICIT SQLCS_NCHAR );
...
$sth->bind_param(1, $value, { ora_csform => SQLCS_NCHAR });
or this way:
$dbh->{ora_ph_csform} = SQLCS_NCHAR; # default for all future placeholders
or this way:
utf8::downgrade($parameter, 1);
π AUTHORS
- Tim Bunce <timb@cpan.org>
- John Scoles <byterock@cpan.org>
- Yanick Champoux <yanick@cpan.org>
- Martin J. Evans <mjevans@cpan.org>
the squad. the icons. the main characters. π«Ά
πΈ COPYRIGHT AND LICENSE
This software is copyright (c) 2022, 2021, 2019, 2014, 2013, 2012, 2011, 2010 by Tim Bunce.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
okay that's the whole page bestie, every last crumb of it π
and that's a wrap, angel β this was perl v5.36.0, dated 2023-02-26, straight out of DBD::O...::Linux(3pm). go forth and troubleshoot, you absolute legend πβ¨
π¦ where this page comes from
- debian bookworm: libdbd-oracle-perl 1.83-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms