Example of Migrating From IBM DB2

IBM DB2 JDBC Driver Information

To access DB2 download the appropriate DB2 JDBC driver.

Supported Driver

Class Name

com.ibm.db2.jcc.DB2Driver

JDBC URL

jdbc:db2://host:port1/database

1 Typical port value might be 50000.

The IBM DB2 Universal driver is a LUW driver, which can be used in Type 2 and Type 4 modes. Type 4 is a recommended mode because it requires a DB2 connect license for your workstation only. You must provide values for the host name, port number and database when using the IBM DB2 Universal Type 4 driver. Additional information may be found here.
NuoDB Migrator requires two JAR files installed on your CLASSPATH in order to work with IBM DB2. They are: db2jcc.jar and db2jcc_license_cu.jar.

Migration Command Examples

schema

The following sample command generates a NuoDB schema from a sample IBM DB2 catalog and saves the schema to /tmp/schema.sql:

$ nuodb-migrator schema                             \
        --source.driver=com.ibm.db2.jcc.DB2Driver   \
        --source.url=jdbc:db2://localhost:5000/db1  \
        --source.username=ibmuser                   \
        --source.password=ibmpwd                    \
        --output.path=/tmp/schema.sql

Run schema.sql in nuosql to load schema into NuoDB db2 database into the schema test2.

$ nuosql db2@localhost:4000 --user cloud --password user --schema test2 --file /tmp/schema.sql

dump

To dump tables from our IBM DB2 sample catalog in CSV format to the /tmp/dump directory, execute:

$ nuodb-migrator dump                               \
        --source.driver=com.ibm.db2.jcc.DB2Driver   \
        --source.url=jdbc:db2://localhost:5000/db1  \
        --source.username=ibmuser                   \
        --source.password=ibmpwd                    \
        --output.type=csv                           \
        --output.path=/tmp/dump

load

Restoring the dump to a NuoDB database called db2, into the schema test2, is performed using the load command:

$ nuodb-migrator load                                       \
        --target.url=jdbc:com.nuodb://localhost:4000/db2    \
        --target.schema=test2                               \
        --target.username=cloud                             \
        --target.password=user                              \
        --input.path=/tmp/dump