Skip to main content


developerWorks  >  Information Management  >

Porting to DB2 for Linux, UNIX, and Windows

Technical resources and roadmap

developerWorks
OverviewPorting stepsResources
 Step 1. Assessment
 Step 2. Planning the project
 Step 3. Education and training
 Step 4. Development environment
 Step 5. Users, groups, and permissions
 Step 6. Porting the database structure
 Step 7. Porting the database objects
 Step 8. Additional database components and products
 Step 9. Application modifications
 Step 10. Interface modifications
 Step 11. Data migration
 Step 12. Performance tuning
 Step 13. Maintenance strategy
 Step 14. Acceptance testing
 Step 15. Documentation
 Step 16. Packaging
 Step 17. Support
 

Step 6. Porting the database structure

Checklist for converting the database structure
  • Perform analysis of the source database components
  • Perform analysis of the source database logical and physical layouts
  • Perform analysis of the source database structure (tables, indexes, views, constraints, and so on.)
  • Perform analysis of the source database table data
  • Create a DB2 database
  • Perform initial database configuration
  • Create target database structure
  • Migrate sample representative test data to the DB2 database

After you perform the assessement and planning steps, you can begin the process of converting the structure (DDL) of the source database to DB2. Differences in syntax can often be fixed without a lot of effort, but in some cases, you must implement workarounds to achieve the original functionality. This is especially the case if non-standard or proprietary features are used.

Metadata is the logical Entity-Relationship model of the data, and describes the meaning of each entity, the relations that exist, and the attributes. From this model, SQL data definition language (DDL) statements can be generated to implement the model.

If the database structure is already in a logical form (that is, a modeling tool was used), it is often possible to have the modeling tool generate a new set of DDL that is specific to DB2. Otherwise, the DDL from the current system must be captured then modified so all the syntax is compatible with DB2. After the DDL is converted, it can be loaded in a DB2 database.

There are three approaches typically used to move the structure of a database:

  • Manual methods - Dump the structure using a native database utility, make manual adjustments for any non-supported syntax, and import it to DB2.
  • Metadata transport - Use a modeling tool to generate DB2-compatible DDL.
  • Porting and migration tools - Use a tool to automatically extract the structure, adjust it, and then deploy it to DB2.

Manual methods

Most DBMSs offer a utility that can extract the database structure and place it into a text file. The structure is represented as DDL statements, which can be used to re-create the structure on another database server. However, in order for the DDL to deploy successfully to DB2, any non-compatible syntax must be changed or removed.

Besides syntactical differences, changes may also be needed to account for differences in data types and other semantics. For example, there is no native BOOLEAN data type in DB2 - it must be simulated using another type such as SMALLINT or by using a user-defined type. Before converting and deploying all the DDL at once, try deploying a small representative portion and examine any errors that may be reported. From this, most of the corrections that will be needed will become evident. Once these corrections are made in the rest of the DDL, deployment should be almost error free. Consult the appropriate DB2 porting guide for more information about syntax and other differences.

Metadata transport

Many database structures are designed and deployed using modeling tools. These tools let the designer specify the database structure in the form of Entities and Relationships (E-R). The modeling tool then generates the physical model (in other words, the DDL) from the E-R description. If the database being ported was designed (and maintained) using one of these tools, porting the database structure to DB2 can be as simple as generating DB2-compatible DDL from the tool.

Porting and migration tools

Another popular way of porting a database structure (and other database objects) is with the use of a porting and migration tool. This type of tool usually extracts all relevant information from the source database, then modifies and deploys it in the destination database.

For example, the IBM Migration Toolkit (MTK) accepts a DDL file containing object definitions or connects directly to the source system and performs its own extraction. It then converts the DDL into a DB2-compatible form. You then have the option of deploying the converted DDL in a DB2 database.

Although it may seem that the conversion should be straightforward (SQL is SQL, isnt it?), there are still issues that may arise due to differences in DBMSs. For example, you may encounter issues around data type differences, storage limitations, large object handling, and other proprietary functionality or syntax used.




Back to top


 logo

Document options

Document options requiring JavaScript are not displayed


More resources
Information for IBM customers
Information for IBM business partners
DB2 Migrate Now!
Software Migration Project Office
IBM Migration Toolkit
Porting to DB2 for i5/OS
IBM Information Management Community

Special offers
Optimize database apps and services with pureQuery
Webcast: IBM solidDB
Webcast: Replication and change data

More offers