Install DBI and DBD in Linux

Source: Internet
Author: User

Install DBI and DBD in Linux

1. Media download
Www.cpan.org open the home page of cpan, and then click search.cpan.org to search for DBI and DBD: Oracle
-Rw-r -- 1 oracle oinstall 592307 Apr 5 DBI-1.633.tar.gz
-Rw-r -- 1 oracle oinstall 452537 Apr 5 0DBD-Oracle-1.75_2.tar.gz
2. Install DBD: Oracle
[Root @ ora10g DBI-1.633] # perl Makefile. PL

* ** Your LANG environment variable is set to 'en _ US.UTF-8'
* ** This may cause problems for some perl installations.
* ** If you get test failures, please try again with LANG unset.
* ** If that then works, please email dbi-dev@perl.org with details
* ** Including the output of 'perl-V'

Your perl was compiled with gcc (version 4.4.6 20120305 (Red Hat 4.4.6-4), okay.
Creating test wrappers for DBD: Gofer:
T/zvg_01basics.t
T/zvg_02dbidrv.t
T/zvg_03handle.t
T/zvg_04mods.t
T/zvg_05concathash.t
T/zvg_06attrs.t
T/zvg_07kids.t
T/zvg_08keeperr.t
T/zvg_09trace.t
T/zvg_10examp.t
[Root @ ora10g DBI-1.633] # make
[Root @ ora10g DBI-1.633] # make test
Files = 182, Tests = 0, 5 wallclock secs (0.40 usr 0.40 sys + 2.67 cusr 0.75 csys = 4.22 CPU)
Result: FAIL
Failed 176/182 test programs. 0/0 subtests failed.
Make: *** [test_dynamic] Error 2
[Root @ ora10g DBI-1.633] # make install
[Root @ ora10g perl_script] # chmod u + x list. pl
[Root @ ora10g perl_script] #./list. pl
DBI -- 1, 1.633
Perl -- 5.10.1
It indicates that DBI has been installed.
3. download and install the relevant oracle software package
: Http://www.oracle.com/technetwork/topics/linuxsoft-082809.html
Because my Oracle version is 10.2.0.5, download the 10205 client package
-Rw-r -- 1 oracle oinstall 745257 Apr 9 oracle-instantclient-sqlplus-10.2.0.5-1.i386.rpm
-Rw-r -- 1 oracle oinstall 32883472 Apr 9 oracle-instantclient-basic-10.2.0.5-1.i386.rpm
-Rw-r -- 1 oracle oinstall 289726 Apr 9 oracle-instantclient-devel-10.2.0.5-1.i386.rpm
[Root @ ora10g opt] # rpm-ivh oracle-instantclient-basic-10.2.0.5-1.i386.rpm
Preparing... ######################################## ### [100%]
1: oracle-instantclient-ba ################################### ####### [1, 100%]
[Root @ ora10g opt] # rpm-ivh oracle-instantclient-devel-10.2.0.5-1.i386.rpm
Preparing... ######################################## ### [100%]
1: oracle-instantclient-de ################################### ####### [1, 100%]
[Root @ ora10g opt] # rpm-ivh oracle-instantclient-sqlplus-10.2.0.5-1.i386.rpm
Preparing... ######################################## ### [100%]
1: oracle-instantclient-sq ################################### ####### [1, 100%]
4. Install DBD-Oracle
-- Disable listeners and databases
[Root @ ora10g DBD-Oracle-1.75_2] # export ORACLE_HOME =/u01/oracle/product/10.2.0/db_1
[Root @ ora10g DBD-Oracle-1.75_2] # export LD_LIBRARY_PATH =/u01/oracle/product/10.2.0/db_1/lib:/usr/local/lib
[Root @ ora10g DBD-Oracle-1.75_2] # perl Makefile. PL
Using DBI 1.633 (for perl 5.010001 on i386-linux-thread-multi) installed in/usr/local/lib/perl5/auto/DBI/
Processing ing DBD: Oracle for perl 5.010001 on linux (i386-linux-thread-multi)

If you encounter any problem, a collection of troubleshooting
Guides are available under lib/DBD/Oracle/Troubleshooting.
'Dbd: Oracle: Troubleshooting 'is the general troubleshooting
Guide, while platform-specific troubleshooting hints
Live in their labeled sub-document (e.g., Win32
Hints are gathered in 'lib/DBD/Oracle/Troubleshooting/Win32.pod ').

Installing on a linux, Ver #2.6
Using Oracle in/u01/oracle/product/10.2.0/db_1
DEFINE _ SQLPLUS_RELEASE = "1002000500" (CHAR)
Oracle version 10.2.0.5 (10.2)
Found direct-link candidates: libclntsh. so
Oracle sysliblist:-ldl-lm-lpthread-lnsl-lirc
Found header files in/u01/oracle/product/10.2.0/db_1/rdbms/public.
Your LD_LIBRARY_PATH env var is set to '/u01/oracle/product/10.2.0/db_1/lib:/usr/local/lib'

Client Version = 10.2


DEFINE =-Wall-Wno-comment-DUTF8_SUPPORT-DORA_OCI_VERSION = \ "10.2.0.5 \"-DORA_OCI_102


Checking for functioning wait. ph


System: perl5.010001 linux x86-022.build.eng.bos.RedHat.com 2.6.18-308.16.1.el5 #1 smp tue sep 18 07:21:07 edt 2012 i686 i686 i386 gnulinux
Compiler: gcc-O2-g-pipe-Wall-Wp, -D_FORTIFY_SOURCE = 2-fexceptions-fstack-protector -- param = ssp-buffer-size = 4-m32-march = i686-mtune = atom-fasynchronous-unwind-tables-D_REENTRANT-D_GNU_SOURCE -fno-strict-aliasing-pipe-fstack-protector-I/usr/local/include-D_LARGEFILE_SOURCE-D_FILE_OFFSET_BITS = 64
Linker:/usr/bin/ld
Sysliblist:-ldl-lm-lpthread-lnsl-lirc
Linking with-lclntsh.

Checking if your kit is complete...
Looks good
LD_RUN_PATH =/u01/oracle/product/10.2.0/db_1/lib
Using DBD: Oracle 1.75 _ 2.
Using DBD: Oracle 1.75 _ 2.
Using DBI 1.633 (for perl 5.010001 on i386-linux-thread-multi) installed in/usr/local/lib/perl5/auto/DBI/
Writing Makefile for DBD: Oracle
[Root @ ora10g DBD-Oracle-1.75_2] # make
[Root @ ora10g DBD-Oracle-1.75_2] # make test
Result: FAIL
Failed 38/38 test programs. 0/0 subtests failed.

Make: *** [test_dynamic] Error 2
[Root @ ora10g DBD-Oracle-1.75_2] # make install
[Root @ ora10g ~] # Cd perl_script/
[Root @ ora10g perl_script] # cat list. pl
#! /Usr/bin/perl
Use strict;
Use ExtUtils: Installed;
My $ inst = ExtUtils: Installed-> new ();
My @ modules = $ inst-> modules ();
Foreach (@ modules)
{
My $ ver = $ inst-> version ($ _) | "??? ";
Printf ("%-12 s -- % s \ n", $ _, $ ver );
}
Exit;
[Root @ ora10g perl_script] #./list. pl
DBD: Oracle -- 1.75 _ 2
DBI -- 1, 1.633
Perl -- 5.10.1
It indicates that DBI and DBD have been installed.

Install DBD in Oracle11g
1. Install the linux_11gR2_examples Software Package
2. Set Environment Variables
3. Install DBD: Oracle
4. Check Installation

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.