)
If you have any timestamp and a BLOB column, special attention is required for
them. This is discussed in Chapter 6, Data porting on page 127.
Note:
You should not reduce size of any field because it may cause an error
while porting data.
Enhancement
This also is the time to add any enhancement to your database using the DB2
features MySQL does not have such as referential integrity. It is very essential
for the database as it ensures the consistency of data values between related
columns in different tables. RI is usually maintained by using the primary key,
unique key, and foreign keys. Primary and unique keys are successfully migrated
using MTK. As MySQL does not support foriegn keys except for table type
InnoDB, if you want to use foriegn keys in your database you need to add them
manually.
In our sample application, based on application requirements we created
referential integrity between tables in the
referential.ddl
file, which looks like
Example 5 20.
Example 5 20 Added foreign keys
alter table itsodb.shopping_cart add constraint foreign1 foreign key (user_id)
references itsodb.users on delete set null
alter table itsodb.catalog add constraint foreign2 foreign key (id)
references itsodb.shopping_cart on delete set null
alter table itsodb.catalog add constraint foreign1 foreign key (sku)
references itsodb.oenummer on delete set null
Now we have completed the DDL modification; we executed the above changed
scripts to create the DB2 database and the objects as shown in Example 5 21.
Example 5 21 creation of tables and database in DB2 UDB
bash>db2 create database itsodb2
The CREATE DATABASE command completed successfully
bash>db2 connect to itsodb2
Database Connection Information
Database server = DB2/LINUX 8.1.4
124
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