Installing > Installing a Development Environment > Planning the installation
DB2 database encoding options
If you plan to install DB2, read this important background information about issues with DB2 database encoding and related sizing information. During a DB2 installation, you must identify your requirement for SBCS or MBCS data. Depending on your choice, you might have to complete some extra post-configuration steps before you build the Curam database.
What is the issue?
For a multi-byte character set (MBCS) or encoding, DB2 processes columns by their byte size, not their character length. Therefore, for multi-byte characters, a CHAR, VARCHAR, or CLOB column might store fewer characters than the column length specification indicates, depending on the actual character length.
Consider the following example:
- A CHAR or VARCHAR column that is modeled with a length of 16.
- The 16-character string, "Marge says hello" that does not have accented character, requires 16 bytes for storage in a single-byte character set (SBCS).
- A similar 16-character string, but with accented characters, "Márge says héllo", requires 18 bytes for storage in UTF-8, a multi-byte character set (MBCS).
For the single-byte data, the string fits and processing is successful. For the multi-byte data, the string does not fit, resulting in overflow errors at run time. An IBM Curam Social Program Management web client usually captures and reports field size errors in a user-friendly manner. In this case, the user receives an "un-handled server exception" error, which is an underlying SQL Code -302 error. This is because the client does not capture this size mismatch as it checks the number of characters, and not the byte length.
How Curam addresses the issue
Curam provides modeling and build-time capabilities to resize its database columns to address this issue. These capabilities are described further in the Curam Modeling Reference Guide and Curam Server Developer's Guide.
As Curam provides support for multiple languages, support for MBCS data is enabled by default with the maximum expansion set. These expansion settings are appropriate to ensure that new users, testing environments, and so on, do not encounter any errors because of their language, encoding, and database sizing. Also, users can find they require MBCS data when they import or paste data from other applications into their Curam system. However, these defaults might not be appropriate for all environments. The following section describes some considerations for changing these expansion settings.
What you must consider
It is important to carefully consider your data encoding requirements regarding DB2 and Curam to avoid unexpected behavior with how the database stores characters.
The preceding example represents a boundary case in that the data length matches the maximum column width. In many cases it is unlikely that, even with MBCS characters, an overflow situation will occur. Most data does not reach the maximum defined size. However, you must be prepared for the possibility of these error situations.
Use the database character set encoding appropriate to your application and environment. If possible, consider using an SBCS and encoding that supports your requirements. For example, CP1252 supports most Western European characters. However, CP1252 (or other SBCS encodings) might not support characters from different or "broader" character sets or encodings (for example, UTF-8) that users might be used to copying and pasting into their browser for Curam.
When installing your DB2 database, you must only identify your requirement for SBCS or MBCS data and be prepared to take appropriate action before you build your Curam database:
- If you require characters that use multiple bytes, then you must consider whether the default Curam settings are appropriate. The necessary database space is dependent on various factors such as the following factors.
- The specific character sizes. In DB2 and DB2 for z/OS, MBCS data can range from 1 to 4 bytes.
- The frequency of MBCS characters, which can depend on the application, language, locale, column usage within the application, and so on.
- The information density of the language and locale. For example, while some languages can require more bytes per character, each character can represent more information than, for instance, an alphabetic character and might fit into a field without any size adjustment.
For more information about MBCS data sizing considerations, see the Curam Server Developer's Guide section, Planning for DB2 MBCS Data.
- If an SBCS is adequate, plan to disable database expansion as described in the Curam Server Developer's Guide section: Planning for DB2 MBCS Data.
Related
Error 404 - Not Found Error 404 - Not Found
The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.