Skip to main content

Data Migration from Oracle to Klustron

KlustronAbout 9 min

Data Migration from Oracle to Klustron

Note:

Unless specified otherwise, version numbers mentioned in this document can be replaced with version numbers of any released version. For all released versions, refer to Release Notes.

Objective:

The main content of this document is the use of the ora2pg tool to migrate Oracle tables and data to Klustron. The source Oracle database and target Klustron should already be installed and deployed in the environment. This document primarily covers how to install and deploy ora2pg on both the source and target sides, as well as how to configure ora2pg to migrate Oracle tables and data to Klustron.

1 Installing and Deploying ora2pg

1.1 Deployment Plan.

**Source:**Oracle**Target:**Klustron
**IP:**192.168.56.104IP:
Computing Node192.168.56.112
Storage Nodes192.168.56.113,192.168.56.114
**ora2pg Software:**ora2pg for Oracle
**ora2pg Software:**ora2pg for PostgreSQL
**Install ora2pg as OS user:**root
**ora2pg Download Link:**https://sourceforge.net/projects/ora2pg/

1.2 Configure environment variables for the root user on the source system, setting ORACLE_HOME, PATH, and LD_LIBRARY_PATH environment variables. [Oracle]

[root@db19c ~]# more ~/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=/usr/local/mysql/bin:$PATH:$HOME/bin

export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/db_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
export LD_LIBRARY_PATH=$ORACLE_BASE/product/19.0.0/db_1/lib

1.3 Create a /root/ora2pg directory on the source system to store all the software needed for ora2pg. [Oracle]

[root@db19c ~]# mkdir /root/ora2pg
[root@db19c ~]# cd /root/ora2pg

1.4 Install the required driver packages for ora2pg on the source system. [Oracle]

[root@ db19c ora2pg]# yum install -y perf cpan

1.5 Install the required DBI module for ora2pg on the source system. [Oracle]

[root@ db19c ora2pg]# wget http://www.cpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz
[root@ db19c ora2pg]# tar -zxvf DBI-1.643.tar.gz
[root@ db19c ora2pg]# cd DBI-1.643
[root@ db19c ora2pg]# perl Makefile.PL
[root@ db19c ora2pg]# make && make install

1.6 Install the required DBD::Oracle module for ora2pg on the source system. [Oracle]

[root@db19c ~]# cd /root/ora2pg
[root@ db19c ora2pg]# wget http://www.cpan.org/authors/id/M/MJ/MJEVANS/DBD-Oracle-1.80.tar.gz
[root@ db19c ora2pg]# tar -zxvf DBD-Oracle-1.80.tar.gz
[root@ db19c ora2pg]# cd DBD-Oracle-1.80
[root@ db19c ora2pg]# perl Makefile.PL
[root@ db19c ora2pg]# make -j 8 && make install

1.7 Install the required DBD::PG module for ora2pg on the source system. [Oracle]

[root@db19c ~]# cd /root/ora2pg
[root@ db19c ora2pg]# yum install postgresql-devel -y
[root@ db19c ora2pg]# wget http://www.cpan.org/authors/id/T/TU/TURNSTEP/DBD-Pg-3.14.2.tar.gz
[root@ db19c ora2pg]# tar -zxvf DBD-Pg-3.14.2.tar.gz
[root@ db19c ora2pg]# cd DBD-Pg-3.14.2
[root@ db19c ora2pg]# perl Makefile.PL
[root@ db19c ora2pg]# make -j 8 && make install

1.8 Install the ora2pg software module on the source system. [Oracle]

[root@db19c ~]# cd /root/ora2pg
[root@ db19c ora2pg]# wget https://sourceforge.net/projects/ora2pg/files/23.2/ora2pg-23.2.tar.bz2 --no-check-certificate
[root@ db19c ora2pg]# tar xjf ora2pg-23.2.tar.bz2
[root@ db19c ora2pg]# cd ora2pg-23.2/
[root@ db19c ora2pg]# perl Makefile.PL
[root@ db19c ora2pg]# make && make install

1.9 Check that all required software is installed. [Oracle]

[root@db19c ora2pg]# cat > /root/check.pl <<"EOF"
#!/usr/bin/perl
use 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;
EOF



[root@db19c ora2pg]# perl /root/check.pl
DBD::Oracle  -- 1.80
DBD::Pg      -- 3.14.2
DBI          -- 1.643
Ora2Pg       -- 23.2
Perl         -- 5.16.

2 Database Preparation

