Get the App
SLTechnology News&Howtos  ›  Database  › 

Install DBD::Oracle, DBI and Ora2Pg under Linux

Shulou Source: shulou.com Published: 2022-06-01 14:47:22 10月04日 Update

Media download path:

DBI: http://www.cpan.org/modules/by-module/DBI/

DBD: http://www.cpan.org/modules/by-module/DBD/

Ora2Pg: https://sourceforge.net/projects/ora2pg/files/

Requirements: perl version 5.8 or above, perl-v view version

Use root users for installation

1. Install DBI

[root@rhel6 DBI-1.627] $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.7 20120313 (Red Hat 4.4.7-14)), 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

.

[root@rhel6 DBI-1.627] $make

/ usr/bin/perl-MExtUtils::Command-e 'mkpath'-- blib/lib/DBI

Rm-f blib/lib/DBI/Changes.pm

Cp Changes blib/lib/DBI/Changes.pm

Cp Driver_xst.h blib/arch/auto/DBI/Driver_xst.h

Cp lib/DBD/Proxy.pm blib/lib/DBD/Proxy.pm

Cp lib/DBI/Gofer/Response.pm blib/lib/DBI/Gofer/Response.pm

Cp lib/DBI/Util/_accessor.pm blib/lib/DBI/Util/_accessor.pm

Cp lib/DBI/Gofer/Transport/Base.pm blib/lib/DBI/Gofer/Transport/Base.pm

Cp lib/DBD/DBM.pm blib/lib/DBD/DBM.pm

Cp DBIXS.h blib/arch/auto/DBI/DBIXS.h

Cp dbixs_rev.pl blib/lib/dbixs_rev.pl

Cp lib/DBI/Gofer/Serializer/DataDumper.pm blib/lib/DBI/Gofer/Serializer/DataDumper.pm

Cp lib/DBI/Const/GetInfoType.pm blib/lib/DBI/Const/GetInfoType.pm

Cp lib/DBI/DBD/Metadata.pm blib/lib/DBI/DBD/Metadata.pm

Cp lib/DBD/Gofer/Transport/pipeone.pm blib/lib/DBD/Gofer/Transport/pipeone.pm

Cp lib/DBI/Const/GetInfo/ODBC.pm blib/lib/DBI/Const/GetInfo/ODBC.pm

Cp lib/DBI/ProfileDumper/Apache.pm blib/lib/DBI/ProfileDumper/Apache.pm

Cp lib/DBD/File/Roadmap.pod blib/lib/DBD/File/Roadmap.pod

.

[oracle@rhel6 DBI-1.627] $make test (optional)

PERL_DL_NONLAZY=1 / usr/bin/perl "- MExtUtils::Command::MM"-e "" test_harness (0, 'blib/lib',' blib/arch') "t _ Universe. T

T/01basics.t. Ok

T/02dbidrv.t. Ok

T/03handle.t. Ok

T/04mods.t.. Ok

T/05concathash.t. Ok

T/06attrs.t. Ok

T/07kids.t.. Ok

[root@rhel6 DBI-1.627] # make install

Files found in blib/arch: installing files in blib/lib into architecture dependent library tree

Installing / usr/local/lib64/perl5/auto/DBI/DBI.bs

Installing / usr/local/lib64/perl5/auto/DBI/dbixs_rev.h

Installing / usr/local/lib64/perl5/auto/DBI/dbivport.h

Installing / usr/local/lib64/perl5/auto/DBI/DBIXS.h

Installing / usr/local/lib64/perl5/auto/DBI/DBI.so

Installing / usr/local/lib64/perl5/auto/DBI/dbipport.h

Installing / usr/local/lib64/perl5/auto/DBI/dbi_sql.h

Installing / usr/local/lib64/perl5/auto/DBI/dbd_xsh.h

Installing / usr/local/lib64/perl5/auto/DBI/Driver_xst.h

Installing / usr/local/lib64/perl5/auto/DBI/Driver.xst

Installing / usr/local/lib64/perl5/dbixs_rev.pl

.

2. Install DBD:Oracle

Configure environment variables

Export ORACLE_BASE=/u02/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.4/db1

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

Installation

[root@rhel6 DBD-Oracle-1.74] # perl Makefile.PL

Multiple copies of Driver.xst found in: / usr/local/lib64/perl5/auto/DBI/ / usr/lib64/perl5/auto/DBI/ at Makefile.PL line 39

Using DBI 1.627 (for perl 5.010001 on x86_64-linux-thread-multi) installed in / usr/local/lib64/perl5/auto/DBI/

