04.01. Software Installation & Configuration on Management Server [app-ora2pg]


01.01. Download and install Oracle 19C Client. 
# download the rpm packages from:
https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/
[app-ora2pg]
yum -y install /tmp/oracle-instantclient19.18-basic-19.18.0.0.0-1.x86_64.rpm
yum -y install /tmp/oracle-instantclient19.18-devel-19.18.0.0.0-1.x86_64.rpm
yum -y install /tmp/oracle-instantclient19.18-jdbc-19.18.0.0.0-1.x86_64.rpm
yum -y install /tmp/oracle-instantclient19.18-sqlplus-19.18.0.0.0-1.x86_64.rpm

01.02. Install PostgreSQL 14 client
[app-ora2pg] 
# dnf -y install postgresql14.x86_64

01.03. Download and install required Perl packages. 
# DBI
[app-ora2pg] 
# cd /tmp
# wget https://www.cpan.org/modules/by-module/DBI/DBI-1.643.tar.gz
# tar -xvzf DBI-1.643.tar.gz
# cd DBI-1.643
# perl Makefile.PL
# make
# make install
# DBD::Oracle
[app-ora2pg] 
# cd /tmp
# wget https://cpan.metacpan.org/authors/id/Z/ZA/ZARQUON/DBD-Oracle-1.83.tar.gz
# tar -xvzf DBD-Oracle-1.83.tar.gz
# cd ./DBD-Oracle-1.83
# perl Makefile.PL
# make
# make install

01.04. Download and install ora2pg.
[app-ora2pg] 
# cd /tmp
# wget https://sourceforge.net/projects/ora2pg/files/23.2/ora2pg-23.2.tar.bz2
# tar -xf ora2pg-23.2.tar.bz2
# cd ./ora2pg-23.2
# perl Makefile.PL
# make && make install

01.05. Configuration ora2pg.
[app-ora2pg] 
# cd /tmp/ora2pg-23.2/
# mkdir -p /tmp/instance1/ora2pg
# ora2pg --project_base /tmp/instance1/ora2pg --init_project migr01

01.06. Modify ora2pg.conf, we will only set connectivity and schema info:
[app-ora2pg] # vi /tmp/instance1/ora2pg/migr01/config/ora2pg.conf
# Set Oracle database connection (datasource, user, password)
ORACLE_DSN      dbi:Oracle:host=ora-db-quik;sid=db01;port=1521
ORACLE_USER     system
ORACLE_PWD      **********
# Oracle schema/owner to use
SCHEMA STOCK

01.07. Test configuration:
[app-ora2pg] 
# cd /tmp/instance1/ora2pg/migr01/
# ora2pg -t SHOW_VERSION -c config/ora2pg.conf


01.08. Modify ora2pg.conf (change the file if needed):
[app-ora2pg] # vi /tmp/instance1/ora2pg/migr01/config/ora2pg.conf
# TYPE TABLE
# ALLOW
This directive allows you to set a list of tables on which the export must be limited, excluding all other objects in the same type of export. The value is a space or comma-separated list of objects name to export. You can include valid regex into the list. For example:
ALLOW           BONDS*, *QUOTES
will export all tables beginning with 'BONDS' and all objects with a name ending by 'QUOTES'.  
# WHERE
This directive allows you to specify a WHERE clause filter when dumping the contents of tables. Value is constructs as follows: TABLE_NAME[WHERE_CLAUSE], or if you have only one where clause for each table just put the where clause as the value. Both are possible too. Here are some examples:
        # Applies two different clause on tables TABLE_NAME and OTHER_TABLE
        # and a generic where clause on DATE_CREATE to all other tables
        WHERE TABLE_NAME[ID>1000] DATE_CREATE > '2001-01-01'

                                                   <<< Back   Next >>>