开发者

Unix Oracle / Perl driver problem

开发者 https://www.devze.com 2022-12-17 05:47 出处:网络
I have a script that is using DBI to interface with Oracle, but I keep getting the following error: install_driver(Oracle) failed: Can\'t

I have a script that is using DBI to interface with Oracle, but I keep getting the following error:

install_driver(Oracle) failed: Can't load '/usr/opt/perl5/lib/site_perl/5.005/aix/auto/DBD/Oracle/Oracle.s o' for module DBD::Oracle: dlopen: /usr/opt/perl5/lib/site_perl/5.005/aix/auto/DBD/Oracle/Oracle.so: can't load library /usr/opt/perl5/lib/site_perl/5.005/aix/auto/DBD/Oracle/Oracle.so50 /usr/oracle/lib/libclnts h.a shr.o103 /usr/oracle/lib/libclntsh.a shr.ocan't load library /usr/oracle/lib/libclntsh.a50 /usr/oracle /lib/libclntsh.a at /usr/local/lib/perl5/5.6.0/aix/DynaLoader.pm line 200. at (eval 1) line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required shared library or dll isn't installed where expected at ./dbi_test.pl line 9

Line 9 is were id do the prepare statement in my perl script: my $sth = $dbh->prepare('Sql statement here') or die "Couldn't prepare statement: " . $dbh->errstr;

I looked and I have 2 versions of Perl installed in the /usr/opt/perl5/lib/site_perl/ directory: 5.005 and 5.8.0

My boss informed me that the version of AIX installs one version and our version of Oracle installs another. So I'm thinking 开发者_开发百科I'm loading the wrong driver, but am not sure.

Does anyone see what might be the problem?

Any help is appreciated.


It looks like you might have installed the DBI driver under your 5.8 perl installation, but the system is using the 5.005 installation when your script is run (probably due to your PATH setting). Change your path to use the 5.8 executable, and set your PERL5LIB environment variable to include the 5.8 library paths.

If you have to use the 5.005 version, then install DBI under that version as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号