Move tables
- Last Updated: July 3, 2024
- 3 minute read
- OpenEdge
- Version 12.8
- Documentation
Use the PROUTIL TABLEMOVE utility to move a table and its associated indexes, LOBs, or both, from one storage area to another while the database remains online. For example:
|
_UserStatus virtual system table (VST) displays the utility's progress.
For more information on VSTs, see Virtual System Tables.If you omit the index-area parameter, the indexes associated with the table will not be moved.
Moving the records of a table from one area to another invalidates all the ROWIDs and indexes of the table. Therefore, the indexes are rebuilt automatically by the utility whether you move them or not. You can move the indexes to an application data area other than the one to which you are moving the table. If you want to move only the indexes of a table to a separate application data area, use the PROUTIL IDXMOVE utility.
Moving a table's indexes with the TABLEMOVE qualifier is more efficient than moving a table separately and then moving the indexes with the IDXMOVE utility. Moving a table separately from its indexes wastes more disk space and causes the indexes to be rebuilt twice, which also takes longer.
The PROUTIL TABLEMOVE utility operates in phases:
- Phase 1 — The records are moved to the new area and a new primary key is built.
-
Phase 2 — All the secondary indexes are built:
- If you did not specify the index-area parameter, then the indexes are rebuilt in their original area.
- If you did specify the index-area parameter, then all the indexes are moved to the new area where they are rebuilt.
- Phase 3 — All the records in the old area are removed.
- Phase 4 — All the old indexes are removed and the _StorageObject records of the indexes and the table are updated.
If you want to reuse the space used by a particular table, you can also use PROUTIL TABLEMOVE to truncate a table. See the TRUNCATE parameter for the PROUTIL TABLEMOVE qualifier.