Configuring DBD::Oracle for perl 5.010001 on linux (x86_64-linux-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 / u02/app/oracle/product/11.2.4/db1

DEFINE _ SQLPLUS_RELEASE = "1102000400" (CHAR)

Oracle version 11.2.0.4 (11.2)

Found / u02/app/oracle/product/11.2.4/db1/rdbms/lib/ins_rdbms.mk

Using / u02/app/oracle/product/11.2.4/db1/rdbms/lib/ins_rdbms.mk

Your LD_LIBRARY_PATH env var is set to'/ u02Gap appActionoracleUniverse produce 11.2.4Uniplex db1OnLIBRAPR'

.

[root@rhel6 DBD-Oracle-1.74] # make

Cp lib/DBD/Oracle/Troubleshooting/Cygwin.pod blib/lib/DBD/Oracle/Troubleshooting/Cygwin.pod

Cp lib/DBD/Oracle.pm blib/lib/DBD/Oracle.pm

Cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h

Cp lib/DBD/Oracle/Troubleshooting/Hpux.pod blib/lib/DBD/Oracle/Troubleshooting/Hpux.pod

Cp lib/DBD/Oracle/Troubleshooting/Vms.pod blib/lib/DBD/Oracle/Troubleshooting/Vms.pod

Cp lib/DBD/Oracle/Troubleshooting/Linux.pod blib/lib/DBD/Oracle/Troubleshooting/Linux.pod

Cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm

Cp lib/DBD/Oracle/Troubleshooting.pod blib/lib/DBD/Oracle/Troubleshooting.pod

Cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h

Cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h

Cp lib/DBD/Oracle/Troubleshooting/Sun.pod blib/lib/DBD/Oracle/Troubleshooting/Sun.pod

Cp lib/DBD/Oracle/Troubleshooting/Macos.pod blib/lib/DBD/Oracle/Troubleshooting/Macos.pod

Cp lib/DBD/Oracle/Troubleshooting/Aix.pod blib/lib/DBD/Oracle/Troubleshooting/Aix.pod

Cp lib/DBD/Oracle/Object.pm blib/lib/DBD/Oracle/Object.pm

Cp lib/DBD/Oracle/Troubleshooting/Win64.pod blib/lib/DBD/Oracle/Troubleshooting/Win64.pod

Cp lib/DBD/Oracle/Troubleshooting/Win32.pod blib/lib/DBD/Oracle/Troubleshooting/Win32.pod

Cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm

.

[root@rhel6 DBD-Oracle-1.74] # make test (optional)

PERL_DL_NONLAZY=1 / usr/bin/perl "- MExtUtils::Command::MM"-e "" test_harness (0, 'blib/lib',' blib/arch') "t _ Universe. T

T/000-report-versions-tiny.t.. #

#

# Generated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10

# perl: 5.010001 (wanted 5.006) on linux from / usr/bin/perl

#

# B = > 1.22 (want any version)

# Carp = > 1.11 (want any version)

# DBI = > 1.627 (want 1.51)

.

[root@rhel6 DBD-Oracle-1.74] # make install

Files found in blib/arch: installing files in blib/lib into architecture dependent library tree

Installing / usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.h

Installing / usr/local/lib64/perl5/auto/DBD/Oracle/dbdimp.h

Installing / usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.bs

Installing / usr/local/lib64/perl5/auto/DBD/Oracle/mk.pm

Installing / usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so

Installing / usr/local/lib64/perl5/auto/DBD/Oracle/ocitrace.h

Installing / usr/local/lib64/perl5/DBD/Oracle.pm

Installing / usr/local/lib64/perl5/DBD/Oracle/GetInfo.pm

Installing / usr/local/lib64/perl5/DBD/Oracle/Object.pm

Installing / usr/local/lib64/perl5/DBD/Oracle/Troubleshooting.pod

Installing / usr/local/lib64/perl5/DBD/Oracle/Troubleshooting/Win64.pod

Installing / usr/local/lib64/perl5/DBD/Oracle/Troubleshooting/Sun.pod

Installing / usr/local/lib64/perl5/DBD/Oracle/Troubleshooting/Win32.pod

Installing / usr/local/lib64/perl5/DBD/Oracle/Troubleshooting/Hpux.pod

.

3. Check the script list.pl

[root@rhel6 ~] # cat list.pl #! / usr/bin/perluse strict;use ExtUtils::Installed;my $inst= ExtUtils::Installed- > new (); my @ modules = $inst- > modules (); foreach (@ modules) {my $ver = $inst- > version ($_) |?? "; printf ("%-12s -% s\ n ", $_, $ver);} exit [root@rhel6] # perl list.pl DBD::Oracle-- 1.74DBI-- 1.627Perl-- 5.10.1

DBD::Oracle and DBI installation complete

4. Install ora2pt

[root@rhel6 ora2pg-17.6] $perl Makefile.PL

Checking if your kit is complete...

Looks good

Writing Makefile for Ora2Pg

Done...

Please read documentation at http://ora2pg.darold.net/ before asking for help

Now type: make & & make install

[root@rhel6 ora2pg-17.6] # make & & make install

Installing / usr/local/share/perl5/Ora2Pg.pm

Installing / usr/local/share/perl5/Ora2Pg/PLSQL.pm

Installing / usr/local/share/perl5/Ora2Pg/MySQL.pm

Installing / usr/local/share/perl5/Ora2Pg/GEOM.pm

Installing / usr/local/share/man/man3/ora2pg.3

Installing / usr/local/bin/ora2pg

Installing / usr/local/bin/ora2pg_scanner

Installing default configuration file (ora2pg.conf.dist) to / etc/ora2pg

Appending installation info to / usr/lib64/perl5/perllocal.pod

Check, DBD::Oracle DBI Ora2Pg installation is complete

[root@rhel6 ~] # perl list.pl

DBD::Oracle-1.74

DBI-1.627

Ora2Pg-17.6b

Perl-5.10.1

Use Ora2Pg to import data from Oracle to PostgreSQL reference: http://hbxztc.blog.51cto.com/1587495/1880339

Reference documentation:

Http://www.askoracle.org/oracle/backup/1009.html

Http://blog.sina.com.cn/s/blog_a32eff280102vmpn.html

Tags: Version reference check media variables data documents environment users scripts paths configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MariaDB Shulou Tech Info Apple NVidia