Column Data Type and Constraints
This section discusses the rules applied to column data type and constraints, and the attributes that are associated with these objects.
User Defined Code
User Defined Codes are defined as CHAR type. The length can vary by the business requirements but a minimum of eight characters is recommended. You will find columns defined in less than eight characters but with internationalization in mind new columns should be defined as CHAR(10) or CHAR(12). Also note that when the code is referenced in the application the descriptions are shown to users in most cases.
System Assigned Identifier
System assigned random numbers are defined as CHAR type. The length of the column varies to meet the business requirements. Number type key columns are used when a sequential key assignment is allowed or number type is required to interface with external software. For example, Notification Upload Staging ID is a Number type because most EDI software uses a sequential key assignment mechanism. For sequential key assignment implementation, the DBMS sequence generator is used in conjunction with Number Type ID columns.
Date/Time/Timestamp
Date, Time and Timestamp columns are defined physically as DATE in Oracle. Non-null constraints are implemented only for the required columns.
Number
Numeric columns are implemented as NUMBER type in Oracle. The precision of the number should always be defined. The scale of the number might be defined. Non-null constraints are implemented for all number columns.
Fixed Length/Variable Length Character Columns
When a character column is a part of the primary key of a table define the column in CHAR type. For the non-key character columns, the length should be the defining factor. If the column length should be greater than 10, use VARCHAR2 type in Oracle.
Null Column Support
Oracle Utilities Application Framework 4.1.0 Group Fix 2 and later versions support Nullable columns. This means that the application can write NULLs instead of a blank space or zero (for numeric columns) by using NULLABLE_SW on CI_MD_TBL_FLD. If REQUIRED_SW is set to 'N' and the NULLABLE_SW is set to 'Y', the application will write a NULL in that column. The artifact generator will create hibernate mapping files with appropriate parameters so that the framework hibernate mapping types will know if a given property supports a null value.
NULLABLE_SW is not new, but has previously been used for certain fields such as dates, and some string and number foreign-key columns. Because of this, there is the possibility that there is incorrect metadata for some columns, and that turning on this new feature could result in incorrect behavior when using that metadata. The upgrade script added to FW410 Group Fix 2 fixes the metadata to make sure that the existing tables will not be affected.
This new feature only supports tables maintained by Java. Thus, enhancing any existing tables to use null columns must be done only after making sure that the tables are maintained by Java, and not COBOL.
XML Type Support
Oracle Utilities Application Framework v4.2.0.0 onwards supports XML Type. XML Type provides following advantages
1. The ability to use XQuery for querying nodes in the XML document stored within a column defined as XMLType.
2. The option to use the XML engine, which is built into the Oracle Database, to create indexes using nodes within the XML document stored in the XMLType column.
Cache and Key Validation Flags
By default, the Cache Flag is set to NONE. For most of the admin tables the CACHE Flag should be 'Cached for Batch'. This specifies that the table is cached as L2 cache to reduce database trips.
By default the Key Validation Flag is set to ALL. For tables which have the user defined keys, the KEY_VALIDATION_FLG should be set as 'ALL'. This checks the existence of the key before inserting a new one.
Table Classification and Table Volume Flags
There are multiple types of tables in the application, namely Admin system tables, Admin non-system tables, master tables and transaction tables. The Table Classification flag (TBL_CLASSIFICATION_FLG) sets the appropriate value for this lookup field to give a better view of the table classification.
Table Volume flag (TBL_VOLUME_FLG) is a customer modifiable field which is initially populated by product, but can be overridden by implementation. The field gives an idea of the relative data volume (categorized as highVolume, lowVolume and mediumVolume) of the table to make informed decisions.
Default Value Setting
The rules for setting the database default values are as follows:
• When a predefined default value is not available, set the default value of Non-null CHAR or VARCHAR columns to blank except the primary key columns.
• When a predefined default value is not available, set the default value Non-null Number columns to 0 (zero) except the primary key columns.
• No database default values should be assigned to the Non Null Date, Time, and Timestamp columns.
Foreign Key Constraints
In general, referential integrity is enforced by the application and the FK constraints are not defined in the database. Indexes are created on most of Foreign Key columns to make sure about the desired performance characteristics. However, in the specific case of ILM implementation, a few tables require Foreign Key constraints due to the referential partitioning. Such tables and corresponding Foreign Key constraints are listed in
Information Lifecycle Management and Data Archiving in MDM.