Implementing Siebel Business Applications on DB2 UDB for z/OS > Customizing a Development Environment >

How Siebel Implements LONG Columns on DB2 for z/OS


Siebel Business Applications uses LONG columns on RDBMS tables to store arbitrarily long character data up to 16350 characters. Examples include scripts, emails, notes, and descriptions. On all RDBMS platforms, except DB2 for z/OS, the size of LONG columns is fixed and is independent of the size of the table space in which the table is defined.

On DB2 for z/OS, a LONG column defined in the Siebel Schema is mapped to a LONG VARCHAR column. The size of a LONG VARCHAR column on DB2 for z/OS varies depending on two factors:

  • The size of the table space in which the table is defined.
  • The combined byte size of all non-LONG VARCHAR columns of the table.

You can estimate the size of the LONG VARCHAR column by calculating the size of the table space minus the size of all non-LONG VARCHAR columns; the LONG VARCHAR column takes up the remainder of the space in the table space. For example, a table containing one LONG VARCHAR column, defined in a 16 KB table space, with a combined byte size for non-LONG VARCHAR columns of 5 KB, results in the LONG VARCHAR column having a size of about 11 KB. For more information on calculating the size of LONG VARCHAR columns, refer to the vendor documentation on the IBM Web site.

How Siebel Business Applications Store Tables with LONG VARCHAR Columns

If Siebel Business Applications created all LONG VARCHAR columns on DB2 for z/OS with a length of 16,350 characters, this would effectively force all tables to a 32 KB table space; this table space size increases buffer pool storage requirements. To minimize the number of tables created in 32 KB table spaces, during the Siebel installation process, tables with LONG VARCHAR columns are created in an 8 KB table space by default. Siebel Business Applications assume that LONG VARCHAR columns have a logical length of 4046 bytes, which forces the table to be created in an 8 KB table space. However, some of the larger tables with LONG VARCHAR columns are created in 16 KB table spaces.

NOTE:  Although Siebel Business Applications set the LONG VARCHAR column to have a logical length of 4046 bytes, the physical length is not specified in the CREATE TABLE statements for the LONG VARCHAR column. So the resulting length of the LONG VARCHAR field is still calculated by the algorithm defined by DB2 for z/OS.

By taking this approach, almost all aspects of the Siebel application function without problems. However, if your implementation involves a usage scenario in which very large notes, descriptions, emails, or other items up to 16, 350 characters in length are stored, then you need to resolve this by considering one of the following choices:

  • Move the table to a larger table space, either 16 KB or 32 KB.

    If you move a table to a 32 KB table space, the LONG VARCHAR column can be up to 30 KB in length, increasing the storage requirements for buffer pools. Moreover, the intermediate result set or final result set of a SELECT statement containing a LONG VARCHAR column can exceed 32 KB. When the result set does exceed 32 KB, you might encounter the in-memory sort limit of DB2 for z/OS V8. When DB2 for z/OS performs an in-memory sort, the full length of the LONG VARCHAR column is added to the total row width. As a result, you might experience SQL0670N errors.

  • Use a CLOB column instead of a LONG VARCHAR column.

    For further information, see About Converting LONG VARCHARs to CLOBs.

Implementing Siebel Business Applications on DB2 UDB for z/OS Copyright © 2008, Oracle. All rights reserved.