Compacting a Database File
Frequently, intensive database operations such as large updates or deletes can cause a SAND database to occupy file space that is actually empty or unused. This space can be freed by using the ndbchk program to compact the database. When compacting a database, ndbchk scans the database (.nxx) file(s), and fills any empty space with active database pages from the largest database file. If this results in the complete emptying of a database file, the empty file is deleted and ndbchk continues, using pages from the next largest file, until all empty space in the database is filled. During the compaction operation, no instances of the database can be running and the database state (as shown by nconfig) must be Dismounted. No other SAND CDBMS program, such as Octopus or nserv, can be used to access the database while the operation is in progress.
To compact a database, issue the following command from the operating system command prompt:
ndbchk -p database-name
A database can also be compacted using the SAND Enterprise Manager's Compact Database command. Consult the SAND Enterprise Manager help for more information.
The ndbchk -p command cannot be used on a database with dependent Snapshots, regardless of the run mode. In order to compact such a database, you must first remove the database's .TREE file and Update Files (*.Unn) from the directory where the primary database is located, or else merge a Snapshot that has no "child" nodes with the root database.