Failed DBD oracle module

2013-09-23 Thread Lieng, Gia
Hi,

I had installed perl 5.18.1 and two other modules DBI and DBD::Oralce.
And using the simple script below to test both modules, DBI worked but
DBD::Oracle gives the following errors.  Both modules compile and
installed without errors.

 

 

- Testing module DBI worked:

$ vi perl_test.script

"perl_test.script" 4 lines, 55 characters

#!/usr/bin/perl

 

use DBI

print "hello world\n";

~

~

~

~

~

~

~

~

~

"perl_test.script" 4 lines, 48 characters

$

$ perl perl_test.script

hello world

$

 

 

 

 

- Testing module DBD::Oracle, it failed:

$ vi perl_test.script

"perl_test.script" 4 lines, 48 characters

#!/usr/bin/perl

 

use DBD::Oracle

print "hello world\n";

 

 

 

~

~

~

"perl_test.script" 4 lines, 56 characters

$

 

 

$ perl perl_test.script

Can't load
'/usr/local/lib/perl5/site_perl/5.18.1/sun4-solaris/auto/DBD/Oracle/Orac
le.so' for module DBD::Oracle: ld.so.1: perl: fatal: 

/opt/oracle/10.2.0.3/lib/libclntsh.so.10.1: wrong ELF class: ELFCLASS64
at /usr/local/lib/perl5/5.18.1/sun4-solaris/DynaLoader.pm line 190.

at perl_test.script line 4.

Compilation failed in require at perl_test.script line 4.

BEGIN failed--compilation aborted at perl_test.script line 4.

 

 

 

Can you please assist?

 

 

 

 



Re: DBD::Oracle installation on AIX

2013-09-23 Thread Martin J. Evans

On 22/09/2013 22:41, Nagendra Singh wrote:

Hi Martin,
Thanks a bunch for looking into this problem. Here are the details asked
by you:-
PERL Version is v5.10.1
DBI Version is 1.609
DBD::ODBC version is 1.43.
Logs file are attached.
Regards,
Mr. Singh


Thank you for the trace file. Your versions above should be ok.

You DBI_TRACE shows:

!SQLError(26b11a0,26b1320,0) = (82, 0, 523 80)
  ^^^ environment handle
  ^^^ connection handle
  ^ statement handle
and the (82, 0, 523 80) are:

sql state,
native error,
error message

'82' is not a valid ODBC state - it should be 5 characters.
0 as a native error is unusual but not an error.
'523 80' is peculiar as an error msg.

None of this is enough for me to diagnose any problem other than your 
ODBC driver seems broken or is perhaps using an incompatible ODBC API 
(e.g., one where DBD::ODBC was built with SQLLEN as 64 bit and vertica 
was built with SQLLEN 32 bit).


You will need to contact Vertica I guess. You might want to ask them:

a) why the state is only 2 chrs
b) what error msg '523 80' means
c) whether their ODBC driver was built with 32 bit or 64 bit SQLLEN
   run odbcinst -j on your machine to see how unixODBC was built.
d) include a unixODBC trace - which by the way, the one you sent me was 
not a unixodbc trace - it was the start of the DBI trace.


Martin
--
Martin J. Evans
Wetherby, UK


*From:* Martin J. Evans 
*To:* Nagendra Singh 
*Cc:* Michael Nhan ; Manimegalai Visvanathan
; "'dbi-users@perl.org'" 
*Sent:* Sunday, September 22, 2013 11:51 AM
*Subject:* Re: DBD::Oracle installation on AIX

On 21/09/2013 19:42, Nagendra Singh wrote:
 > Hi,
 > I have installed DBD::ODBC latest version on 64 bit Linux Machine. One
 > one machine I am able to make connection to Vertica using DSN but on
 > other machine I am getting following error message. My odbc.ini,
 > odbcinst.ini files are matching exactly:-
 > set_err:State('82') is not a 5 character string, using 's1000' instead
 > at /usr/local/lib64/perl5/DBD/ODBC.pm line 153. DBI
 > connect('VertcaiABITPRIM','nbx',...)failed: 523 80 (SQL-82).
 > Any pointer would be appreciated.
 > Regards,
 > Mr. Singh

What version of Perl, DBI and DBD::ODBC are you using (latest does not
help as new versions have recently been released))? You can generally
get these using:

