Manual Resizing

This topic describes the methods you can use to manually resize a file, data section, dictionary or index.

Changing the Modulo of a File

Four methods for changing the amount of primary space allocated to a file are available on a Reality database. They are:

Using CREATE-FILE for Resizing

To resize a file using CREATE-FILE:

  1. Create the new Reality file with the required modulo using the CREATE-FILE command.
  2. Copy the existing file's contents to the new file using the COPY command.
  3. Delete the old file using the DELETE-FILE command.
  4. If required, rename the new file with the old file's name using the RENAME-FILE command.

Using Reallocation Parameters

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.

The resize parameter in attribute 13 of a D-pointer must be of the form (m,n), where m is the file modulus to be used and n is the separation. Separation should always be 1.

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 (Partition Database Only)

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).

Resizing System Files

A fourth resizing method is provided specifically for resizing database system files (such as SYSTEM, POINTER-FILE, NEWAC, SPOOL.JOBS, etc.). These are created as part of a new database and cannot be resized using the normal resizing methods described above.

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.

Changing the Modulo of a Dictionary

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:

  1. Use OPTIMUM-MODULO to find the best modulo for the dictionary.
  2. Create a new dictionary with the required modulo using CREATE-FILE. Specify the S option to suppress the creation of a self-referencing Q-pointer.
  3. Use the COPY command to copy the dictionary items into the new dictionary.
  4. Use MOVE-FILE to associate the old file's data sections with the new dictionary.
  5. Delete the old file.
  6. Rename the new dictionary to give it the same name as the old file.

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"
:

Changing the Modulo of an Index

There are two ways to change the modulo of an index: