Reorganizing a Single Table with SAPDBA
Use
You can use SAPDBA for Informix to reorganize a single table. SAPDBA rebuilds the table using the parameters that you specify.

In normal operation, you do not need to regularly reorganize the tables in Informix databases. Therefore, make sure you have a good reason before you reorganize.
You can change the following storage parameters for a table:
The following guidelines can help you choose the new storage parameters:
Prerequisites
Procedure
Method |
Description |
Reorganize Table by 'insert into select from …' |
SAP recommends you to normally use this method. This method runs entirely within the database (instead of using the file system) and is more rapid as well as more secure. To use it successfully there must be sufficient space available in the database to store a second copy of the table being reorganized. SAPDBA checks this. |
Reorganize Table by 'Export/Import' |
Use this method if you do not have enough space in the database for a second copy of the table to be reorganized. |
TEST UNLOAD of table (no Table Locks) |
Use this method if you want to check that there is enough space in the file system to allow the previous method to function correctly. SAPDBA only performs the export phase, including data compression, and deletes the downloaded data at the end. No table locks are needed for this method. |
Change 'Next Extent Size' or 'Lock Mode' of Table |
This is best if you only want to alter the next extent size or locking mode, because it is much simpler and quicker than the other methods. No data is moved with this method. |
SAPDBA displays:
The table parameters displayed vary, depending on the reorganization method you have chosen (that is, not all parameters appear for every method). The parameters include the following:
Parameter |
Meaning |
used size |
Shows the maximum amount of storage space that the table has ever occupied (in kilobytes). You cannot change this. |
rows |
Shows the current number of rows in the table. You cannot change this. |
first extent |
Shows the size (in kilobytes) of the first extent (physical storage unit) for the table. If a table has a large number of extents and you wish to compact it into one single extent, you would increase this value. We recommend you enter a value here that is greater than or equal to the current used size of the table. The minimum extent size is four times the page size on your system (zero is an exception – see below). If you enter a first extent size of zero, SAPDBA calculates an optimal size for the first extent. We recommend you enter zero if you want to reduce the storage space used by the table. This calculation can take some time with large tables, especially if there are blobpages present (the estimate is also less precise with blobpages). A message appears, informing you that SAPDBA is calculating: Estimating optimal size of ‘first extent’. Please wait a moment... |
next extent |
Lets you redefine the size of the next extent (physical storage unit) for the table. The value displayed is the current next extent size for the table. If you expect the table to grow very rapidly (that is, more than expected when first created) it is a good idea to increase this parameter. On the other hand, you might want to decrease it if you are sure the table will not grow very much in the future. The following limitations apply to this parameter:
|
locking mode |
Shows how the table is locked. Tables are normally locked at the row level because this increases the general availability of the data. |
target dbspace |
Shows the dbspace where the table is currently stored. This field is used to specify where the table will be stored after the reorganization, so you can change it if you want to move the table. For more information about finding a new dbspace with enough space, see Listing Dbspaces with SAPDBA. |
index options |
Lets you specify how the indexes are handled by the reorganization:
You can specify that the indexes are detached and which dbspace they are stored in.
This is available starting with Informix version 7.30. You can specify that indexes are created before or after the data has been loaded:
|
download path |
Lets you specify the working directory for reorganizing the table, if you are using the "Export/Import" method. Remember the following when you set up this directory:
|
If you are |
Then |
Performing Change 'Next Extent Size' or 'Lock Mode' of Table |
SAPDBA reorganizes the table and the procedure is complete. See "Result." |
Performing any other type of reorganization. |
SAPDBA prepares for the reorganization, which is not yet complete. |
SAPDBA reorganizes the table.

If you are using the method Reorganize Table by 'Export/Import' or TEST UNLOAD of table (no Table Locks), SAPDBA creates a directory and files during the unload phase. You do not normally need to look at this unloaded data.
For more information if there is a problem, see SAPDBA Files, Directories, and Reports.
Result
After a table reorganization, your database is less likely to run into space problems. However, you need to keep on monitoring the table, especially if it is growing rapidly. Refer to
Analyzing Table Information with SAPDBA.If you have used the method Reorganize Table by 'insert into select from …' or Reorganize Table by 'Export/Import,' see
Finishing a Table or Dbspace Reorganization with SAPDBA.
See also:
Informix documentation