guy-incognito / ora2pg Goto Github PK
View Code? Open in Web Editor NEWDockerfile for ora2pg Oracle to PostgreSQL migration tool
Dockerfile for ora2pg Oracle to PostgreSQL migration tool
Hello, I have had the next error when I try to run the image:
install_driver(oracle) failed: Can't locate DBD/oracle.pm in @INC (you may need to install the DBD::oracle module) (@INC contains: /usr/local/lib/perl5/site_perl/5.28.1/x86_64-linux-gnu /usr/local/lib/perl5/site_perl/5.28.1 /usr/local/lib/perl5/vendor_perl/5.28.1/x86_64-linux-gnu /usr/local/lib/perl5/vendor_perl/5.28.1 /usr/local/lib/perl5/5.28.1/x86_64-linux-gnu /usr/local/lib/perl5/5.28.1) at (eval 15) line 3. Perhaps the DBD::oracle perl module hasn't been fully installed, or perhaps the capitalisation of 'oracle' isn't right. Available drivers: DBM, ExampleP, File, Gofer, Mem, Oracle, Proxy, Sponge. at /usr/local/lib/perl5/site_perl/5.28.1/Ora2Pg.pm line 1624.
Thanks.
#docker build -t ora2pg --platform linux/amd64 .
executor failed running [/bin/sh -c cpan install Test::NoWarnings && cpan install DBI && cpan install DBD::Pg && cpan install Bundle::Compress::Zlib && cpan install CPAN::DistnameInfo && cpanm install IPC::Run && cpanm install DBD::[email protected]]: exit code: 1
# Install DBI module with Postgres, Oracle and Compress::Zlib module RUN cpan install Test::NoWarnings &&\ cpan install DBI &&\ cpan install DBD::Pg &&\ cpan install Bundle::Compress::Zlib &&\ cpan install CPAN::DistnameInfo &&\ cpanm install IPC::Run &&\ cpanm install DBD::[email protected]
As v23 is not released on Docker Hub (is there a particular reason for this?), I'm trying to build it on my own, I've used the command:
docker build https://github.com/Guy-Incognito/ora2pg.git#23.0 -t ora2pg:23
If I try to use the resulting image it says:
install_driver(Oracle) failed: Can't locate DBD/Oracle.pm in @INC (you may need to install the DBD::Oracle module) (@INC contains: /usr/local/lib/perl5/site_perl/5.34.0/x86_64-linux-gnu /usr/local/lib/perl5/site_perl/5.34.0 /usr/local/lib/perl5/vendor_perl/5.34.0/x86_64-linux-gnu /usr/local/lib/perl5/vendor_perl/5.34.0 /usr/local/lib/perl5/5.34.0/x86_64-linux-gnu /usr/local/lib/perl5/5.34.0) at (eval 13) line 3.
Perhaps the DBD::Oracle perl module hasn't been fully installed,
or perhaps the capitalisation of 'Oracle' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Mem, Pg, Proxy, Sponge.
at /usr/local/lib/perl5/site_perl/5.34.0/Ora2Pg.pm line 1901.
I'm not a Perl expert so sadly I have no idea where this goes sideways. Attaching the whole build log. ora2pg23_build.log
If you could publish a working image to Docker Hub that would be great help as well.
@Guy-Incognito, this is not really and issue. I couldn't figure out another way to make contact. I'm using georgmoser/ora2pg as a base image in a project that delivers a UI for Ora2Pg: https://hub.docker.com/r/visulate/visulate-ora2pg.
I thought you might be interested. Comments and suggestions welcome.
Peter
Hi,
I have created the image successfully but when I try to run the image, the container is not coming up
can you please help in this?
docker run d_ora2pg:v2
Loading DB routines from perl5db.pl version 1.60
Editor support available.
Enter h or 'h h' for help, or 'man perldebug' for more help.
main::(-e:1): 0
DB<1>
Below is Docker file:
FROM perl:slim
ARG ORA2PG_VERSION=23.0
RUN mkdir -p /usr/share/man/man1 &&
mkdir -p /usr/share/man/man7
RUN apt-get update && apt-get install -y -q --no-install-recommends
unzip
curl
ca-certificates
rpm
alien
libaio1
# Install postgresql
postgresql-client
# Install mysql
libdbd-mysql
#install Perl Database Interface
libdbi-perl
bzip2
libpq-dev
libdbd-pg-perl
ENV ORACLE_HOME=/usr/lib/oracle/12.2/client64
ENV TNS_ADMIN=/usr/lib/oracle/12.2/client64/network/admin
ENV LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib
ENV PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/oracle/12.2/client64/bin
RUN mkdir /usr/lib/oracle/12.2/client64/network/admin -p
COPY oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm /tmp
COPY oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm /tmp
COPY oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm /tmp
RUN alien -i /tmp/oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm &&
alien -i /tmp/oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm &&
alien -i /tmp/oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm
COPY DBD-Oracle-1.74.tar.gz /tmp
COPY v23.0.zip /tmp
RUN perl -MCPAN -e 'install DBD::Oracle' &&
perl -MCPAN -e 'install DBI' &&
perl -MCPAN -e 'install DBD::Pg' &&
perl -MCPAN -e 'install DBD::Oracle' &&
perl -MCPAN -e 'install Bundle::Compress::Zlib'
#RUN cd /tmp && tar -zxvf /tmp/DBD-Oracle-1.74.tar.gz &&
#cd /tmp/DBD-Oracle-1.74 && perl Makefile.PL -l && make && make install
RUN cd /tmp && unzip v23.0.zip && rm -f v23.0.zip &&
mv /tmp/ora2pg* /tmp/ora2pg &&
(cd /tmp/ora2pg && perl Makefile.PL && make && make install)
RUN mkdir /sql
RUN mkdir /zip
RUN mkdir /tmp/generated_ddl
# prepare config
ENV HOST=host
ENV PORT=port
ENV SERVICE_NAME=service_name
ENV USER=user
ENV PASSWORD=password
ENV SCHEMA=schema
Would be nice to get MySQL support into the image, too.
Thanks you for this project.
i use win10+vbox+boot2docker.iso
when i build, get a error in step 6:
docker@default:~$ docker build . -t ora2pg
Sending build context to Docker daemon 20.48kB
Step 1/23 : FROM perl:slim
---> 327e48466da5
Step 2/23 : ARG ORA2PG_VERSION=19.0
---> Using cache
---> 66f5dc3d44f4
Step 3/23 : RUN mkdir -p /usr/share/man/man1 && mkdir -p /usr/share/man/man7
---> Using cache
---> 73a3935d2563
Step 4/23 : RUN apt update && apt install -y unzip rpm alien libaio1 postgresql-client libdbi-perl bzip2
---> Using cache
---> 7d2bbb8bf8ca
Step 5/23 : RUN curl -L -o /tmp/ora2pg.zip https://github.com/darold/ora2pg/archive/v$ORA2PG_VERSION.zip && (cd /tmp && unzip ora2pg.zip && rm -f ora2pg.zip) && mv /tmp/ora2pg* /tmp/ora2pg && (cd /tmp/ora2pg && perl Makefile.PL && make && make install)
---> Using cache
---> 0b121a6e1b3a
Step 6/23 : ADD /assets /assets
ADD failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builder457884445/assets: no such file or directory
Tried following the steps and run the docker on local, having oracle DB connected on Docker and used the credentials of docker in ora2pg.config. Oracle is up and when Im trying to setup ORA2PG getting TNS issue. (FATAL: 12541 ... ORA-12541: TNS:no listener (DBD ERROR: OCIServerAttach)) Tried multiple means modified TNS file made it appropriative nothing seems to be working. Oracle connection is in a good condition.
If Oracle, Postgresql and ora2pg are all in their own stack docker containers, ora2pg couldnt identify the path to translate the Oracle DBI connection or if in the normal scenario is the tnsnames.ora. Entering the tnsnames.ora at oracleclient/network/admin path within the ora2pg docker also doesnt resolve the solution. The db however is reachable from any sqlclient like dbeaver from the host PC
Trying to connect to database: dbi:Oracle:host=localhost;sid=orcl;port=1521
DBI connect('host=localhost;sid=orcl;port=1521','mydb',...) failed: ORA-12541: TNS:no listener (DBD ERROR: OCIServerAttach) at /usr/local/lib/perl5/site_perl/5.32.0/Ora2Pg.pm line 1624.
FATAL: 12541 ... ORA-12541: TNS:no listener (DBD ERROR: OCIServerAttach)
Hi
Please update Docker to use ora2pg v22.1
the ora2pg.conf file you provided is not consistent with the conf file generated by ora2pg in the Make script. There are a few differences between what you provide(and it's available in the docker container) and what is in the current version of ora2pg.
It would be great if it could be updated as it gets build.
With oracle 12g and PostgreSQL 11
The export of data works fine but :
When trying to do a direct COPY from oracle to postgreSQL, a have the following error :
install_driver(Pg) failed: Can't locate DBD/Pg.pm in @INC (you may need to install the DBD::Pg module) (@INC contains: /usr/local/lib/perl5/site_perl/5.28.1/x86_64-linux-gnu /usr/local/lib/perl5/site_perl/5.28.1 /usr/local/lib/perl5/vendor_perl/5.28.1/x86_64-linux-gnu /usr/local/lib/perl5/vendor_perl/5.28.1 /usr/local/lib/perl5/5.28.1/x86_64-linux-gnu /usr/local/lib/perl5/5.28.1) at (eval 17) line 3.
Perhaps the DBD::Pg perl module hasn't been fully installed,
or perhaps the capitalisation of 'Pg' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Mem, Oracle, Proxy, Sponge.
at /usr/local/lib/perl5/site_perl/5.28.1/Ora2Pg.pm line 1854.
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::Oracle::db handle (DESCRIPTION=(ADDRESS=(HOST=192.168.0.103)(PROTOCOL=tcp)(PORT=1521))(CONNECT_DATA=(SID=UATKPIBX))) at /usr/local/lib/perl5/5.28.1/Carp.pm line 291.
The solution is to add a library libpq-dev in the Dockerfile like this :
RUN apt update && apt install -y unzip rpm alien \
libaio1 \
# Install postgresql
postgresql-client \
#install Perl Database Interface
libdbi-perl \
bzip2 \
libpq-dev
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.