2.1 Create a database user on the source Oracle database. [Oracle]

[oracle@db19c ~]$ sqlplus / as sysdba
SQL> create user kunlun_test identified by kunlun;
SQL> grant dba to kunlun_test;

2.2 Log in to the source database using the kunlun_test user and create tables. [Oracle]

[oracle@db19c ~]$ sqlplus kunlun_test/kunlun
SQL> CREATE TABLE categories (
  categories_id number(11) NOT NULL,
  categories_image varchar2(64),
  parent_id number(11) NOT NULL,
  sort_order number(3),
  date_added timestamp,
  last_modified timestamp,
  PRIMARY KEY (categories_id)
  using index
);

SQL> CREATE TABLE categories_description (
  categories_id number(11) NOT NULL,
  language_id number(11) NOT NULL,
  categories_name varchar2(32) NOT NULL,
  PRIMARY KEY (categories_id,language_id)
  using index
);

SQL> CREATE TABLE products (
  products_id number(11) NOT NULL,
  products_quantity number(4) NOT NULL,
  products_model varchar2(12),
  products_image varchar2(64),
  products_price number(15,4) NOT NULL,
  products_date_added timestamp NOT NULL,
  products_last_modified timestamp,
  products_date_available timestamp,
  products_weight number(5,2) NOT NULL,
  products_status number(1) NOT NULL,
  products_tax_class_id number(11) NOT NULL,
  manufacturers_id number(11),
  products_ordered number(11) NOT NULL,
  PRIMARY KEY (products_id)
  using index
);

2.3 Insert data into the three tables created by the kunlun_test user in the source database. [Oracle]

a) Insert data into the categories table.

