PACK (Short Name: PAC)
Top  Previous  Next

Use the PACK command on an open database to recover unusable disk space.

pack

Options

ALL

Packs File 1 (schema information), File 2 (data), File 3 (indexes), and File 4 (large object data).

dbname

Specifies the name of the database to pack.

FOR tblname
Specifies a particular table whos indices you want to PACK.

INDEX
Use this option to PACK all indices for the currently CONNECTED database. PACK INDEX is now supported in multi-user environments. This command will execute on the currently CONNECTED database.

indexname

Packs a specified index from File 3 (indexes); this option will work when STATICDB is set on. PACK INDEX indexname is now supported in multi-user environments. This command will execute on the currently CONNECTED database.

KEYS

Packs only File 3 (indexes).

PASSWORD

Use this option to clean out bogus rows from SYS_PASSWORDS table.

PACK PASSWORD command is also supported in a multi-user session. Database must be CONNected in order to use this command.

SCHEMA

Packs only File 1 (schema information).

TABLE tblname
Packing a single table when MULTI is set ON. This parameter is very beneficial with databases that are always is use.

WITH USER CASE

Replaces the case folding/collating tables in the database with those defined in the user configuration file (RBENGINE76.CFG).

About the PACK Command

Disk space becomes unusable when you delete rows or indexes, remove columns or tables, or add or modify columns with the ALTER TABLE command. To use the PACK command, a database must be open. If the database you want to pack is not in the current directory, include the drive, path, and database name. When you pack a database that is in a different directory, R:BASE closes any open database, then opens the database you want to pack.

PACK requires the database owner's user identifier if the database is protected by the owner's user identifier.

You cannot use PACK when a database is stored on a network drive and MULTI has been set on, unless you are ONLY packing one table. Set MULTI off before packing the database.

PACK is unavailable when transaction processing is on.

Because you pack an open database, back up your database before you pack it. An interruption to a pack could cause damage to your database.

PACK Versus RELOAD
Both the PACK and RELOAD commands recover unusable disk space; however, RELOAD requires more disk space than PACK because RELOAD copies a database table by table, collects the rows of each table, then reorganizes the rows on the disk.

Example

The following command packs the concomp database in the RBWIN directory on drive C:

PACK c:\rbwin/concomp