The value of Glb.Unique is held in the following file on your Dictionary pack, with a duplicate file on your Audit pack. (If your Dictionary and Audit packs are the same, only one copy of the file is held.)
system/UNIQUE/SAVE
If the Audit pack location is changed, the file is automatically copied to the new Audit pack, unless it is the same as the Dictionary pack.
During normal processing, the current value of Glb.Unique is maintained and allocated from a table within the LINCSUPPORT library. After every thousand increments of Glb.Unique, the current value of Glb.Unique and a date time stamp are stored on both the Dictionary pack and Audit pack copies of the Glb.Unique file. The date/time stamp is used to resolve any conflicts between the two files when recovery is performed. When your application closes down normally, as well as storing the current Glb.Unique value and the date/time stamp, a normal closedown indicator is set within the Glb.Unique files.
When your application is initiated, both Glb.Unique files are opened, and the starting point for Glb.Unique allocation is from the file with the largest date/time stamp value. If only one file exists, then this file is used. Once the file to be used has been chosen, the normal closedown indicator is checked. If this is not set (meaning that this is abnormal restart), the application adds 2,500 to the value of Glb.Unique before allocating any new Glb.Unique values. This provides a buffer to ensure that duplicate Glb.Unique values are not allocated.
Changing Glb.Unique
When changing the value of Glb.Unique, consider the following points:
If TRN detects that the Glb.Unique file on the Dictionary pack is not present and there is no duplicate, it creates this file. Any required duplicate file is created at the next application startup, if the Dictionary and Audit packs are not the same.
If TRN detects that the Glb.Unique files are in use, a message is displayed, asking for the database to be closed down. TRN requires exclusive use of the files.
If TRN detects that recovery is required in any Glb.Unique location, it displays a message advising that recovery is required and recommending guidelines for the new value of Glb.Unique. It is recommended that you follow these guidelines, as the suggested increase is calculated to ensure that duplicate Glb.Unique values are not created in recovery.