perl 连接远程oracle报错
Activeperl 是5.14版本,远程的oracle 是11g,在PPM看到安装了DBD-Oracle:1.30
pl的代码如下:
#!/usr/bin/perl -w
use DBI;
my $dbSid = "mydb";
my $dbHost = "196.168.1.15:1521";
my $dbUser = "admin";
my $dbPassword = "admin111";
my $dbh = DBI->connect("DBI:Oracle:host=$dbHost:$dbSid", $dbUser, $dbPassword) or print ($DBI::errstr);
my $sth = $dbh->prepare("select sysdate from dual");
$sth->execute;
my @recs = "";
while ( my @recs=$sth->fetchrow_array) {
print $recs[0]."\n";
}
$dbh->finish;
$dbh->disconnect;
exit if(1);
perl.exe-无法找到入口
无法定位程序输入点OCIDBStartup于动态链接库OCI.dll上.
D:\>perl oracle.pl
install_driver(Oracle) failed: Can't load 'C:/Perl/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:找
不到指定的程序。 at C:/Perl/lib/DynaLoader.pm line 191.
at (eval 5) line 3
Compilation failed in require at (eval 5) line 3.
Perhaps a required shared library or dll isn't installed where expected
at oracle.pl line 9