473,320 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to fix "can't load oracle.so" error for script using Oracle DB?

Hi everyone.

I want to create a crawler with perl and run it on crowntab. The program should use DBI and DBD::Oracle to insert data into my database.

When crontab runs it, I get the following error in my mail box.

Can't load '/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/Dynaloader.pm line 230.

my code is something like:
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl 
  2.  
  3. use Getopt::Long; 
  4. use POSIX; 
  5. use POSIX qw(setsid); 
  6. use warnings; 
  7. use Data::Dumper; 
  8. use WWW::Mechanize; 
  9. use DBI; 
  10. use DBD::Oracle; 
  11. use XML::Twig; 
  12.  
  13. init_env(); 
  14.  
  15. #do something----- 
  16.  
  17. sub init_env 
  18.     $SIG{'INT'}  = 'IGNORE'; 
  19.     $SIG{'QUIT'} = 'IGNORE'; 
  20.     $SIG{'TERM'} = 'IGNORE'; 
  21.     $SIG{'PIPE'} = 'IGNORE'; 
  22.     # signal(SIGPIPE, SIG_IGN); 
  23.     $SIG{'CHLD'} = 'IGNORE'; 
  24.  
  25.     my $pid = fork(); die "$!" unless defined $pid; exit 4 if $pid; 
  26.  
  27.  
  28.     POSIX::setsid() or die "Can't start a new session: $!"; 
  29.  
  30.     # Flush standard output buffer. 
  31.     select(STDOUT); 
  32.     $| = 1; 
  33.  
  34.  
  35. BEGIN 
  36.         $ENV{ORACLE_HOME} = "/u01/oracle/product/10.2.0/client_1"; 
  37.         $ENV{PATH} = "/bin:/usr/bin:/u01/oracle/product/10.2.0/client_1/bin:/home/appowner/bin:."; 
  38.         $ENV{LD_LIBRARY_PATH} = "/u01/oracle/product/10.2.0/client_1/lib"; 
  39.  
  40. END { 
  41.  
  42.  }
  43.  
  44.  
I have installed both DBI and DBD::Oracle with CPAN.

Please help and many thanks.

Shen
Jan 26 '11 #1
2 6768
Hey I have figured out there is something wrong with my DBD installation, I corrected it and it run fine when I do it manually on command line, but still getting same error when crontab calls it. I read it on some other site that people suggest to set LD_LIBRARY_PATH to point to where the shared library is. But as you can see, I have set it to the location where "libclntsh.so.10.1" is located. =(
Jan 27 '11 #2
chorny
80 Expert
Did you try setting LD_LIBRARY_PATH to both directories, colon-separated?
Jan 28 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Vicky | last post by:
Hi, Here it the test perl code to connect to my Sybase database server.... ******************************** use CGI; use DBI; # Connect to database. my $My_dbh =
1
by: rawii | last post by:
I am running on a Sun box and am trying to install the perl tools to connect to Oracle. When I try to install the DBD::Oracle module, I get the following. Please help.. What does is mean and...
0
by: Axel Dachtler | last post by:
Hi, I have downloaded both CPAN-moduls DBD-Oracle-1.14.tar and DBI-1.39.tar. But I fail in installing these moduls! The Perl Package Manager (PPM) returns this error message: no valid...
0
by: Piotr B. | last post by:
Hello, I want to make use of a Perl script "ora2pg" (Oracle to PostgreSQL schema converter), which requires the following modules: DBI, DBD::Oracle and DBD::Pg. As I don't use Perl on a...
3
by: hakiran | last post by:
Hello all, I have been using Perl DBI the last 6months or so. I use it extensively with MySQL. But recently i tried to access Oracle DB with it and was having trouble. Any help would be...
1
by: jrefran | last post by:
Hi everyone! I have problem on my DBD:Oracle installation from source code. Does anyone familiar with this kind of error. Please help! I'm completely new with this kind of work item. This is the...
9
by: mdshafi01 | last post by:
Hello All, I have problem in installing DBD::ORACLE package. Please can any one have experience in installing DBD::ORACLE package. please give me some hints to install this DBD::ORACLE...
1
by: srikantvm | last post by:
Hi All, I am using perl, v5.8.8 built for MSWin32-x86-multi-thread and i tried installing the DBD-Oracle module but unable to install. Please find below the steps followed by me: 1) I first...
3
by: OracletoPerl | last post by:
hi to all can anyone help me out in getting DBD::Oracle for windows.. i am currently using oracle 9i and active perl state 5.8.8..
17
by: kanishka1213 | last post by:
when i run perl script in the cmd prompt , it runs well and outputs results from db. but when i run the same script on apache server internet explorer. i get an error as -----...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.