6.2.6 Import application data into DB2 UDB
Importing data into DB2 UDB can be done automatically by using MTK. MTK
creates a script containing the DB2
LOAD
commands and then executes the
script. In case of errors the script can be edited and run again.
Example 6 15 shows the DB2
LOAD
commands that were generated by MTK for
our sample project.
Example 6 15 DB2 LOAD commands for loading the data into DB2 UDB
db2 LOAD from ""/home/itsosj/mlog/catalog.dat"" of DEL modified by coldel0x09
timestampformat=\"YYYY MM DD HH:MM:SS\" insert into itsodb.catalog
db2 LOAD from ""/home/itsosj/mlog/oenumber.dat"" of DEL modified by coldel0x09
timestampformat=\"YYYY MM DD HH:MM:SS\" insert into itsodb.oenumber
db2 LOAD from ""/home/itsosj/mlog/users.dat"" of DEL modified by coldel0x09
timestampformat=\"YYYY MM DD HH:MM:SS\" insert into itsodb.users
db2 LOAD from ""/home/.../shopping_cart.dat"" of DEL modified by coldel0x09
timestampformat=\"YYYY MM DD HH:MM:SS\" insert into itsodb.shopping_cart
After importing the data into the DB2 tables, the
RUNSTATS
command should be
executed in order to recreate the statistic information about indexes. The
statistics information is used by the query optimizer. See 9.5.5, SQL execution
plan on page 308 for more information about the
RUNSTATS
command.
See Example 6 16 for the creation of the statistics information in our sample
project.
Example 6 16 DB2 RUNSTATS commands for recreating the statistics information
db2 RUNSTATS on table itsodb.catalog
DB20000I The RUNSTATS command completed successfully.
db2 RUNSTATS on table itsodb.oenumber
DB20000I The RUNSTATS command completed successfully.
db2 RUNSTATS on table itsodb.users
DB20000I The RUNSTATS command completed successfully.
db2 RUNSTATS on table itsodb.shopping_cart
DB20000I The RUNSTATS command completed successfully.
6.2.7 Basic data checking
Once the script is executed, a log file is created where messages are stored.
Please check the log file for the success of the DB2
LOAD
commands. You can
find this information in the log file as shown in Example 6 17.
150
MySQL to DB2 UDB Conversion Guide
footer
Our partners:
PHP: Hypertext Preprocessor Cheap Web Hosting
JSP Web Hosting
Ontario Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Java Hosting
Cheapest Hosting
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved