davesbedroom has asked for the wisdom of the Perl Monks concerning the following question:

Everything works great as user root and oracle.
I get the following error as anyone else:
Uncaught exception from user code: install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site +_perl/5.8.0/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for mo +dule DBD::Oracle: libclntsh.so.8.0: cannot open shared object file: No such file or directory at /usr/lib/perl5/ +5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229. at (eval 2) line 3 Compilation failed in require at (eval 2) line 3. Perhaps a required shared library or dll isn't installed where expecte +d at test.pl line 6 DBI::install_driver('DBI','Oracle') called at /usr/lib/perl5/v +endor_perl/5.8.0/i386-linux-thread-multi/DBI.pm line 507 DBI::connect('DBI','coalmine','scott','tiger','Oracle') called + at test.pl line 6

Here is the code for test.pl:
#!/usr/bin/perl -w use DBI; use strict; use diagnostics; $ENV{'ORACLE_HOME'} = "/home/oracle"; my $dbh = DBI->connect('coalmine',"scott","tiger",'Oracle'); my $date = $dbh->selectrow_array("SELECT SYSDATE FROM DUAL"); if($date) { print "Database Date $date\n"; } else { print "Failed\n"; } $dbh->disconnect;

I have tried adding the users to the oracle and dba group. Someone tried changing one of the users UID to 0, and it started working for them. What is going on here?

Replies are listed 'Best First'.
Re: Oracle DBI weird problems
by markjugg (Curate) on May 28, 2004 at 14:10 UTC
    Have you checked the filesystem permissions to make sure you can access all the needed files as non-root users?
      My hunch was the same as Mark's. IIRC, the permissions on the all the Oracle directories(and files) needs to be 755, owned by user 'oracle' with group 'oinstall' (or group 'oracle' - I can't remember which, but I think 'oinstall' is the correct group).
      Thank You. You got it. I had access to everything except /home/oracle/lib/libclntsh.so.8.0