Perl DBI/DBD stories

I always got stories when people tried to install Perl/Perl modules so as to monitor their database. From my observation, they failures came from following major reasons:
1) Incomplete environment
Forget set up ORACLE_HOME when played DBD::Oracle, did not put C compiler in PATH, etc.
2) Non-standard C compiler
C from Vendor sometime will croaked.
3) Wrong version
There are always hidden matrix among OS, C library, Perl, Perl modules, don’t blindly think install your_module will go ahead smoothly without check VERSION at first.
4) mulitple ORACLE_HOME
Install DBD::Oracle at Oracle 8i, use it from Oracle 9i, nope.
5) Bugs
Don’t panic, you can always find workaround from user groups and forums, I recommend 2 here:
http://www.nntp.perl.org/group/
http://www.mail-archive.com/

Now, let me give a instance.
============================
Gr8t.

>Tom wrote:
>
> Hi , I have installed DBD::Oracle . 

 maybe you hit bug: no surprise.

 try to remove
 LANG=en_US.UTF-8
 
 from your environment. then install again.
 
 if install from cpan> did not work, 1 trick here (manually install module): you can go to you .cpan/*build*/DBI**, then
 perl Makefile.PL
 make
 make test
 make install
 above thing is all CPAN do for you in sequence.
 

> Tom wrote:
>
> this is painful!  Got some errors at the end of install DBI”:
>
> Failed Test       Stat Wstat Total Fail  Failed  List of Failed
>
> ——————————————————————————-
>
> t/85gofer.t          3   768   161    3   1.86%  79-80 83
> t/zvg_85gofer.t      3   768   161    3   1.86%  79-80 83
> t/zvp_85gofer.t      3   768   161    3   1.86%  79-80 83
> t/zvxgp_85gofer.t    3   768   161    3   1.86%  79-80 83
>
> 31 tests and 337 subtests skipped.
>
> Failed 4/125 test scripts, 96.80% okay. 12/5381 subtests failed, 99.78% okay.
>
> make: *** [test_dynamic] Error 29
>
>   /usr/bin/make test — NOT OK
>
> Running make install
>
>   make test had returned bad status, won’t install without force
>

>
> cpan>
>

perl -MCPAN -e shell
install DBI
———
install perl modules sometime is painful with version match 🙂

> Tom wrote:
>
> Cool, how do I install DBI?
>

ha, I think you can install DBI again directly from CPAN (it will download higher version for you), current DBI version is 1.32.

> Tom wrote:
>
> I logged in as root and ran the commands below:
>
> export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
> export ORACLE_USERID=scott/tiger@oracle
>

>
> It still gave me error messages:
>

>
> t/70meta…………….Can’t run this test using Perl 5.008 without DBI >= 1.38 at t/nchar_test_lib.pl line 12.
>
> Compilation failed in require at t/70meta.t line 21.
>
> t/70meta…………….dubious
>
>         Test returned status 255 (wstat 65280, 0xff00)
>
> Failed Test            Stat Wstat Total Fail  Failed  List of Failed
>
> ——————————————————————————-
>
> t/10general.t           255 65280    ??   ??       %  ??
> t/15nls.t               255 65280    ??   ??       %  ??
> t/20select.t            255 65280    ??   ??       %  ??
> t/21nchar.t             255 65280    ??   ??       %  ??
> t/22nchar_al32utf8.t    255 65280    ??   ??       %  ??
> t/22nchar_utf8.t        255 65280    ??   ??       %  ??
> t/23wide_db.t           255 65280    ??   ??       %  ??
> t/23wide_db_8bit.t      255 65280    ??   ??       %  ??
> t/23wide_db_al32utf8.t  255 65280    ??   ??       %  ??
> t/24implicit_utf8.t     255 65280    ??   ??       %  ??
> t/25plsql.t             255 65280    ??   ??       %  ??
> t/26exe_array.t         255 65280    14   13  92.86%  2-14
> t/30long.t              255 65280    ??   ??       %  ??
> t/31lob.t               255 65280     9    9 100.00%  1-9
> t/40ph_type.t           255 65280    ??   ??       %  ??
> t/50cursor.t            255 65280    ??   ??       %  ??
> t/55nested.t            255 65280    ??   ??       %  ??
> t/60reauth.t            255 65280    ??   ??       %  ??
> t/70meta.t              255 65280    ??   ??       %  ??
>
> Failed 19/20 test scripts, 5.00% okay. 22/28 subtests failed, 21.43% okay.
>
> make: *** [test_dynamic] Error 255
>
>   /usr/bin/make test — NOT OK
>
> Running make install
>
>   make test had returned bad status, won’t install without force
>

>
> cpan>
>

   export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
   export ORACLE_USERID=your_user_for_test/its_password@your_database_for_test_connection
 /* i.e scott/tiger@oracle */
 hope it works for you.

>
> From: Tom
>
> I just tried that but it still gives me the following:
>
> Trying to find an ORACLE_HOME
>
> Your LD_LIBRARY_PATH env var is set to ”
>
>       The ORACLE_HOME environment variable is not set and I couldn’t guess it.
>
>       It must be set to hold the path to an Oracle installation directory
>
>       on this machine (or a machine with a compatible architecture).
>
>       See the README.clients.txt file for more information.
>
>       ABORTED!
>
> Running make test
>
>   Make had some problems, maybe interrupted? Won’t test
>
> Running make install
>
>   Make had some problems, maybe interrupted? Won’t install
>
> cpan>

=======================================

Advertisements

About Pang

Oracle DBA working in database, fusion middleware and identity management and cloud.
This entry was posted in Perl. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s