DB2 Temporal Tables – Research Required

DB2 Temporal Tables

It is usually pretty easy to quickly implement the new DB2 features.  DB2 makes it easy to improve your database performance with a new zParm or table space definition.  Unlike most of these new features, however, DB2 temporal tables need research before you implement them.  The new DB2 temporal tables offer great flexibility and many data warehouse design options that can be leveraged very effectively–or be abused–with the wrong application design.

To prepare you need to evaluate whether the application is appropriate for temporal tables.    First with DB2 temporal tables it is even more important to determine the frequency of the inserts, updates and deletes that are going to happen.  Frequencies are always a good design point for any application but it is especially important for DB2 temporal tables because of the way BUSINESS_TIME or SYSTEM_TIME is maintained and how all the data changes are captured within the associated history temporal table.   Every data change could really be two processes because rows need to be replicated into your history table. That could be a major performance consideration.

The next research points are the restrictions with DB2 temporal tables and history tables.  The temporal table must be a regular table with the added BUSINESS_TIME or SYSTEM_TIME.  No clone table capabilities, column masks, row permissions or security label columns are allowed.  The same restrictions are in place for the history table.

The temporal table and its associated history table must be kept in sync.  Restrictions also exist regarding the altering, adding or removing columns into the temporal table and the history table to guarantee integrity.  Also backup and recovery for the temporal table and its history table must be kept in sync and there are restrictions around DB2 Utilities that could delete data from these tables.  In addition once the history table is defined, its table space or table cannot be dropped.  So make sure the columns desired in your DB2 temporal tables are stable and well defined for the application.

There are several resources that should be reviewed before designing your first application using DB2 temporal tables.  The first is the IBM DB2 10 manuals.  By reading these friendly manuals you get a good understanding of the syntax, various examples and details about all the restrictions.  Next there have been some presentations about DB2 temporal tables at past IDUG conferences and IOD conferences by the early release customers.  Track down you colleagues that went to the conferences and get the CD or access to the website for the presentation downloads.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>