Improving Database Efficiency
Over a period of time a small amount of degradation in system performance may be experienced. Two common causes of this are data files growing too large and disk layout fragmentation.
In Reality, utilities are provided which allow you to check for badly sized Reality files and to resize files without taking the files off-line (dynamic resizing). These utilities are discussed below under the topics Monitoring File Size and Dynamic Resizing of Files.
The traditional file resize method of selecting the optimum modulo and resizing a file during the save and restore procedure, is described in Manual Resizing.
To avoid fragmentation, an occasional FILE-SAVE followed by mkdbase -r, then an ACCOUNT-RESTORE * (O should be carried out. This can be done annually, half-yearly or even quarterly. The frequency depends on the database workload.
Caution
The O option should be used with extreme caution. Use of this option without understanding its effect on your database may result in corruption and loss of data. Refer to the topic Reality Save and Restore Facilities.
Monitoring File Size
The file monitor utility, sizemon, enables you to scan all or selected files and accounts in a Reality database to check for badly sized files.
This utility can be run from the host environment with the sizemon command, or from the Reality environment with the SIZE-MONITOR command. You must be logged on to the host as the database owner.
The file monitor utility is configurable so that you can specify all, or selected accounts and files to be scanned or ignored. It can also be configured to report all items larger than a defined size and, at the group level, to specify the degree of overflow (that is, the minimum number of overflow blocks) detected before it reports a problem. It can also be used to calculate an optimum modulo for a file that needs resizing.
Dynamic Resizing of Files
Having identified a badly sized data or index file on a partition database, you can change its size, without taking the file off-line, by running the file resize utility realresize. This utility allows you to resize a Reality file while allowing database users continuous access to it.
Note
On UNIX, realresize can only be used on a partition database.
You run the file resize utility by entering the realresize command at the UNIX shell or Windows command prompt, or by entering the RESIZE-FILE command at TCL. You must be logged on to the host as the database owner.
Resizing System Files
System files on a database (described in Introduction to the Reality Environment) cannot be resized using the normal resizing methods, that is, changing attribute 13 of the D-pointer, using CREATE-FILE, or dynamic resizing using realresize.
In order to resize one or more system files on a database, you must:
-
Create the configuration file resize in the database configs directory, if it does not already exist.
-
Enter preferred modulo entries in
/configs/resize, using the syntax described below. -
Remake the database using mkdbase -r.
Resize Syntax
The following syntax is used for entries in the resize file:
account [[DICT] file ]modulo
Example
For example, the entries:
SYSTEM 101
SYSFILES POINTER-FILE 1117
set the modulo of the SYSTEM dictionary to 101 and the modulo of the POINTER-FILE to 1117, when mkdbase -r is executed.
Comment
The resize file is only consulted when remaking a database. When first creating a database using mkdbase, you can set the size of the SYSTEM file using mkdbase -M.