The purpose of the data dictionary in BBj and PRO/5 is to provide a description of the data contained in data files in such a way that the information in those files can be retrieved and modified using standard SQL based operations. Version 12.10 of BBj provides the option of two different data dictionary formats for databases: Legacy, and BBj.
The Legacy format is the familiar format used for a number of years by a variety of BASIS products including the BASIS ODBC Driver, PRO/5, DDBuilder, and BBj. This format has some limitations, however:
- 16-character limit for table, column and index names
- Required use of date suffixes or type definition date format mapping in order to retrieve values as an SQL_DATE type value
- No foreign key definitions (with the exception of ESQL tables)
- Unable to store specific precision and scale for type NUMERIC values
The BBj-only format is a completely different format. It is trimmed down and streamlined and does not have the limitations described in the Legacy format. Key features are:
- 255 character limit (instead of 16) on table, column, index, sequence, view and type definition names
- Foreign key references that are discoverable from 3rd party ODBC and JDBC connections
- Ability to specify a separate precision and scale on columns so that thirrd party ODBC/JDBC tools can correctly utilize this information
- Date formats stored in the column definition so no more need for date suffixes. Still maintains the ability to specify type definition dates for use with user defined type definitions. Mapping a particular date format for those type definitions is done through the Enterprise Manager.
- Ability to import/convert an existing data dictionary into the new format by simply specifying a new database name, and location for the new data dictionary files.
- No more distinction between legacy and full-featured views. All views are full featured.
- Cleaner and more compact dictionary definitions
- Dictionary format is flexible so that BASIS can enhance and add new features to is more readily.
- No changes were made to existing dictionary functionality or formatting. Existing databases act exactly the same. During conversion the process creates a new data dictionary at the specified location and all existing data from the old dictionary is migrated to the new format.
- Tables still reference the same physical data files. Table data files are NOT imported into the new database, but rather, pointed to by the new database.
- BBj recognizes the dictionary type from the type of dictionary files it finds.
- Database usage and access should be completely transparent to the user.
Converting a Database to the New Format
Using the BBj Enterprise Manager:
Select the database to convert, from the list of databases
Click the “Convert To BBj” button on the "Information" tab
Specify the name of a new database that will be created pointing to the new dictionary
Specify the location of the new data dictionary files
Once the new database is created, it can be accessed just like the old database. Consider performing necessary tests to ensure the new database is working properly but keep in mind that even though it is a new database in the Enterprise Manager, it is still pointing to the same table data files as the old database so any changes made to those table will occur in the original table data files.
Switching to the New Data Dictionary
The final step is to replace the old data dictionary with the new one. There are two options:
- Change the DICTIONARY path on the database Information panel
- Replace the old data dictionary files with the new ones
Change the DICTIONARY Path
The simplest change is to:
- Select the old database in the Enterprise Manager
- Change the location specified in the DICTIONARY field on the Information tab to point to the new data dictionary files
- Click [Save].
Now, the database will use the new data dictionary. If necessary, it is very simple to switch back to the old dictionary by simply changing the DICTIONARY location back to the old data dictionary.
Replace the Old Dictionary With the New Dictionary
This option simply replaces the existing dictionary with the new dictionary. However, it is important that the old dictionary is renamed or removed first. Do not simply copy the new dictionary files in with the old files. This will confuse the data dictionary and it may not use the dictionary expected. A directory can contain either an old dictionary or a new dictionary.