How Do the Database Reorganization Utilities Work?

The database reorganization utilities (dbreorg and dbupgrade) transform the physical database tables and data to match the new dictionary. This transformation may be done using databse alter, drop, or create statements. However, in more complicated situations, it can involve copying the data to a new table, applying transformation rules during the copy, and then dropping the original table, renaming the copy, and building indexes.

When a Landmark application is built, a version stamp is placed on dictionary metadata that matches the stamp on the %LARUNDIR%\dataarea.stamp\ directory. This directory also contains a version of the LPL source metadata repository as well.

The dbupgrade and dbreorg utilities place a version stamp on the data dictionary, and create a +dict, which is just a new reference to it. When dbreorg or dbupgrade moves the +dict file, it’s really only moving the reference to the stamped dictionary, not the actual dictionary itself. A stamped dictionary is created every time buildprod is run.

Note: 

dbreorg and dbupgrade are deprecated. They should only be used at the direction of support.