perl DBI、DBD-mysql、DBD-Oracle安裝
perl DBI:
安裝過程很簡單,下載解壓:
gzip -d DBI-1.604.tar.gz
tar xvf DBI-1.604.tar
cd DBI-1.604:
perl Makefile.PL
make
make test
make install
DBD-mysql:
rpm -ivh MySQL-devel-community-5.1.52-1.rhel5.i386.rpm
gzip -d DBD-mysql-4.006.tar.gz
tar xvf DBD-mysql-4.006.tar
perl Makefile.PL
make
make test
make install
DBD-Oracle:
cd DBD-Oracle-1.21
perl Makefile.PL
make
make test
make install
perl Makefile.PL
make
make test
make install
[oracle@node1 ~]$ perl perora.pl
install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site_perl/5.8.8/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.8/i386-linux-thread-multi/DynaLoader.pm line 230.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at perora.pl line 17
install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site_perl/5.8.8/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.8/i386-linux-thread-multi/DynaLoader.pm line 230.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at perora.pl line 17
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/:/lib
--需要用到一些動態庫
#!/usr/bin/perl -w
#2011-01-12
#2011-01-12
#use strict;
use DBI;
#use DBI qw(:sql_types);
use DBI;
#use DBI qw(:sql_types);
$ENV{ORACLE_HOME} = "/data/ora10g/product/10.2.0/db_1";
$ENV{ORACLE_SID} = "RACDBSTD";
$ENV{LD_LIBRARY_PATH} = "/data/ora10g/product/10.2.0/db_1/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/:/lib";
$ENV{ORACLE_SID} = "RACDBSTD";
$ENV{LD_LIBRARY_PATH} = "/data/ora10g/product/10.2.0/db_1/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/:/lib";
$ENV{PATH} = "/data/ora10g/product/10.2.0/db_1/bin:/home/oracle/tools:/usr/sbin:/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/orac
le/bin";
le/bin";
#connect to postgresql database
my $dbh =DBI->connect( 'dbi:Oracle:RACDBSTD',
'test',
'test',
{
RaiseError => 1,
AutoCommit => 0
}
) || die "Database connection not made: $DBI::errstr";
my $dbh =DBI->connect( 'dbi:Oracle:RACDBSTD',
'test',
'test',
{
RaiseError => 1,
AutoCommit => 0
}
) || die "Database connection not made: $DBI::errstr";
my $sql1 = qq{select name from tt};
my $sth1 = $dbh->prepare($sql1) ;
$sth1->execute();
my $rwcount = 0;
while( my @result1 = $sth1->fetchrow_array )
{
print "$result1[0]\n";
}
my $sth1 = $dbh->prepare($sql1) ;
$sth1->execute();
my $rwcount = 0;
while( my @result1 = $sth1->fetchrow_array )
{
print "$result1[0]\n";
}
$dbh->disconnect();
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/758322/viewspace-683947/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- perl dbi oracleOracle
- perl DBI 學習總結
- linux安裝mysql dbiLinuxMySql
- ruby DBI安裝使用指南
- perl 安裝
- perl的安裝
- perl DBI DBD和java 的JDBC對比學習JavaJDBC
- perl cpan 模組安裝
- 《Modern Perl》前言--包含了Perl的安裝使用
- perl-Time-HiRes安裝與perl衝突
- perl安裝異常整理
- 使用CPAN安裝Perl模組
- DBI 資料庫模組剖析:Perl DBI 資料庫通訊模組規範,工作原理和例項資料庫
- 菜鳥安裝DBI DBD
- strawberry perl安裝,環境變數及模組安裝變數
- 基於oracle linux的 DBI/DBD 標準化安裝OracleLinux
- mysql安裝依賴perl(Data::Dumper)MySql
- 【NinGoo】Redhat上安裝Perl DBD::mysql模組GoRedhatMySql
- linux下編譯安裝perl(5.10.0)Linux編譯
- Perl的NT安裝實驗報告(轉)
- 在 linux 系統下安裝 perl(轉)Linux
- Windows10下如何安裝配置 perl 環境Windows
- 受限制環境安裝Perl模組方法(轉)
- Can't locate DBI.pm in @INC (@INC contains: /usr/lib64/perl5AI
- 安裝php出現“/replace/with/path/to/perl/interpreter:baPHP
- 記錄一下perl DBI 的selectall_hashref返回的結構到底怎樣的
- A Short Guide to DBIGUIIDE
- Perl CPAN安裝報錯CPAN::Modulelist的解決辦法
- 安裝12pdb遇到 Error in Process:/u01/app/oracle/product/12.1.0/db_1/perl/bin/perlErrorAPPOracle
- 在Linux系統下安裝Perl指令碼語言(轉)Linux指令碼
- DBI模組方法簡介(轉)
- CentOS 6.5安裝perl模組報錯'Can't locate ExtUtils/Manifest.pm'CentOS
- Perl檢視都安裝了那些元件元件
- linux solaris aix上取系統前N天日期(必須安裝perl)LinuxAI
- bugzilla更新出現perl模組無法安裝問題解決辦法
- DBI@引數資料型別資料型別
- perl
- codis安裝 (java 安裝 + zookeeper 安裝 + go 安裝 + codis 安裝JavaGo