473,513 Members | 2,684 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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 6795
William Shen
2 New Member
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 Recognized Expert New Member
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
3896
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
8448
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
3233
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
4645
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
6802
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
2047
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
4291
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
5480
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
2787
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
5911
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
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.