安装了 DBD::ORACLE 还抱错(已解决)

安装了 DBD::ORACLE 还抱错(已解决)

安装了 DBD::ORACLE 还抱错(已解决)
操作如下
install_driver(ORACLE) failed: [color=red]Can't locate DBD/ORACLE.pm [/color] in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at (eval 1) line 3.
Perhaps the DBD::ORACLE perl module hasn't been fully installed,
or perhaps the capitalisation of 'ORACLE' isn't right.
Available drivers: ExampleP, [color=red]Oracle[/color], Pg, Proxy.
at ./sql.pl line 15

但是:
[color=red][/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/DBD>]ls
Oracle Oracle.pm[/color]存在啊

怎么办 我的事 redhat
我也重新登陆了啊
是不是非要在 路径里面把 DBD的路径加上
可是在哪修改这个环境变量呢


谢谢了

这个问题在新手区问了没人 回答
转到这来 ,数据库开发 应该算高级问题了 不好意思




   

perldoc DBD::Oracle --.
perldoc DBD::Oracle
也出结果了,这说明我的状上了,可是为什么就是找不到呢
非要精确到/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/DBD
才能找到 DBD/ORACLE.pm 吗



perldoc DBD::Oracle
i386-linux-thread-multUserBContributed)i386-linux-thread-multi::DBD::Oracle(3)

NAME
DBD::Oracle - Oracle database driver for the DBI module

SYNOPSIS
use DBI;

$dbh = DBI->connect("dbi:Oracle:$dbname", $user, $passwd);

$dbh = DBI->connect("dbi:Oracle:host=$host;sid=$sid", $user, $passwd);

# See the DBI module documentation for full details

# for some advanced uses you may need Oracle type values:
use DBD::Oracle qw(:ora_types);

DESCRIPTION
DBD::Oracle is a Perl module which works with the DBI module to provide
access to Oracle databases.

CONNECTING TO ORACLE
This is a topic which often causes problems. Mainly due to Oracle's
many and sometimes complex ways of specifying and connecting to
databases. (James Taylor and Lane Sharman have contributed much of the
text in this section.)

Connecting without environment variables or tnsname.ora file

If you use the "host=$host;sid=$sid" style syntax, for example:

$dbh = DBI->connect("dbi:Oracle:host=myhost.com;sid=ORCL", $user, $passwd);

then DBD::Oracle will construct a full connection descriptor string for
you and Oracle will not need to consult the tnsname.ora file.

If a "port" number is not specified then the descriptor will try both
1526 and 1521 in that order (e.g., new then old). You can check which
port(s) are in use by typing "$ORACLE_HOME/bin/lsnrctl stat" on the
代码以前写的是----$d.
代码以前写的是

$dsn="DBI:ORACLE:POWER";
$user="intf";
$password="intf";

$dbh=DBI->connect($dsn,$user,$password,{RaiseError => 1, AutoCommit => 0}) [color=red][/color][color=red][/color][color=red][/color][color=red][/color]
报上面的错

改成$dsn="DBI:Oracle:POWER";

Can't locate auto/DBI/prepare.al in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at ./sql.pl line 17
Issuing rollback() for database handle being DESTROY'd without explicit disconnect().
不好意思 没有很好的理解<.
不好意思 没有很好的理解
DBD::Qracle的说明
新的代码
#!/usr/bin/perl -w

use DBI;
use strict;

my ($dsn, $user, $password);
my @rows;
my $dbh;
my $sth;

$dsn="dbi:Oracle:power";
$user="intf";
$password="intf";

$dbh=DBI->connect($dsn,$user,$password,{RaiseError => 1, AutoCommit => 0})
||die "Catabase Connect not made : $DBI::errstr";
[color=red]$sth=$dbh->prepare("select * from t_In_dKtb_a");[/color]
$sth->execute();

while(@rows = $sth->fetchrow_array)
{
print "@rows \n";
}

$sth->finish();
[color=red]$dbh->disconnect();[/color]