TechTip: The Need to Modernize IBM i Databases: Why and How?

  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times
You can modernize IBM i databases without "breaking" what already works.


When speaking about the modernization of the IBM i, usually the first thing that comes to mind is the modernization of the user interface, since it's the visible part of the application. Although it's clear that the benefits of revamping the green-screen user interface are considerable, it's important to remember that the user interface is only a means to access and update the database. The database holds the information, which is the most important asset of any organization.


Upon examining the majority of the IBM i databases, one is compelled to admit that the need to modernize the database is as important as, if not more important than, the user interface.



Figure 1: A reply of "no" to one or more of the questions above indicates that your database is a good candidate for modernization.

Why IBM i Databases Are Not Modern

This is not to say that DB2 for i itself is not modern. On the contrary, it's one of the most feature-rich, efficient, and modern relational databases in the world! The problem is that all this amazing technology and power is severely underused. A good analogy would be purchasing a fabulous 450 horsepower automobile only to drive it at no more than 10 miles per hour!


This is due to the fact that the database on IBM i is embedded into the OS, which automatically administers the database, making it unnecessary to have a dedicated DBA, unlike other database systems. This is certainly an advantage, but it has resulted in the fact that insufficient attention and human resources have been invested to benefit from the continual technological and methodological advancements that have occurred during the exceptional longevity of the database. This situation is perhaps manageable when a database has just a few tables, but it represents a huge risk for the organization when the database expands to contain thousands of tables and tens of thousands of columns in the course of its enduring and amazing life span.


Database Modernization Benefits

Modernizing the database provides many substantial benefits in terms of speed, functionality, and reliability, which are essential for the development of modern applications and the enhancement of existing ones. The challenge is how to overcome the "if it isn't broken, don't mess with it" syndrome. The IBM-developed "LF Surrogate" methodology described below allows re-engineering from DDS to SQL without needing to modify or even recompile the existing applications. This allows you to benefit from the continual DB2 for i enhancements available only on SQL, as well as to add automatically maintained identity columns, record alteration time stamps, and use long descriptive names for columns and tables.


The IBM LF Surrogate Methodology

The methodology developed by IBM consists of replacing a physical file (PF) with an SQL table plus a logical file called the LF Surrogate and transforming the existing logical files. When this is executed properly, your applications will continue working without requiring any modification but will use the new SQL-defined tables to read and write the database.



Figure 2: This figure shows the difference between the old way and the transformed, modernized way.


  • Characteristics of the LF Surrogate: Same system name, columns, explicit key words, access path, format level identifier as the original PF, except that it now points to the new SQL table.
  • Characteristics of the Transformed Logical File(s): Same system name, columns, explicit keywords, access path, format level identifier as the original logical file, except that it now points to the new SQL table(s).
  • Characteristics of the SQL Table: Same columns, ownership, grants, journaling, compilation parameters as the original PF. Columns have long names, identity and auditing columns are added, and indexes are defined from the keys of the original PF and associated LF. After checking that the data in the original PF is valid, it's copied into the SQL table.

By using metadata and various APIs available from the OS, it's possible to create those objects manually. You should be aware that this process is labor-intensive and error-prone, and it requires a high level of expertise. In the Modernization Redbook, IBM recommends using automated tools to perform this task.


The Diagnostic Utility

The Xcase Diagnostic Utility is a free download that will examine your database and provide a report of the readiness of your database for modernization. It will simulate performing a database modernization using the IBM LF Surrogate approach and will identify and report any issues.


Beyond DDS to SQL Modernization

Reengineering from DDS to SQL is a big step toward a modern database, but many additional benefits can be obtained by discovering and implementing the relationships that are only implicit in most IBM i databases. To find out more, click here.