Re: install_driver(Oracle) failed: wrong ELF class: DynaLoader.pm
Hi Jonathan, i set the environment in my skript, the libs are installed correctly - or the script won't run interactively. so, there is a problem with the environment but i cannot see it. is there something important besides @INC and %ENV? i already tried both versions of LD_LIBRARY_PATH /oracle/product/10.2.0/lib:/oracle/product/10.2.0/lib32 /oracle/product/10.2.0/lib32:/oracle/product/10.2.0/lib (as Alexander Alekseev [EMAIL PROTECTED] suggested) here are full outputs of my %ENV. -- 1. interactively - runs ok CLASSPATH - :/oracle/product/10.2.0/classes/oracle:/oracle/product/10.2.0/jlib:/oracle/product/10.2.0/lib EDITOR - vi HOME - /export/home/oracle LD_LIBRARY_PATH - /oracle/product/10.2.0/lib32:/oracle/product/10.2.0/lib LOGNAME - oracle MAIL - /usr/mail/oracle MANPATH - /usr/share/man:/opt/nsr/man NLS_LANG - AMERICAN_AMERICA.WE8DEC OLDPWD - /export/home/oracle ORACLE_BASE - /oracle ORACLE_HOME - /oracle/product/10.2.0 ORACLE_PATH - /oracle/product/10.2.0/bin ORACLE_SID - ora19 ORA_NLS10 - /oracle/product/10.2.0/nls/data PATH - /oracle/product/10.2.0/bin:/usr/ccs/bin:/usr/bin:/bin PS1 - db03:oracle:[$ORACLE_SID]$PWD PWD - /oracle/dba/backup/ora19 SHELL - /bin/ksh SHLVL - 1 SSH_CLIENT - 10.1.3.132 55755 22 SSH_CONNECTION - 10.1.3.132 55755 194.246.199.137 22 SSH_TTY - /dev/pts/2 TERM - xterm TNS_ADMIN - /oracle/product/10.2.0/network/admin TZ - MET USER - oracle _ - ./DbOnline.pl -- 2. as cron job - with 'wrong ELF error' CLASSPATH - /oracle/product/10.2.0/classes/oracle:/oracle/product/10.2.0/jlib:/oracle/product/10.2.0/lib:/oracle/product/10.2.0/classes/oracle:/oracle/product/10.2.0/jlib:/oracle/product/10.2.0/lib HOME - /export/home/oracle LD_LIBRARY_PATH - /oracle/product/10.2.0/lib32:/oracle/product/10.2.0/lib LOGNAME - oracle NLS_LANG - AMERICAN_AMERICA.WE8DEC ORACLE_HOME - /oracle/product/10.2.0 ORACLE_SID - ora19 ORA_NLS10 - /oracle/product/10.2.0/nls/data PATH - /oracle/product/10.2.0/bin:/usr/ccs/bin:/usr/bin:/bin SHELL - /usr/bin/sh TZ - MET -- install_driver(Oracle) failed: Can't load '/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: perl: fatal: /oracle/product/10.2.0/lib/libclntsh.so.10.1: wrong ELF class: ELFCLASS64 at /usr/perl5/5.8.4/lib/sun4-solaris-64int/DynaLoader.pm line 230. at (eval 7) line 3 Compilation failed in require at (eval 7) line 3. Perhaps a required shared library or dll isn't installed where expected at /oracle/dba/backup/ora19/DbOnline.pl line 514 Jonathan Leffler wrote: On Wed, May 28, 2008 at 8:30 AM, Christian Merz [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: i wrote a skript which works fine for several Oracle Versions on several platforms (linux, solarias 8/9). if i run that script ineractively on solaris 10 it also works fine. if i run it as a cron job i get: cron does not set the environment, so you must do so for it. install_driver(Oracle) failed: Can't load '/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: perl: fatal: /oracle/product/10.2.0/lib/libclntsh.so.10.1: wrong ELF class: ELFCLASS64 at /usr/perl5/5.8.4/lib/sun4-solaris-64int/DynaLoader.pm line 230. at (eval 8) line 3 Compilation failed in require at (eval 8) line 3. Perhaps a required shared library or dll isn't installed where expected 32-bit Client library - 64-bit Perl - won't work. Install 32-bit Perl or 64-bit client libraries. Or just set the environment. -- Jonathan Leffler [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] #include disclaimer.h Guardian of DBD::Informix - v2008.0229 - http://dbi.perl.org Blessed are we who can laugh at ourselves, for we shall never cease to be amused.
Re: install_driver(Oracle) failed: wrong ELF class: DynaLoader.pm
On Wed, May 28, 2008 at 11:47 PM, Christian Merz [EMAIL PROTECTED] wrote: i set the environment in my skript, the libs are installed correctly - or the script won't run interactively. I'm not the Oracle expert - treat what I say with a pinch of salt. I do use Solaris 10 quite a lot, though - it's my main development platform. LD_LIBRARY_PATH must be set before ld.so.1 runs (because ld.so.1 reads the env var just once and ignores any subsequent changes to it), and ld.so.1 runs before Perl gets going. So, if your Perl script sets LD_LIBRARY_PATH, it is too late to influence ld.so.1 (and dlopen() etc). I've proved that the hard way - with SUID programs and dlopen() function calls in the mix too. Try modifying your cron job so that it runs a shell script which sets at least LD_LIBRARY_PATH before invoking perl at all (use exec perl ...). I suspect it will work better then. If that isn't feasible (for some brain-dead administrative nightmare of a reason), then try having the Perl code set LD_LIBRARY_PATH and then re-exec itself. I've seen that work too. Weird stuff. The hard part is making sure that the re-exec happens just once! On the other hand, this may still be off-target. But 'stuff works at command line and not when run by cron or web server' almost always ends up as 'the problem is environment'. so, there is a problem with the environment but i cannot see it. is there something important besides @INC and %ENV? i already tried both versions of LD_LIBRARY_PATH /oracle/product/10.2.0/lib:/oracle/product/10.2.0/lib32 /oracle/product/10.2.0/lib32:/oracle/product/10.2.0/lib (as Alexander Alekseev [EMAIL PROTECTED] suggested) here are full outputs of my %ENV. -- 1. interactively - runs ok CLASSPATH - :/oracle/product/10.2.0/classes/oracle:/oracle/product/10.2.0/jlib:/oracle/product/10.2.0/lib EDITOR - vi HOME - /export/home/oracle LD_LIBRARY_PATH - /oracle/product/10.2.0/lib32:/oracle/product/10.2.0/lib LOGNAME - oracle MAIL - /usr/mail/oracle MANPATH - /usr/share/man:/opt/nsr/man NLS_LANG - AMERICAN_AMERICA.WE8DEC OLDPWD - /export/home/oracle ORACLE_BASE - /oracle ORACLE_HOME - /oracle/product/10.2.0 ORACLE_PATH - /oracle/product/10.2.0/bin ORACLE_SID - ora19 ORA_NLS10 - /oracle/product/10.2.0/nls/data PATH - /oracle/product/10.2.0/bin:/usr/ccs/bin:/usr/bin:/bin PS1 - db03:oracle:[$ORACLE_SID]$PWD PWD - /oracle/dba/backup/ora19 SHELL - /bin/ksh SHLVL - 1 SSH_CLIENT - 10.1.3.132 55755 22 SSH_CONNECTION - 10.1.3.132 55755 194.246.199.137 22 SSH_TTY - /dev/pts/2 TERM - xterm TNS_ADMIN - /oracle/product/10.2.0/network/admin TZ - MET USER - oracle _ - ./DbOnline.pl -- 2. as cron job - with 'wrong ELF error' CLASSPATH - /oracle/product/10.2.0/classes/oracle:/oracle/product/10.2.0/jlib:/oracle/product/10.2.0/lib:/oracle/product/10.2.0/classes/oracle:/oracle/product/10.2.0/jlib:/oracle/product/10.2.0/lib HOME - /export/home/oracle LD_LIBRARY_PATH - /oracle/product/10.2.0/lib32:/oracle/product/10.2.0/lib LOGNAME - oracle NLS_LANG - AMERICAN_AMERICA.WE8DEC ORACLE_HOME - /oracle/product/10.2.0 ORACLE_SID - ora19 ORA_NLS10 - /oracle/product/10.2.0/nls/data PATH - /oracle/product/10.2.0/bin:/usr/ccs/bin:/usr/bin:/bin SHELL - /usr/bin/sh TZ - MET -- install_driver(Oracle) failed: Can't load '/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: perl: fatal: /oracle/product/10.2.0/lib/libclntsh.so.10.1: wrong ELF class: ELFCLASS64 at /usr/perl5/5.8.4/lib/sun4-solaris-64int/DynaLoader.pm line 230. at (eval 7) line 3 Compilation failed in require at (eval 7) line 3. Perhaps a required shared library or dll isn't installed where expected at /oracle/dba/backup/ora19/DbOnline.pl line 514 Jonathan Leffler wrote: On Wed, May 28, 2008 at 8:30 AM, Christian Merz [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: i wrote a skript which works fine for several Oracle Versions on several platforms (linux, solarias 8/9). if i run that script ineractively on solaris 10 it also works fine. if i run it as a cron job i get: cron does not set the environment, so you must do so for it. install_driver(Oracle) failed: Can't load '/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: perl: fatal: /oracle/product/10.2.0/lib/libclntsh.so.10.1: wrong ELF class: ELFCLASS64 at /usr/perl5/5.8.4/lib/sun4-solaris-64int/DynaLoader.pm line 230. at (eval 8) line 3 Compilation failed in require at (eval 8) line 3. Perhaps a required shared library or dll isn't installed where expected 32-bit Client library - 64-bit Perl - won't work. Install 32-bit Perl or 64-bit client libraries. Or just set the environment. -- Jonathan Leffler [EMAIL PROTECTED] #include disclaimer.h Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org Blessed are we who can laugh at ourselves, for
Re: install_driver(Oracle) failed: wrong ELF class: DynaLoader.pm
Hi Jonathan, you saved my day! as as workaround i wrote this shell skript: LD_LIBRARY_PATH=/export/home/oracle/product/10.2.0/lib:/export/home/oracle/product/10.2.0/lib32 export LD_LIBRARY_PATH /oracle/dba/backup/ora19/DbOnline.pl ora19 and now it works. Thank you ! ... But this is a workaround i do not like very much. Reexecuting the skript might be a way (probably i will do this). Is there another possibility? cu, Christian Jonathan Leffler wrote: On Wed, May 28, 2008 at 11:47 PM, Christian Merz [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: i set the environment in my skript, the libs are installed correctly - or the script won't run interactively. I'm not the Oracle expert - treat what I say with a pinch of salt. I do use Solaris 10 quite a lot, though - it's my main development platform. LD_LIBRARY_PATH must be set before ld.so.1 runs (because ld.so.1 reads the env var just once and ignores any subsequent changes to it), and ld.so.1 runs before Perl gets going. So, if your Perl script sets LD_LIBRARY_PATH, it is too late to influence ld.so.1 (and dlopen() etc). I've proved that the hard way - with SUID programs and dlopen() function calls in the mix too. Try modifying your cron job so that it runs a shell script which sets at least LD_LIBRARY_PATH before invoking perl at all (use exec perl ...). I suspect it will work better then. If that isn't feasible (for some brain-dead administrative nightmare of a reason), then try having the Perl code set LD_LIBRARY_PATH and then re-exec itself. I've seen that work too. Weird stuff. The hard part is making sure that the re-exec happens just once! On the other hand, this may still be off-target. But 'stuff works at command line and not when run by cron or web server' almost always ends up as 'the problem is environment'. so, there is a problem with the environment but i cannot see it. is there something important besides @INC and %ENV? i already tried both versions of LD_LIBRARY_PATH /oracle/product/10.2.0/lib:/oracle/product/10.2.0/lib32 /oracle/product/10.2.0/lib32:/oracle/product/10.2.0/lib (as Alexander Alekseev [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] suggested) here are full outputs of my %ENV. -- 1. interactively - runs ok CLASSPATH - :/oracle/product/10.2.0/classes/oracle:/oracle/product/10.2.0/jlib:/oracle/product/10.2.0/lib EDITOR - vi HOME - /export/home/oracle LD_LIBRARY_PATH - /oracle/product/10.2.0/lib32:/oracle/product/10.2.0/lib LOGNAME - oracle MAIL - /usr/mail/oracle MANPATH - /usr/share/man:/opt/nsr/man NLS_LANG - AMERICAN_AMERICA.WE8DEC OLDPWD - /export/home/oracle ORACLE_BASE - /oracle ORACLE_HOME - /oracle/product/10.2.0 ORACLE_PATH - /oracle/product/10.2.0/bin ORACLE_SID - ora19 ORA_NLS10 - /oracle/product/10.2.0/nls/data PATH - /oracle/product/10.2.0/bin:/usr/ccs/bin:/usr/bin:/bin PS1 - db03:oracle:[$ORACLE_SID]$PWD PWD - /oracle/dba/backup/ora19 SHELL - /bin/ksh SHLVL - 1 SSH_CLIENT - 10.1.3.132 http://10.1.3.132 55755 22 SSH_CONNECTION - 10.1.3.132 http://10.1.3.132 55755 194.246.199.137 http://194.246.199.137 22 SSH_TTY - /dev/pts/2 TERM - xterm TNS_ADMIN - /oracle/product/10.2.0/network/admin TZ - MET USER - oracle _ - ./DbOnline.pl -- 2. as cron job - with 'wrong ELF error' CLASSPATH - /oracle/product/10.2.0/classes/oracle:/oracle/product/10.2.0/jlib:/oracle/product/10.2.0/lib:/oracle/product/10.2.0/classes/oracle:/oracle/product/10.2.0/jlib:/oracle/product/10.2.0/lib HOME - /export/home/oracle LD_LIBRARY_PATH - /oracle/product/10.2.0/lib32:/oracle/product/10.2.0/lib LOGNAME - oracle NLS_LANG - AMERICAN_AMERICA.WE8DEC ORACLE_HOME - /oracle/product/10.2.0 ORACLE_SID - ora19 ORA_NLS10 - /oracle/product/10.2.0/nls/data PATH - /oracle/product/10.2.0/bin:/usr/ccs/bin:/usr/bin:/bin SHELL - /usr/bin/sh TZ - MET -- install_driver(Oracle) failed: Can't load '/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: perl: fatal: /oracle/product/10.2.0/lib/libclntsh.so.10.1: wrong ELF class: ELFCLASS64 at /usr/perl5/5.8.4/lib/sun4-solaris-64int/DynaLoader.pm line 230. at (eval 7) line 3 Compilation failed in require at (eval 7) line 3. Perhaps a required shared library or dll isn't installed where expected at /oracle/dba/backup/ora19/DbOnline.pl line 514 Jonathan Leffler wrote: On Wed, May 28, 2008 at 8:30 AM, Christian Merz [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: i wrote a skript which works fine for several Oracle Versions on several platforms (linux, solarias 8/9). if i run that script ineractively on solaris
Re: install_driver(Oracle) failed: wrong ELF class: DynaLoader.pm
On 2008-05-29 09:26:29 +0200, Christian Merz wrote: as as workaround i wrote this shell skript: LD_LIBRARY_PATH=/export/home/oracle/product/10.2.0/lib:/export/home/oracle/product/10.2.0/lib32 export LD_LIBRARY_PATH /oracle/dba/backup/ora19/DbOnline.pl ora19 and now it works. Thank you ! ... But this is a workaround i do not like very much. Reexecuting the skript might be a way (probably i will do this). Is there another possibility? You could write LD_LIBRARY_PATH=/export/home/oracle/product/10.2.0/lib:/export/home/oracle/product/10.2.0/lib32 /oracle/dba/backup/ora19/DbOnline.pl ora19 directly into the crontab. But personally I prefer invoking small shell scripts to very long commands in crontabs. hp -- _ | Peter J. Holzer| If I wanted to be academically correct, |_|_) | Sysadmin WSR | I'd be programming in Java. | | | [EMAIL PROTECTED] | I don't, and I'm not. __/ | http://www.hjp.at/ | -- Jesse Erlbaum on dbi-users pgpb1lbLOl4EL.pgp Description: PGP signature
RE: install_driver(Oracle) failed: wrong ELF class: DynaLoader.pm
I think another common way to go about it is to put something like this into your crontab command: su - user id -c 'run my command here' And then when the crontab runs it logs you in to the right user id with all the environment settings intact. Works especially well if you have it set up in the root crontab, as password prompts are not a problem. There are other variations on this theme. -Will -Original Message- From: Christian Merz [mailto:[EMAIL PROTECTED] Sent: Thursday 29 May 2008 03:26 To: Jonathan Leffler Cc: dbi-users@perl.org Subject: Re: install_driver(Oracle) failed: wrong ELF class: DynaLoader.pm Hi Jonathan, you saved my day! as as workaround i wrote this shell skript: LD_LIBRARY_PATH=/export/home/oracle/product/10.2.0/lib:/expor t/home/oracle/product/10.2.0/lib32 export LD_LIBRARY_PATH /oracle/dba/backup/ora19/DbOnline.pl ora19 and now it works. Thank you ! ... But this is a workaround i do not like very much. Reexecuting the skript might be a way (probably i will do this). Is there another possibility? cu, Christian Jonathan Leffler wrote: On Wed, May 28, 2008 at 11:47 PM, Christian Merz [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: i set the environment in my skript, the libs are installed correctly - or the script won't run interactively. - - - - - Cisco- - - - - This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.
Re: install_driver(Oracle) failed: wrong ELF class: DynaLoader.pm
On Wed, May 28, 2008 at 8:30 AM, Christian Merz [EMAIL PROTECTED] wrote: i wrote a skript which works fine for several Oracle Versions on several platforms (linux, solarias 8/9). if i run that script ineractively on solaris 10 it also works fine. if i run it as a cron job i get: cron does not set the environment, so you must do so for it. install_driver(Oracle) failed: Can't load '/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: perl: fatal: /oracle/product/10.2.0/lib/libclntsh.so.10.1: wrong ELF class: ELFCLASS64 at /usr/perl5/5.8.4/lib/sun4-solaris-64int/DynaLoader.pm line 230. at (eval 8) line 3 Compilation failed in require at (eval 8) line 3. Perhaps a required shared library or dll isn't installed where expected 32-bit Client library - 64-bit Perl - won't work. Install 32-bit Perl or 64-bit client libraries. Or just set the environment. -- Jonathan Leffler [EMAIL PROTECTED] #include disclaimer.h Guardian of DBD::Informix - v2008.0229 - http://dbi.perl.org Blessed are we who can laugh at ourselves, for we shall never cease to be amused.
Re: install_driver(Oracle) failed: wrong ELF class: DynaLoader.pm
Hello! On Wed, 28 May 2008, Christian Merz wrote: module DBD::Oracle: ld.so.1: perl: fatal: /oracle/product/10.2.0/lib/libclntsh.so.10.1: wrong ELF class: ELFCLASS64 at ... LD_LIBRARY_PATH - /oracle/product/10.2.0/lib:/oracle/product/10.2.0/lib32 Change LD_LIBRARY_PATH to: LD_LIBRARY_PATH=/oracle/product/10.2.0/lib32:/oracle/product/10.2.0/lib