db_ddl_compare

With this tool, you can see the DDL differences between the Netezza/Oracle and DB2 tables after migration. The target can be NZ (for Netezza) or ORA (for Oracle).

Usage

db_ddl_compare [-h] -target {NZ | ORA} [-host HOST] [-db DB] [-dsn DSN] 
-schema SCHEMA -table TABLE [-user USER] [-pw PW] [-nzhost NZHOST] 
[-nzdb NZDB] [-nzdsn NZDSN] [-nzschema NZSCHEMA] [-nztable NZTABLE] 
[-nzuser NZUSER] [-nzpw NZPW] [-orahost ORAHOST] [-orasvc ORASVC] 
[-oradsn ORADSN] [-oraschema ORASCHEMA] [-oratable ORATABLE] [-orauser ORAUSER] [-orapw ORAPW]

Basic parameters

-h | --help
Displays help for the command.

Required parameters

-target {NZ | ORA}
Specifies the target database type, NZ or ORA.
-schema SCHEMA
Specifies the schema under which the table exists.
-table TABLE
Specifies the table for which you are looking up statistics.

Optional parameters

-host HOST
Specifies the hostname for which you want to get details.

Localhost is the default value.

-db DB
Specifies the database for which you want to get stats. The default is BLUDB.
-dsn DSN
An alternative for the -db and -host options.
-user USER
Specifies the database user.
-pw PW
Specifies the database password.
-nzhost NZHOST
Specifies the Netezza hostname for which you want to get details.
-nzdb NZDB
Specifies the Netezza database for which you want to get stats.
-nzdsn NZDSN
An alternative for the -db and -host options.
-nzschema NZSCHEMA
Specifies the schema under which the target table exists.
-nztable NZTABLE
Specifies the table for which you are looking up statistics.
-nzuser NZUSER
Specifies the NZ database user.
-nzpw NZPW
Specifies the NZ database password.
-orahost ORAHOST
Specifies the Oracle hostname for which you want to get details.
-orasvc ORASVC
Specifies the Oracle service name for which you want to get stats.
-oradsn ORADSN
An alternative for the -db and -host options.
-oraschema ORASCHEMA
Specifies the Oracle schema under which the target table exists.
-oratable ORATABLE
Specifies the Oracle table for which you are looking up statistics.
-orauser ORAUSER
Specifies the ORA database user.
-orapw ORAPW
Specifies the ORA database password.

Examples

  • [bluadmin@host - Db2wh support_tools]$ db_ddl_compare -target NZ -schema bluadmin -table shortline -user bluadmin -pw bluadmin -nzhost nz1 -nztable shortline -nzuser admin -nzpw password -nzdb testdb
    
     Table DDL Comparison:
    COL_NAME         DB2 COL        TARGET(NZ/ORA) COL
    ---------------  -------------  ---------------------
    L_SUPPKEY        INTEGER        INTEGER
    L_LINESTATUS     CHARACTER(1)   CHARACTER(1)
    L_ORDERKEY       INTEGER        INTEGER
    L_SHIPINSTRUCT   CHARACTER(25)  CHARACTER(25)
    L_QUANTITY       DECIMAL(15,2)  NUMERIC(15,2)
    L_PARTKEY        INTEGER        INTEGER
    L_COMMITDATE     DATE           DATE
    L_RETURNFLAG     CHARACTER(1)   CHARACTER(1)
    L_COMMENT        VARCHAR(44)    CHARACTER VARYING(44)
    L_LINENUMBER     INTEGER        INTEGER
    L_EXTENDEDPRICE  DECIMAL(15,2)  NUMERIC(15,2)
    L_SHIPMODE       CHARACTER(10)  CHARACTER(10)
    L_TAX            DECIMAL(15,2)  NUMERIC(15,2)
    L_RECEIPTDATE    DATE           DATE
    L_DISCOUNT       DECIMAL(15,2)  NUMERIC(15,2)
    L_SHIPDATE       DATE           DATE