INIT Clause

The INIT clause of the ALTER FRAGMENT statement can define or modify the fragmentation strategy or the storage location of an existing table or an existing index.

The INIT clause has the following syntax.
(1)
INIT Clause

1  INIT?  WITH ROWIDS
1  %FRAGMENT BY Clause for Tables1
1 ?  PARTITION fragment   IN  dbspace
1  %FRAGMENT BY Clause for Indexes2
Element Description Restrictions Syntax
dbspace Dbspace storing fragmented data Must exist at time of execution Identifier
fragment Name of fragment No more than 2048 for same table Identifier
The INIT clause can accomplish tasks that include the following:
  • Move a nonfragmented table from one dbspace to a named fragment or to another dbspace.
  • Convert a fragmented table to a nonfragmented table.
  • Fragment an existing non-fragmented table without redefining it.
  • Convert a fragmentation strategy to another fragmentation strategy.
  • Fragment an existing index that is not fragmented without redefining the index.
  • Convert a fragmented index to a nonfragmented index.
  • Add a new rowid column to the table definition.

When you use the INIT clause to modify a table, the tabid value in the system catalog tables changes for the affected table. The constrid value of all unique and referential constraints on the table also changes.

For more information about the storage spaces in which you can store a table, see Using the IN Clause.
Attention: When you execute the ALTER FRAGMENT statement with this clause, it results in data movement if the table contains any data. If data values move, the potential exists for significant logging, for the transaction being aborted as a long transaction, and for a relatively long exclusive lock being held on the affected tables. Use this statement when it does not interfere with day-to-day operations.