本文介绍ora2pg迁移到pg12的用法
ora2pg官网:Ora2Pg:将 Oracle 迁移到 PostgreSQL (darold.net)
1、安装oracle
oracle11g
2、安装pg12
pg12
3、安装perl
官网:DBI-1.643 - Database independent interface for Perl - metacpan.org
DBI,Database Independent Interface,是Perl语言连接数据库的接口
yum install -y perl perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
cd /root
wget https://cpan.metacpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz
tar -xvf DBI-1.643.tar.gz
cd DBI-1.643
perl Makefile.PL
make
make install
4、安装DBD::Pg模块
DBD-Pg-3.18.0 - DBI PostgreSQL interface - metacpan.org
The usual steps to install DBD::Pg:
-
perl Makefile.PL
-
make
-
make test
-
make install
Do steps 1 to 2 as a normal user, not as root!
cd /opt
wget https://cpan.metacpan.org/authors/id/T/TU/TURNSTEP/DBD-Pg-3.18.0.tar.gz
tar -xvf DBD-Pg-3.18.0.tar.gz
#授权给非root用户
chown pg127:pg127 DBD-Pg-3.18.0 -R
cd DBD-Pg-3.18.0
export POSTGRES_INCLUDE="/usr/local/pg127/include"
export POSTGRES_LIB="/usr/local/pg127/lib"
perl Makefile.PL
make
#切换到root
su - root
cd /opt/DBD-Pg-3.18.0
make install
5、安装DBD::Oracle模块
DBD::Oracle - Oracle database driver for the DBI module - metacpan.org
cd /opt
wget https://cpan.metacpan.org/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz
tar -xvf DBD-Oracle-1.74.tar.gz
cd DBD-Oracle-1.74/
6、安装ora2pg
cd /opt
wget https://sourceforge.net/projects/ora2pg/files/24.3/ora2pg-24.3.tar.gz/download
tar -xvf download
cd ora2pg-24.3/
perl Makefile.PL
make
make install