INSERT INTO categories VALUES (1,'category_hardware.gif',0,1,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (2,'category_software.gif',0,2,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (3,'category_dvd_movies.gif',0,3,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (4,'subcategory_graphic_cards.gif',1,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (5,'subcategory_printers.gif',1,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (6,'subcategory_monitors.gif',1,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (7,'subcategory_speakers.gif',1,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (8,'subcategory_keyboards.gif',1,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (9,'subcategory_mice.gif',1,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (10,'subcategory_action.gif',3,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (11,'subcategory_science_fiction.gif',3,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (12,'subcategory_comedy.gif',3,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (13,'subcategory_cartoons.gif',3,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (14,'subcategory_thriller.gif',3,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (15,'subcategory_drama.gif',3,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (16,'subcategory_memory.gif',1,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (17,'subcategory_cdrom_drives.gif',1,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (18,'subcategory_simulation.gif',2,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (19,'subcategory_action_games.gif',2,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (20,'subcategory_strategy.gif',2,0,timestamp'2023-04-04 08:31:00',NULL); 
INSERT INTO categories VALUES (21,'category_gadgets.png',0,4,timestamp'2023-04-04 08:31:00',NULL);
COMMIT;

b) Insert data into the categories_description table.

INSERT INTO categories_description VALUES (1,1,'Hardware');
INSERT INTO categories_description VALUES (2,1,'Software');
INSERT INTO categories_description VALUES (3,1,'DVD Movies');
INSERT INTO categories_description VALUES (4,1,'Graphics Cards');
INSERT INTO categories_description VALUES (5,1,'Printers');
INSERT INTO categories_description VALUES (6,1,'Monitors');
INSERT INTO categories_description VALUES (7,1,'Speakers');
INSERT INTO categories_description VALUES (8,1,'Keyboards');
INSERT INTO categories_description VALUES (9,1,'Mice');
INSERT INTO categories_description VALUES (10,1,'Action');
INSERT INTO categories_description VALUES (11,1,'Science Fiction');
INSERT INTO categories_description VALUES (12,1,'Comedy');
INSERT INTO categories_description VALUES (13,1,'Cartoons');
INSERT INTO categories_description VALUES (14,1,'Thriller');
INSERT INTO categories_description VALUES (15,1,'Drama');
INSERT INTO categories_description VALUES (16,1,'Memory');
INSERT INTO categories_description VALUES (17,1,'CDROM Drives');
INSERT INTO categories_description VALUES (18,1,'Simulation');
INSERT INTO categories_description VALUES (19,1,'Action');
INSERT INTO categories_description VALUES (20,1,'Strategy');
INSERT INTO categories_description VALUES (21,1,'Gadgets');
COMMIT;

c) Insert data into the products table.

INSERT INTO products VALUES (1,32,'MG200MMS','matrox/mg200mms.gif','299.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'23.00',1,1,1,0); 
INSERT INTO products VALUES (2,32,'MG400-32MB','matrox/mg400-32mb.gif','499.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'23.00',1,1,1,0); 
INSERT INTO products VALUES (3,2,'MSIMPRO','microsoft/msimpro.gif','49.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,3,0); 
INSERT INTO products VALUES (4,13,'DVD-RPMK','dvd/replacement_killers.gif','42.0000',timestamp'2023-04-04 08:31:00',NULL,NULL,'23.00',1,1,2,0); 
INSERT INTO products VALUES (5,17,'DVD-BLDRNDC','dvd/blade_runner.gif','35.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,3,0); 
INSERT INTO products VALUES (6,10,'DVD-MATR','dvd/the_matrix.gif','39.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,3,0); 
INSERT INTO products VALUES (7,10,'DVD-YGEM','dvd/youve_got_mail.gif','34.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,3,0); 
INSERT INTO products VALUES (8,10,'DVD-ABUG','dvd/a_bugs_life.gif','35.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,3,0); 
INSERT INTO products VALUES (9,10,'DVD-UNSG','dvd/under_siege.gif','29.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,3,0); 
INSERT INTO products VALUES (10,10,'DVD-UNSG2','dvd/under_siege2.gif','29.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,3,0); 
INSERT INTO products VALUES (11,10,'DVD-FDBL','dvd/fire_down_below.gif','29.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,3,0); 
INSERT INTO products VALUES (12,10,'DVD-DHWV','dvd/die_hard_3.gif','39.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,4,0); 
INSERT INTO products VALUES (13,10,'DVD-LTWP','dvd/lethal_weapon.gif','34.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,3,0); 
INSERT INTO products VALUES (14,10,'DVD-REDC','dvd/red_corner.gif','32.0000',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,3,0); 
INSERT INTO products VALUES (15,10,'DVD-FRAN','dvd/frantic.gif','35.0000',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,3,0); 
INSERT INTO products VALUES (16,10,'DVD-CUFI','dvd/courage_under_fire.gif','38.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,4,0); 
INSERT INTO products VALUES (17,10,'DVD-SPEED','dvd/speed.gif','39.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,4,0); 
INSERT INTO products VALUES (18,10,'DVD-SPEED2','dvd/speed_2.gif','42.0000',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,4,0); 
INSERT INTO products VALUES (19,10,'DVD-TSAB','dvd/theres_something_about_mary.gif','49.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,4,0); 
INSERT INTO products VALUES (20,10,'DVD-BELOVED','dvd/beloved.gif','54.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,3,0); 
INSERT INTO products VALUES (21,16,'PC-SWAT3','sierra/swat_3.gif','79.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,7,0); 
INSERT INTO products VALUES (22,13,'PC-UNTM','gt_interactive/unreal_tournament.gif','89.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'7.00',1,1,8,0); 
INSERT INTO products VALUES (23,16,'PC-TWOF','gt_interactive/wheel_of_time.gif','99.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'10.00',1,1,8,0); 
INSERT INTO products VALUES (24,17,'PC-DISC','gt_interactive/disciples.gif','90.0000',timestamp'2023-04-04 08:31:00',NULL,NULL,'8.00',1,1,8,0); 
INSERT INTO products VALUES (25,16,'MSINTKB','microsoft/intkeyboardps2.gif','69.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'8.00',1,1,2,0); 
INSERT INTO products VALUES (26,10,'MSIMEXP','microsoft/imexplorer.gif','64.9500',timestamp'2023-04-04 08:31:00',NULL,NULL,'8.00',1,1,2,0); 
INSERT INTO products VALUES (27,7,'HPLJ1100XI','hewlett_packard/lj1100xi.gif','499.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'45.00',1,1,9,1); 
INSERT INTO products VALUES (28,100,'GT-P1000','samsung/galaxy_tab.gif','749.9900',timestamp'2023-04-04 08:31:00',NULL,NULL,'1.00',1,1,10,0);
COMMIT;

2.4 Create a database and a database user in the Klustron target system. [Klustron]

a) Log in to the database.

psql -h 192.168.56.112 -p 47001 postgres

b) Create the user kunlun_test.

create user kunlun_test with password 'kunlun';

c) Create a database.

create database testdb owner kunlun_test;

d) Grant privileges to the user.

grant all privileges on database testdb to kunlun_test;

e) Exit the psql command line and reconnect to the testdb database using kunlun_test.

psql -h 192.168.56.112 -p 47001 -U kunlun_test testdb

3 Migrating Data Using ora2pg

3.1 Set up the ora2pg configuration file on the source database server, configure the file for exporting table structures, and add the following content. [Oracle]

[root@db19c ora2pg]#
[root@db19c ora2pg]# pwd
/etc/ora2pg
[root@db19c ora2pg]# vi ora2pg_kunlun_test_table_ddl.conf

ORACLE_HOME     /u01/app/oracle/product/19.0.0/db_1
ORACLE_DSN      dbi:Oracle:host=192.168.56.104;sid=orcl;port=1521
ORACLE_USER     system
ORACLE_PWD      oracle
SCHEMA          kunlun_test
EXPORT_SCHEMA   1
CREATE_SCHEMA   0
TYPE            TABLE
PG_NUMERIC_TYPE 0
PG_INTEGER_TYPE 1
DEFAULT_NUMERIC bigint
SKIP fkeys checks
NLS_LANG                AMERICAN_AMERICA.UTF8
OUTPUT_DIR              /tmp
OUTPUT                  ora2pg_kunlun_test_table_ddl.sql
PG_VERSION              11
PG_SCHEMA       kunlun_test

3.2 Generate a script for creating table DDL statements (PostgreSQL table creation script) for the kunlun_test user on the source database. Save the generated script to /tmp/ora2pg_kunlun_test_table_ddl.sql. [Oracle]

[root@db19c ora2pg]# ora2pg -c /etc/ora2pg/ora2pg_kunlun_test_table_ddl.conf
[========================>] 3/3 tables (100.0%) end of scanning.
[========================>] 3/3 tables (100.0%) end of table export.
Fixing function calls in output files...

3.3 View the generated PostgreSQL table creation DDL script on the source side. [Oracle]

[root@db19c ora2pg]# more /tmp/ora2pg_kunlun_test_table_ddl.sql
-- Generated by Ora2Pg, the Oracle database Schema converter, version 23.2
-- Copyright 2000-2022 Gilles DAROLD. All rights reserved.
-- DATASOURCE: dbi:Oracle:host=192.168.56.104;sid=orcl;port=1521

SET client_encoding TO 'UTF8';

\set ON_ERROR_STOP ON

SET check_function_bodies = false;

SET search_path = kunlun_test,public;

CREATE TABLE categories (
        categories_id bigint NOT NULL,
        categories_image varchar(64),
        parent_id bigint NOT NULL,
        sort_order smallint,
        date_added timestamp,
        last_modified timestamp
) ;
ALTER TABLE categories ADD PRIMARY KEY (categories_id);

CREATE TABLE categories_description (
        categories_id bigint NOT NULL,
        language_id bigint NOT NULL,
        categories_name varchar(32) NOT NULL
) ;
ALTER TABLE categories_description ADD PRIMARY KEY (categories_id,language_id);

CREATE TABLE products (
        products_id bigint NOT NULL,
        products_quantity smallint NOT NULL,
        products_model varchar(12),
        products_image varchar(64),
        products_price decimal(15,4) NOT NULL,
        products_date_added timestamp NOT NULL,
        products_last_modified timestamp,
        products_date_available timestamp,
        products_weight decimal(5,2) NOT NULL,
        products_status smallint NOT NULL,
        products_tax_class_id bigint NOT NULL,
        manufacturers_id bigint,
        products_ordered bigint NOT NULL
) ;
ALTER TABLE products ADD PRIMARY KEY (products_id);

3.4 Copy the DDL table creation script (ora2pg_kunlun_test_table_ddl.sql) from the source to the /tmp directory on the target Klustron cluster compute node.

[root@db19c ora2pg]# scp /tmp/ora2pg_kunlun_test_table_ddl.sql kunlun@192.168.56.112:/tmp
kunlun@192.168.56.112's password:

ora2pg_kunlun_test_table_ddl.sql                  100% 1339     1.2MB/s   00:00

3.5 Execute the ora2pg_kunlun_test_table_ddl.sql table creation script on the Klustron target side. [Klustron]

[kunlun@kunlun1 ~]$ psql -h 192.168.56.112 -p 47001 -U kunlun_test testdb
psql (Kunlun-1.2.1 on x86_64-pc-linux-gnu, 64-bit)
Type "help" for help.

testdb=> \i /tmp/ora2pg_kunlun_test_table_ddl.sql
SET
SET
SET
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
testdb=> \d
                   List of relations
 Schema |          Name          | Type  |    Owner
--------+------------------------+-------+-------------
 public | categories             | table | kunlun_test
 public | categories_description | table | kunlun_test
 public | products               | table | kunlun_test
(3 rows)

3.6 Set up the ora2pg configuration file on the source database server, configure the file for exporting table data, and add the following content. [Oracle]

[root@db19c ora2pg]# pwd
/etc/ora2pg
[root@db19c ora2pg]# more ora2pg_kunlun_test_data.conf
ORACLE_HOME     /u01/app/oracle/product/19.0.0/db_1
ORACLE_DSN      dbi:Oracle:host=192.168.56.104;sid=orcl;port=1521
ORACLE_USER     system
ORACLE_PWD      oracle
SCHEMA          kunlun_test
EXPORT_SCHEMA   1
CREATE_SCHEMA   0
TYPE            COPY
PG_NUMERIC_TYPE 0
PG_INTEGER_TYPE 1
DEFAULT_NUMERIC bigint
SKIP fkeys checks
NLS_LANG                AMERICAN_AMERICA.UTF8
OUTPUT_DIR              /tmp
OUTPUT                  ora2pg_kunlunt_test_data.sql
PG_DSN          dbi:Pg:dbname=testdb;host=192.168.56.112;port=47001
PG_USER         kunlun_test
PG_PWD          kunlun
PG_VERSION              11

3.7 On the source database server, execute the ora2pg command to migrate the data to the Klustron database. [Oracle]

[root@db19c ora2pg]# ora2pg -c /etc/ora2pg/ora2pg_kunlun_test_data.conf

[========================>] 3/3 tables (100.0%) end of scanning.

SET client_encoding TO 'UTF8';
SET synchronous_commit TO off;

[========================>] 21/21 rows (100.0%) Table CATEGORIES (21 recs/sec)
[========================>] 21/21 total rows (100.0%) - (0 sec., avg: 21 recs/sec).
[========================>] 21/21 rows (100.0%) on total estimated data (1 sec., avg: 21 recs/sec)
SET client_encoding TO 'UTF8';
SET synchronous_commit TO off;

[========================>] 21/0 rows (100.0%) Table CATEGORIES_DESCRIPTION (21 recs/sec)
[========================>] 42/21 total rows (200.0%) - (0 sec., avg: 42 recs/sec).
[========================>] 21/21 rows (100.0%) on total estimated data (1 sec., avg: 21 recs/sec)
SET client_encoding TO 'UTF8';
SET synchronous_commit TO off;

[========================>] 28/0 rows (100.0%) Table PRODUCTS (28 recs/sec)
[========================>] 70/21 total rows (333.3%) - (0 sec., avg: 70 recs/sec).
[========================>] 21/21 rows (100.0%) on total estimated data (1 sec., avg: 21 recs/sec)
Fixing function calls in output files...
[root@db19c tmp]#

4 Data Verification

4.1 In the source database, check the record count for all tables migrated under the kunlun_test user. [Oracle]

[oracle@db19c ~]$ sqlplus kunlun_test/kunlun
SQL> select * from tab;

TNAME                     TABTYPE        CLUSTERID
------------------------- ------------- ----------
CATEGORIES                 TABLE
CATEGORIES_DESCRIPTION   TABLE
PRODUCTS                   TABLE

SQL>
SQL> select count(*) from CATEGORIES;

  COUNT(*)
----------
        21

SQL> select count(*) from CATEGORIES_DESCRIPTION;

  COUNT(*)
----------
        21

SQL>
SQL> select count(*) from PRODUCTS;

  COUNT(*)
----------
        28

4.2 In the target database, check the record count for all migrated tables and ensure they match the source database. [Klustron]

[kunlun@kunlun1 ~]$ psql -h 192.168.56.112 -p 47001 -U kunlun_test testdb
psql (Kunlun-1.2.1 on x86_64-pc-linux-gnu, 64-bit)
Type "help" for help.

testdb=>
testdb=> \d
                   List of relations
 Schema |          Name          | Type  |    Owner
--------+------------------------+-------+-------------
 public | categories             | table | kunlun_test
 public | categories_description   | table | kunlun_test
 public | products              | table | kunlun_test
(3 rows)

testdb=>
testdb=> select count(*) from categories;
 count
-------
    21
(1 row)

testdb=> select count(*) from categories_description;
 count
-------
    21
(1 row)

testdb=> select count(*) from products;
 count
-------
    28
(1 row)

testdb=>

Data has been successfully migrated to the Klustron database with integrity.

END