This topic describes the methods you can use to manually resize a file, data section, dictionary or index.
Four methods for changing the amount of primary space allocated to a file are available on a Reality database. They are:
To resize a file using CREATE-FILE:
If you place reallocation parameters in attribute 13 of the file definition item, the next time you perform an ACCOUNT-RESTORE, the software will resize the file.
Note: Use the R option with ACCOUNT-RESTORE if you want to suppress file resizing during that restore, as resizing a large number of files can delay completion of the restore.
The simplest way to set the reallocation parameters is to use the OPTIMUM-MODULO TCL command to find the best modulo. Then perform a logical save (ACCOUNT-SAVE for example).
When the account is restored, the system resizes the file, applying the new modulo. Subsequent restores will not resize the file unless attribute 13 shows a modulo different from that of the file when saved.
Resizing files is a time-consuming process and should be done as seldom as possible.
Dynamic resizing, available only on partition databases, enables a file to be resized while still allowing users to access it. This is carried out using the UNIX/Windows-based utility realresize, which can be executed by the database owner by entering the realresize command at the UNIX shell or Windows Command Prompt, or by entering the RESIZE-FILE command at TCL.
Note: While a file is being dynamically resized there are severe restrictions on sequential access to the file (if sequential access is required, there must be an index on the item-id). Also the resize operation on large files is extremely slow, files cannot be reduced in size, and files can only be resized once per database ‘session’ (all users must be logged off and the database shut down before a file can be resized again).
A fourth resizing method is provided specifically for
resizing database system files
(such as SYSTEM,
To resize one or more system files, the database owner must specify preferred moduli in the configuration file resize, which is in the configs directory under the database directory, and then remake the database. For more details, see the topic Resizing System Files.
Because a dictionary cannot be automatically sized, if you use the default modulo (1) for a large dictionary, it could become badly sized, resulting in poor performance. The recommended method of resizing a dictionary is as follows:
For example, to resize the dictionary of the file MYDATA (which has a single data section) to have a modulo of 11, enter the following at TCL:
:CREATE-FILE DICT TEMP 11 (S [417] File 'TEMP' created. D code =DL, modulo = 11, separ = 1 :COPY DICT MYDATA * TO:(DICT TEMP [418] File-definition item 'MYDATA' was not copied. 2 items copied. :MOVE-FILE MYDATA,MYDATA TO:MYACCOUNT TEMP,TEMP The data section that formerly resided in the "MYACCOUNT" account as a data section of the "MYDATA" file and was called "MYDATA", now resides in the "MYACCOUNT" account as a data section of the "TEMP" file and is called "TEMP" :DELETE-FILE MYDATA :RENAME-FILE TEMP TO:MYDATA The file that formerly resided in the "MYACCOUNT" account and was called "TEMP" now resides in the "MYACCOUNT" account and is called "MYDATA" :
There are two ways to change the modulo of an index:
You can delete the index using DELETE-INDEX, and then recreate it using CREATE-INDEX. If you wish, you can specify the required modulo. Unless you specify otherwise (using the Z option) the index will be configured for automatic file sizing.
If you do not specify a modulo, CREATE-INDEX will automatically size the index based on the current item count and item sizes within the data file. Indexes built in this way will allow for 20% to 30% growth in index node structures. Allowing CREATE-INDEX to calculate the modulo is recommended where the index uses relatively straightforward index keys; that is, keys based on fairly short item attributes containing text or numeric data, or a concatenation of such attributes.
You can resize the index during a save and restore procedure by setting the reallocation parameters in attribute 13 of the file definition item. If a file has associated indexes, attribute 13 is a multivalued attribute, with the first multivalue containing the required modulo and separation of the file (see Using Reallocation Parameters). The remaining multivalues contain the same information for the indexes. You can find out which multivalue corresponds to which index by examining attribute 4, which contains the names of the indexes.
To resize an index in this way, set the corresponding multivalue in attribute 13 to the required modulo and separation (the separation must always be 1), and then carry out the save and restore procedure.
Notes: