实战Linux环境配置DBD: Oracle模块
2009-04-04 13:12:11 来源:WEB开发网第三步:配置ORACLE_HOME环境变量
如果安装了Oracle Database软件,这个ORACLE_HOME就是安装oracle时所设值。在只安装Instant Client的情形下,此值设为第一步中instantclient_11_1目录的绝对路径,如下:
shawn@shawn-laptop:/tmp/DBD-Oracle-1.22$exportORACLE_HOME=/tmp/InstantClient/instantclient_11_1
shawn@shawn-laptop:/tmp/DBD-Oracle-1.22$echo $ORACLE_HOME
/tmp/InstantClient/instantclient_11_1
第四步:编译安装DBD::Oracle模块
首先是使用PERL的Makefile.PL来生成makefile
shawn@shawn-laptop:/tmp/DBD-Oracle-1.22$perl Makefile.PL
Using DBI 1.607 (for perl 5.008008 on i486-linux-gnu-thread-multi)
installed in /usr/local/lib/perl/5.8.8/auto/DBI/
Configuring DBD::Oracle for perl 5.008008 on linux (i486-linux-gnu-thread-multi)
Remember to actually *READ* the README file! Especially if you have any problems.
Installing on a linux, Ver#2.6
Using Oracle in /tmp/InstantClient/instantclient_11_1
DEFINE _SQLPLUS_RELEASE = "1101000700" (CHAR)
Oracle version 11.1.0.7 (11.1)
Looks like an Instant Client installation, okay
[..省略部分屏幕输出..]
运行make
shawn@shawn-laptop:/tmp/DBD-Oracle-1.22$make
cp Oracle.pm blib/lib/DBD/Oracle.pm
cp oraperl.ph blib/lib/oraperl.ph
cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h
I/Driver.xst > Oracle.xsi
[..省略部分屏幕输出..]
然后切换成root用户make install
shawn@shawn-laptop:/tmp/DBD-Oracle-1.22$su
Password:
root@shawn-laptop:/tmp/DBD-Oracle-1.22#make install
[..省略部分屏幕输出..]
至此,DBD::Oracle配置安装完毕,用户可以使用此模块连接Oracle进行相应的操作
更多精彩
赞助商链接