perl --version
perl -MDBI -le 'print $DBI::VERSION'
perl -MDBD::ODBC -le 'print $DBD::ODBC::VERSION'

Error state '82' is not a 5 character string and ODBC states should be.
It might also be useful if you can provide any details of the Vertica
ODBC Driver. S1000 is now HY000 which is a general error and should be
accompanied with some error string.

Error '82' (even 82000) does not exist. Error code 08002 does exist and
that can be found here ->
http://www.easysoft.com/developer/interfaces/odbc/sqlstate_status_return_codes.html#08002

If you are using a recent DBI and DBD::ODBC you can do:

DBI_TRACE=DBD=x.log perl myprogram.pl 

and x.log should contain the log of odbc calls which would help me
identify your problem. If this file ends up empty, try again with:

DBI_TRACE=15=x.log perl myprogram.pl

Martin
-- Martin J. Evans
Wetherby, UK






Re: DBD::Oracle installation on AIX

2013-09-23 Thread Martin J. Evans

On 23/09/2013 18:43, Nagendra Singh wrote:

Thanks Martin.
How can I get UnixODBC trace? Could you please let me know the command.
Strange thing is on one Linux machine its working fine and on another
Linux machine( Same configuration) its not.
Result of odbcinst-j is:-
UnixODBC2.2.14
Drivers:  /etc/odbcinst.ini
SYSTEm Data Sources /etc/odbc.ini
File DataSources : /etc/ODBCDataSources
User Data Sources: /etc/odbc.ini
SQLUEN Size:8
SQLLEN Sixe : 8
SQLSETPOSIROW Size:8
Regards,
Mr. Singh


Could you please keep dbi-users list on the cc list of your emails as 
other people might be able to help.


Also, top posting (putting your reply above mine) makes it hard for 
people to follow.


Your odbcinst output shows you are using unixODBC on a 64 bit platform 
built with the ODBC type SQLLEN set to 8 bytes. If your driver was built 
with SQLLEN set to 4 bytes it can lead to all sorts of difficult to 
track down problems.


To get a unixODBC trace you look at the odbcinst -j output and find the 
file pointed to by:


Drivers:  /etc/odbcinst.ini

At the top of this file you add the following:

[ODBC]
Trace=yes
TraceFile=/tmp/unixodbc.log

which tells unixODBC to trace all ODBC calls to the file 
/tmp/unixodbc.log. You then run the smallest script which produces the 
error and look in /tmp/unixodbc.log. It will show each ODBC API call, 
what arguments were passed and what was returned. However, I'm currently 
of the opinion this won't help us much as either:


a) your ODBC driver is broken
b) it was built with SQLLEN 4 bytes instead of 8 bytes

Neither of (a) or (b) DBD::ODBC can do anything about and both would 
require you contacting vertica to get a fixed ODBC driver.


Martin
--
Martin J. Evans
Wetherby, UK



*From:* Martin J. Evans 
*To:* Nagendra Singh 
*Cc:* "dbi-users@perl.org" 
*Sent:* Monday, September 23, 2013 12:32 PM
*Subject:* Re: DBD::Oracle installation on AIX

On 22/09/2013 22:41, Nagendra Singh wrote:
 > Hi Martin,
 > Thanks a bunch for looking into this problem. Here are the details asked
 > by you:-
 > PERL Version is v5.10.1
 > DBI Version is 1.609
 > DBD::ODBC version is 1.43.
 > Logs file are attached.
 > Regards,
 > Mr. Singh

Thank you for the trace file. Your versions above should be ok.

You DBI_TRACE shows:

!SQLError(26b11a0,26b1320,0) = (82, 0, 523 80)
   ^^^ environment handle
   ^^^ connection handle
   ^ statement handle
and the (82, 0, 523 80) are:

sql state,
native error,
error message

'82' is not a valid ODBC state - it should be 5 characters.
0 as a native error is unusual but not an error.
'523 80' is peculiar as an error msg.

None of this is enough for me to diagnose any problem other than your
ODBC driver seems broken or is perhaps using an incompatible ODBC API
(e.g., one where DBD::ODBC was built with SQLLEN as 64 bit and vertica
was built with SQLLEN 32 bit).

You will need to contact Vertica I guess. You might want to ask them:

a) why the state is only 2 chrs
b) what error msg '523 80' means
c) whether their ODBC driver was built with 32 bit or 64 bit SQLLEN
 run odbcinst -j on your machine to see how unixODBC was built.
d) include a unixODBC trace - which by the way, the one you sent me was
not a unixodbc trace - it was the start of the DBI trace.

Martin
--
Martin J. Evans
Wetherby, UK

 > *From:* Martin J. Evans mailto:boh...@ntlworld.com>>
 > *To:* Nagendra Singh mailto:nagsu...@yahoo.com>>
 > *Cc:* Michael Nhan mailto:mn...@genome.wustl.edu>>; Manimegalai Visvanathan
 > mailto:mvisvanat...@wsgc.com>>;
"'dbi-users@perl.org '" mailto:dbi-users@perl.org>>
 > *Sent:* Sunday, September 22, 2013 11:51 AM
 > *Subject:* Re: DBD::Oracle installation on AIX
 >
 > On 21/09/2013 19:42, Nagendra Singh wrote:
 >  > Hi,
 >  > I have installed DBD::ODBC latest version on 64 bit Linux Machine. One
 >  > one machine I am able to make connection to Vertica using DSN but on
 >  > other machine I am getting following error message. My odbc.ini,
 >  > odbcinst.ini files are matching exactly:-
 >  > set_err:State('82') is not a 5 character string, using 's1000' instead
 >  > at /usr/local/lib64/perl5/DBD/ODBC.pm line 153. DBI
 >  > connect('VertcaiABITPRIM','nbx',...)failed: 523 80 (SQL-82).
 >  > Any pointer would be appreciated.
 >  > Regards,
 >  > Mr. Singh
 >
 > What version of Perl, DBI and DBD::ODBC are you using (latest does not
 > help as new versions have recently been released))? You can generally
 > get these using:
 >
 > perl --version
 > perl -MDBI -le 'print $DBI::VERSION'
 > perl -MDBD::ODBC -le 'print $DBD::ODBC::VERSION'
 >
 > Error state '82' is not a 5 character string and ODBC states should be.
 > It might also be useful if you can provide any details of the Vertica
 > ODBC Driver. S1000 is now HY000 which is a general error and should be
 > accompanied with some error string.
 >
 > Error '82' (even 82000) does not exist. Error code 08002 does exist and
 > that can be found h

Re: Failed DBD oracle module

2013-09-23 Thread Bruce Johnson

On Sep 20, 2013, at 8:57 AM, "Lieng, Gia"  wrote:

>  
> $ perl perl_test.script
> Can't load 
> '/usr/local/lib/perl5/site_perl/5.18.1/sun4-solaris/auto/DBD/Oracle/Oracle.so'
>  for module DBD::Oracle: ld.so.1: perl: fatal:
> /opt/oracle/10.2.0.3/lib/libclntsh.so.10.1: wrong ELF class: ELFCLASS64 at 
> /usr/local/lib/perl5/5.18.1/sun4-solaris/DynaLoader.pm line 190.
> at perl_test.script line 4.
> Compilation failed in require at perl_test.script line 4.
> BEGIN failed--compilation aborted at perl_test.script line 4.
>  
>  

I think that 'Wrong ELF class' error means you have a mismatch in bit-ness 
between either Perl and Oracle or DBD and Oracle; I think this one means you 
have the 64-bit Oracle libraries installed on a system expecting 32-bits?

Perhaps you don't have the correct ORACLE_HOME and LD_LIBRARY_PATH environment 
variables set? This can happen if you have 32-bit oracle db installed on the 
system, but use the 64-bit Oracle Instant Client to compile DBD::Oracle. You 
can run a 32-bit Oracle DB and use a 64-Bit oracle client on the same system, 
you just need to know which set of libraries and ORACLE_HOME to look at.


-- 
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group

Institutions do not have opinions, merely customs




Re: Failed DBD oracle module

2013-09-23 Thread Bruce Johnson

On Sep 23, 2013, at 2:02 PM, Bruce Johnson  wrote:

> This can happen if you have 32-bit oracle db installed on the system, but use 
> the 64-bit Oracle Instant Client to compile DBD::Oracle. 

Or Vice-versa, of course, which might be what your problem is.

-- 
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group

Institutions do not have opinions, merely customs