Installing the Oracle module for Perl
Actually, the install it is pretty straight forward, provided that you have Oracle installed on the given server.
First off, test if you have it installed:
If you get all that gonk of data spilled at the prompt, it is not installed at all on the server, so let's get going on, first download it:
Then, untar it:
move yourself inside the new directory:
And then execute the make file:
Now, all you have to do is just make it happen :) :
After all that, there no other thing than install it:
Test once again, if you get your prompt once again after executing it, without any spilled error messages, you are all done.
First off, test if you have it installed:
[dbserver ]# perl -e 'use DBD::Oracle'
Can't locate DBD/Oracle.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386
-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/pe
rl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_p
erl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor
_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl
5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.
8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
If you get all that gonk of data spilled at the prompt, it is not installed at all on the server, so let's get going on, first download it:
wget http://search.cpan.org/CPAN/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.17.tar.gz
Then, untar it:
tar -zxf DBD-Oracle-1.17.tar.gz
move yourself inside the new directory:
cd DBD-Oracle-1.17
And then execute the make file:
[dbserver DBD-Oracle-1.17]# perl Makefile.PL
Using DBI 1.40 (for perl 5.008008 on i386-linux-thread-multi) installed in /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI
Configuring DBD::Oracle for perl 5.008008 on linux (i386-linux-thread-multi)
Remember to actually *READ* the README file! Especially if you have any problems.
Using Oracle in /usr/local/oracle/product/10.2.0
DEFINE _SQLPLUS_RELEASE = "1002000100" (CHAR)
Oracle version 10.2.0.1 (10.2)
Found /usr/local/oracle/product/10.2.0/rdbms/demo/demo_rdbms.mk
Using /usr/local/oracle/product/10.2.0/rdbms/demo/demo_rdbms.mk
Your LD_LIBRARY_PATH env var is set to '/usr/local/oracle/product/10.2.0/lib'
Reading /usr/local/oracle/product/10.2.0/rdbms/demo/demo_rdbms.mk
Reading /usr/local/oracle/product/10.2.0/rdbms/lib/env_rdbms.mk
Attempting to discover Oracle OCI build rules
gcc -c -o DBD_ORA_OBJ.o DBD_ORA_OBJ.c
by executing: [make -f /usr/local/oracle/product/10.2.0/rdbms/demo/demo_rdbms.mk build ECHODO=echo ECHO=echo GENCLNTSH='echo genclntsh' CC=true OPTIMIZE= CCFLAGS= EXE=DBD_ORA_EXE OBJS=DBD_ORA_OBJ.
o]
Oracle oci build command:
[true -L/usr/local/oracle/product/10.2.0/lib/ -L/usr/local/oracle/product/10.2.0/rdbms/lib/ -o DBD_ORA_EXE DBD_ORA_OBJ.o -lclntsh `cat /usr/local/oracle/product/10.2.0/lib/sysliblist` -l
dl -lm ]
Found header files in /usr/local/oracle/product/10.2.0/rdbms/public.
Checking for functioning wait.ph
Constant subroutine __USE_POSIX undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 8.
Constant subroutine __USE_POSIX2 undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 9.
Constant subroutine __USE_POSIX199309 undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 10.
Constant subroutine __USE_POSIX199506 undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 11.
Constant subroutine __USE_XOPEN undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 12.
Constant subroutine __USE_XOPEN_EXTENDED undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 13.
Constant subroutine __USE_UNIX98 undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 14.
Constant subroutine __USE_LARGEFILE undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 16.
Constant subroutine __USE_LARGEFILE64 undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 17.
Constant subroutine __USE_FILE_OFFSET64 undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 18.
Constant subroutine __USE_BSD undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 19.
Constant subroutine __USE_SVID undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 20.
Constant subroutine __USE_MISC undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 21.
Constant subroutine __USE_GNU undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 22.
Constant subroutine __USE_REENTRANT undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 23.
Constant subroutine _POSIX_SOURCE undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 48.
Constant subroutine _POSIX_C_SOURCE undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 50.
Constant subroutine _XOPEN_SOURCE undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 52.
Constant subroutine _XOPEN_SOURCE_EXTENDED undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 54.
Constant subroutine _LARGEFILE64_SOURCE undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 56.
Constant subroutine _LARGEFILE_SOURCE undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 98.
Constant subroutine __USE_ISOC99 undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 102.
Constant subroutine __GNU_LIBRARY__ undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/features.ph line 147.
Operator or semicolon missing before &__inline at (eval 148) line 1.
Ambiguous use of & resolved as operator & at (eval 148) line 1.
Constant subroutine __need_size_t undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/stddef.ph line 148.
Scalar found where operator expected at (eval 221) line 1, near "'int' $__val"
(Missing operator before $__val?)
Unquoted string "typedef" may clash with future reserved word at (eval 224) line 1.
Operator or semicolon missing before &typedef at (eval 224) line 1.
Ambiguous use of & resolved as operator & at (eval 224) line 1.
Number found where operator expected at (eval 226) line 1, near ") 0"
(Missing operator before 0?)
Number found where operator expected at (eval 227) line 1, near ") 1"
(Missing operator before 1?)
Number found where operator expected at (eval 228) line 1, near ") 2"
(Missing operator before 2?)
Constant subroutine __need_timespec undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/time.ph line 48.
Constant subroutine __need_schedparam undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/bits/sched.ph line 37.
Constant subroutine __need_timeval undefined at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/bits/time.ph line 23.
System: perl5.008008 linux build-i386 2.6.9-42.0.3.elsmp #1 smp fri oct 6 06:21:39 cdt 2006 i686 i686 i386 gnulinux
Compiler: gcc -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_O
FFSET_BITS=64 -I/usr/include/gdbm
Linker: /usr/bin/ld
Sysliblist: -ldl -lm -lpthread -lnsl -lirc
Oracle makefiles would have used these definitions but we override them:
CC: $(COMPDIR)/bin/gcc
CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS)\
$(SHARED_CFLAG) $(USRFLAGS)
[$(GFLAG) -O2 $(CDEBUG) $(CCFLAGS) -I/usr/local/oracle/product/10.2.0/rdbms/demo -I/usr/local/oracle/product/10.2.0/rdbms/public -I/usr/local/oracle/product/10.2.0/plsql/public -I/usr/l
ocal/oracle/product/10.2.0/network/public -DLINUX -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS $(LPFLAGS) $(USRFLAGS)]
LDFLAGS: -o $@ $(LDPATHFLAG)$(PRODLIBHOME) $(LDPATHFLAG)$(LIBHOME) $(LDPATHFLAG)$(LIBHOME)stubs/ -L$(COMPDIR)/lib -lirc
[-o $@ -L/usr/local/oracle/product/10.2.0/rdbms/lib/ -L$(LIBHOME) -L$(LIBHOME)stubs/ -L/usr/lib -lirc]
Linking with OTHERLDFLAGS = -L/usr/local/oracle/product/10.2.0/lib/ -L/usr/local/oracle/product/10.2.0/rdbms/lib/ -lclntsh `cat /usr/local/oracle/product/10.2.0/lib/sysliblist` -ldl -lm [fro
m 'build' rule]
Checking if your kit is complete...
Looks good
LD_RUN_PATH=/usr/local/oracle/product/10.2.0/lib:/usr/local/oracle/product/10.2.0/rdbms/lib
Using DBD::Oracle 1.17.
Using DBD::Oracle 1.17.
Using DBI 1.40 (for perl 5.008008 on i386-linux-thread-multi) installed in /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI
Writing Makefile for DBD::Oracle
*** If you have problems...
read all the log printed above, and the README and README.help.txt files.
(Of course, you have read README by now anyway, haven't you?)
Now, all you have to do is just make it happen :) :
[dbserver DBD-Oracle-1.17]# 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
cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h
cp Oraperl.pm blib/lib/Oraperl.pm
cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h
cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm
cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm
/usr/bin/perl -p -e "s/~DRIVER~/Oracle/g" /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI/Driver.xst > Oracle.xsi
/usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap -typemap typemap Oracle.xs > Oracle.xsc && mv Oracle.xsc Oracle.c
gcc -c -I/usr/local/oracle/product/10.2.0/rdbms/public -I/usr/local/oracle/product/10.2.0/rdbms/demo -I/usr/local/oracle/product/10.2.0/rdbms/public -I/usr/local/oracle/product/10.2.0/plsql/publi
c -I/usr/local/oracle/product/10.2.0/network/public -I/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-st
atement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -DVERSION=\"1.17\" -DXS_VERSION=\"1.17\" -fPIC "-I/usr/l
ib/perl5/5.8.8/i386-linux-thread-multi/CORE" -Wall -Wno-comment -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.1\" Oracle.c
In file included from /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI/DBIXS.h:31,
from Oracle.h:13,
from Oracle.xs:1:
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI/dbipport.h:227:1: warning: "PERL_UNUSED_DECL" redefined
In file included from /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI/DBIXS.h:19,
from Oracle.h:13,
from Oracle.xs:1:
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/perl.h:163:1: warning: this is the location of the previous definition
Oracle.c: In function `XS_DBD__Oracle__db_ora_lob_append':
Oracle.xs:201: warning: unused variable `startp'
gcc -c -I/usr/local/oracle/product/10.2.0/rdbms/public -I/usr/local/oracle/product/10.2.0/rdbms/demo -I/usr/local/oracle/product/10.2.0/rdbms/public -I/usr/local/oracle/product/10.2.0/plsql/publi
c -I/usr/local/oracle/product/10.2.0/network/public -I/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-st
atement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -DVERSION=\"1.17\" -DXS_VERSION=\"1.17\" -fPIC "-I/usr/l
ib/perl5/5.8.8/i386-linux-thread-multi/CORE" -Wall -Wno-comment -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.1\" dbdimp.c
In file included from /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI/DBIXS.h:31,
from Oracle.h:13,
from dbdimp.c:20:
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI/dbipport.h:227:1: warning: "PERL_UNUSED_DECL" redefined
In file included from /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI/DBIXS.h:19,
from Oracle.h:13,
from dbdimp.c:20:
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/perl.h:163:1: warning: this is the location of the previous definition
dbdimp.c: In function `dbd_discon_all':
dbdimp.c:142: warning: unused variable `Perl___notused'
dbdimp.c: In function `ora_db_login6':
dbdimp.c:264: warning: unused variable `Perl___notused'
dbdimp.c: In function `ora_db_disconnect':
dbdimp.c:712: warning: unused variable `Perl___notused'
dbdimp.c: In function `ora_db_destroy':
dbdimp.c:749: warning: unused variable `my_perl'
dbdimp.c: In function `pp_exec_rset':
dbdimp.c:1218: warning: unused variable `Perl___notused'
dbdimp.c: In function `ora_st_execute':
dbdimp.c:1596: warning: unused variable `Perl___notused'
dbdimp.c: In function `ora_st_finish':
dbdimp.c:1803: warning: unused variable `Perl___notused'
dbdimp.c: In function `ora_st_destroy':
dbdimp.c:1895: warning: unused variable `my_perl'
gcc -c -I/usr/local/oracle/product/10.2.0/rdbms/public -I/usr/local/oracle/product/10.2.0/rdbms/demo -I/usr/local/oracle/product/10.2.0/rdbms/public -I/usr/local/oracle/product/10.2.0/plsql/publi
c -I/usr/local/oracle/product/10.2.0/network/public -I/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-st
atement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -DVERSION=\"1.17\" -DXS_VERSION=\"1.17\" -fPIC "-I/usr/l
ib/perl5/5.8.8/i386-linux-thread-multi/CORE" -Wall -Wno-comment -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.1\" oci8.c
In file included from /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI/DBIXS.h:31,
from Oracle.h:13,
from oci8.c:11:
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI/dbipport.h:227:1: warning: "PERL_UNUSED_DECL" redefined
In file included from /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI/DBIXS.h:19,
from Oracle.h:13,
from oci8.c:11:
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/perl.h:163:1: warning: this is the location of the previous definition
oci8.c: In function `fetch_cleanup_rset':
oci8.c:582: warning: unused variable `Perl___notused'
oci8.c: In function `fetch_func_rset':
oci8.c:606: warning: unused variable `Perl___notused'
oci8.c: In function `ora_st_fetch':
oci8.c:1550: warning: unused variable `Perl___notused'
oci8.c:1557: warning: unused variable `Perl___notused'
oci8.c: At top level:
oci8.c:563: warning: 'fetch_func_nty' defined but not used
Running Mkbootstrap for DBD::Oracle ()
chmod 644 Oracle.bs
rm -f blib/arch/auto/DBD/Oracle/Oracle.so
gcc -shared -L/usr/local/lib Oracle.o dbdimp.o oci8.o -L/usr/local/oracle/product/10.2.0/lib/ -L/usr/local/oracle/product/10.2.0/rdbms/lib/ -lclntsh `cat /usr/local/oracle/product/10.2.0/lib/
sysliblist` -ldl -lm -o blib/arch/auto/DBD/Oracle/Oracle.so \
\
chmod 755 blib/arch/auto/DBD/Oracle/Oracle.so
cp Oracle.bs blib/arch/auto/DBD/Oracle/Oracle.bs
chmod 644 blib/arch/auto/DBD/Oracle/Oracle.bs
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" ora_explain.PL ora_explain
Extracted ora_explain from ora_explain.PL with variable substitutions.
cp ora_explain blib/script/ora_explain
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/ora_explain
Manifying blib/man1/ora_explain.1
Manifying blib/man3/DBD::Oracle.3pm
Manifying blib/man3/DBD::Oraperl.3pm
After all that, there no other thing than install it:
[vms-dbserver DBD-Oracle-1.17]# make install
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/ocitrace.h
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/mk.pm
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/dbdimp.h
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.bs
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.h
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Oraperl.pm
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/oraperl.ph
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DBD/Oracle.pm
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DBD/Oracle/GetInfo.pm
Installing /usr/share/man/man1/ora_explain.1
Installing /usr/share/man/man3/DBD::Oracle.3pm
Installing /usr/share/man/man3/DBD::Oraperl.3pm
Installing /usr/bin/ora_explain
Writing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/.packlist
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
Test once again, if you get your prompt once again after executing it, without any spilled error messages, you are all done.
perl -e 'use DBD::Oracle'
0 Comments:
Post a Comment
<< Home