Restructuring the Database with TurboIMAGE/XL Utilities [ TurboIMAGE/XL Database Management System Reference Manual ] MPE/iX 5.0 Documentation
TurboIMAGE/XL Database Management System Reference Manual
Restructuring the Database with TurboIMAGE/XL Utilities
Using the utilities DBUNLOAD, DBUTIL, DBSCHEMA, and DBLOAD, certain
changes to the structure of an existing database, such as capacity
changes, adding additional items and sets, and repacking data sets, can
be made without having to write special programs to transfer data from
the old database to the new one. The general sequence of operations to
do this is as follows:
1. Run DBUNLOAD on the old database, copying all the data entries to
tape.
2. Purge the old database using the DBUTIL >>PURGE command.
3. Redefine the database using the same database name by modifying
the schema file, and create a new root file with the Schema
Processor, DBSCHEMA.
4. Use the DBUTIL >>CREATE command to create and initialize the data
sets of the new database.
5. Run DBLOAD on the new database using the tape created in step 1 to
put the data into the new database.
The above procedure allows only the supported structural changes to the
schema listed below. DBLOAD does not prohibit other changes; however,
the data is not guaranteed to be consistent. Supported schema changes
yield structurally intact databases and always result in a good
transformation. Commercial software packages are available that can
perform other structural changes without doing a DBUNLOAD and DBLOAD
operation.
Supported Structural Changes Using DBUNLOAD and DBLOAD
Any of the following schema changes, alone or combined, always result in
a successfully transformed database:
* Adding, changing, or deleting passwords and user class numbers.
* Changing a data item or data set name and all references to it.
* Changing data item or data set read and write class lists.
* Adding new data item definitions.
* Removing or changing definitions of unreferenced data items.
* Increasing data set capacities.
* Adding, deleting, or changing sort item designators.
* Adding and deleting automatic master paths.
Unsupported Structural Changes Using DBUNLOAD and LOAD
The following structural changes are legitimate only in certain
circumstances and can result in data set discrepancies or lost data:
* Changing primary paths.
* Adding new data items to the original end of a data entry
definition.
* Removing data items from the original end of a data entry
definition.
* Changing an automatic master to a manual master or vice versa.
* Adding or deleting a data set at the end of a schema.
* Changing the native language definition for the database.
These are unsupported schema changes. DBLOAD does not prohibit these
changes; however, the data is not guaranteed to be consistent. A change
must be judged in light of the particular database and the functioning of
DBUNLOAD and DBLOAD, described later in this chapter.
Basically, all entries from an old data set are put into the
corresponding new data set, except that no entries are directly put into
automatic masters. The entries are truncated or padded with binary zeros
as necessary to fit the entry length of the new data set. DBUNLOAD and
DBLOAD always handle full entries, without regard to item positions or
lengths. If the new data set entry is defined with the items in a
different order than the old data set, DBLOAD may not fail but the data
set entries, nevertheless, will be invalid. For example, data of type
real may now occupy the position of a character type item.
The number of the data set is determined by the order in which the data
sets we re entered in the schema file. Therefore, because data sets are
loaded by number, additions and deletions should be made at the end of
the schema. Data set one would correspond with the first data set
appearing in the schema. DBLOAD always returns a warning if it detects a
discrepancy between the number of data sets defined in the schema and the
number of data sets on the DBLOAD media, but you can allow DBLOAD to
continue after the warning if you are confident that the database will
not be corrupted.
In some circumstances, the load completes, but data is lost. For
example, data is lost if the capacity of a data set is reduced in the new
database to less than the number of data set entries on the tape. If
this is not desired, increase the capacity of the data base and restart
the DBLOAD process (refer to "Restructuring the Database with
TurboIMAGE/XL Utilities" earlier in this chapter.)
MPE/iX 5.0 Documentation